From 07e7efdb46b2a297d4aa2db2b572c8c9950d09a6 Mon Sep 17 00:00:00 2001 From: Artsiom Tsybulko Date: Fri, 26 Sep 2025 14:49:10 +0300 Subject: [PATCH 1/2] 41044 - new OpenApi --- .openapi-generator-ignore | 15 +- .openapi-generator/FILES | 184 +- .openapi-generator/VERSION | 2 +- Pipfile | 14 +- Pipfile.lock | 738 ++-- README.md | 2 +- dev.md | 38 +- example/example.py | 8 +- generator-config.json | 5 +- generator-templates/api.mustache | 277 -- generator-templates/api_client.mustache | 719 ---- .../lenient/model_generic.mustache | 404 ++ .../lenient/partial_header.mustache | 3 + generator-templates/model.mustache | 240 -- .../strict/model_generic.mustache | 401 ++ .../strict/partial_header.mustache | 3 + regula/facesdk/webclient/__init__.py | 10 +- regula/facesdk/webclient/ext/api/group_api.py | 29 +- regula/facesdk/webclient/ext/api/match_api.py | 32 +- .../facesdk/webclient/ext/api/person_api.py | 42 +- regula/facesdk/webclient/ext/api/sdk.py | 8 +- .../facesdk/webclient/ext/api/search_api.py | 8 +- .../webclient/ext/models/detect_request.py | 2 +- .../webclient/ext/models/match_image.py | 4 +- regula/facesdk/webclient/gen/__init__.py | 367 +- regula/facesdk/webclient/gen/api/__init__.py | 33 +- .../webclient/gen/api/diagnostics_api.py | 162 - regula/facesdk/webclient/gen/api/group_api.py | 2653 +++++++++---- .../webclient/gen/api/healthcheck_api.py | 690 ++-- .../webclient/gen/api/liveness20_api.py | 565 +++ .../webclient/gen/api/liveness_2_0_api.py | 306 -- .../facesdk/webclient/gen/api/liveness_api.py | 424 -- regula/facesdk/webclient/gen/api/match_api.py | 1156 ++++-- .../facesdk/webclient/gen/api/person_api.py | 3438 ++++++++++++----- .../facesdk/webclient/gen/api/search_api.py | 416 +- regula/facesdk/webclient/gen/api_client.py | 1053 ++--- regula/facesdk/webclient/gen/api_response.py | 21 + regula/facesdk/webclient/gen/apis/__init__.py | 22 - regula/facesdk/webclient/gen/configuration.py | 336 +- regula/facesdk/webclient/gen/exceptions.py | 115 +- .../facesdk/webclient/gen/model/__init__.py | 5 - .../gen/model/add_image_to_person_request.py | 261 -- .../add_image_to_person_request_image.py | 204 - .../gen/model/add_image_to_person_response.py | 262 -- .../webclient/gen/model/attribute_config.py | 120 - .../gen/model/attribute_config_list.py | 92 - regula/facesdk/webclient/gen/model/crop.py | 180 - .../gen/model/detect_attributes_details.py | 150 - .../gen/model/detect_details_meta.py | 178 - .../webclient/gen/model/detect_request.py | 232 -- .../gen/model/detect_request_attributes.py | 120 - .../webclient/gen/model/detect_response.py | 147 - .../gen/model/detect_response_all_of.py | 120 - .../webclient/gen/model/detect_result.py | 235 -- .../facesdk/webclient/gen/model/detection.py | 230 -- .../gen/model/detection_attributes.py | 150 - .../webclient/gen/model/detection_face.py | 232 -- .../webclient/gen/model/detection_quality.py | 234 -- .../webclient/gen/model/device_info.py | 231 -- .../gen/model/face_align_type_quality.py | 109 - .../webclient/gen/model/face_attribute.py | 133 - .../model/face_image_quality_align_type.py | 109 - .../gen/model/face_image_quality_groups.py | 118 - .../face_image_quality_groups_strings.py | 118 - .../gen/model/face_image_quality_status.py | 103 - .../gen/model/face_quality_config_name.py | 238 -- .../gen/model/face_quality_scenarios.py | 124 - .../gen/model/face_quality_status.py | 103 - .../webclient/gen/model/face_rectangular.py | 92 - .../webclient/gen/model/face_sdk_result.py | 121 - .../gen/model/face_sdk_result_code.py | 217 -- .../webclient/gen/model/faces_response.py | 258 -- .../gen/model/faces_response_all_of.py | 148 - .../facesdk/webclient/gen/model/filter_op.py | 100 - .../gen/model/filter_search_request.py | 176 - regula/facesdk/webclient/gen/model/group.py | 206 - .../webclient/gen/model/group_all_of.py | 150 - .../facesdk/webclient/gen/model/group_page.py | 178 - .../webclient/gen/model/group_page_all_of.py | 122 - .../webclient/gen/model/group_response.py | 150 - .../webclient/gen/model/group_to_create.py | 180 - regula/facesdk/webclient/gen/model/image.py | 318 -- .../webclient/gen/model/image_fields.py | 258 -- .../webclient/gen/model/image_fields_image.py | 204 - .../facesdk/webclient/gen/model/image_page.py | 176 - .../webclient/gen/model/image_page_all_of.py | 120 - .../webclient/gen/model/image_source.py | 115 - .../gen/model/liveness_transaction.py | 334 -- .../webclient/gen/model/liveness_type.py | 100 - .../gen/model/match_and_search_request.py | 290 -- .../model/match_and_search_request_all_of.py | 234 -- .../match_and_search_request_all_of_images.py | 148 - .../model/match_and_search_request_images.py | 176 - .../gen/model/match_and_search_response.py | 233 -- .../model/match_and_search_response_all_of.py | 206 - ...h_and_search_response_all_of_detections.py | 176 - .../webclient/gen/model/match_image.py | 205 - .../gen/model/match_image_detection.py | 178 - .../webclient/gen/model/match_image_result.py | 316 -- .../webclient/gen/model/match_request.py | 233 -- .../match_request_output_image_params.py | 148 - .../match_request_output_image_params_crop.py | 212 - .../webclient/gen/model/match_response.py | 205 - .../gen/model/match_response_all_of.py | 178 - .../webclient/gen/model/operation_log.py | 206 - .../gen/model/output_image_params.py | 146 - regula/facesdk/webclient/gen/model/page.py | 150 - regula/facesdk/webclient/gen/model/person.py | 319 -- .../webclient/gen/model/person_all_of.py | 206 - .../gen/model/person_created_response.py | 178 - .../webclient/gen/model/person_fields.py | 235 -- .../gen/model/person_to_update_fields.py | 206 - .../webclient/gen/model/person_with_images.py | 347 -- .../gen/model/person_with_images_all_of.py | 122 - .../webclient/gen/model/persons_page.py | 176 - .../gen/model/persons_page_all_of.py | 120 - .../webclient/gen/model/persons_request.py | 291 -- .../gen/model/persons_request_all_of.py | 150 - .../webclient/gen/model/process_param.py | 226 -- .../gen/model/process_param_attributes.py | 120 - .../webclient/gen/model/quality_config.py | 154 - .../gen/model/quality_config_list.py | 92 - .../webclient/gen/model/quality_detail.py | 234 -- .../gen/model/quality_details_groups.py | 202 - .../webclient/gen/model/quality_request.py | 146 - .../webclient/gen/model/recognize_image.py | 374 -- .../gen/model/recognize_image_all_of.py | 150 - .../webclient/gen/model/resize_options.py | 178 - regula/facesdk/webclient/gen/model/rgb.py | 92 - .../webclient/gen/model/search_bad_params.py | 172 - .../webclient/gen/model/search_detection.py | 398 -- .../webclient/gen/model/search_parameters.py | 174 - .../model/search_parameters_create_person.py | 177 - .../webclient/gen/model/search_person.py | 373 -- .../gen/model/search_person_all_of.py | 148 - .../webclient/gen/model/search_request.py | 394 -- .../gen/model/search_request_all_of.py | 150 - .../webclient/gen/model/search_result.py | 150 - .../gen/model/search_result_all_of.py | 122 - .../webclient/gen/model/transaction_config.py | 92 - .../webclient/gen/model/transaction_info.py | 344 -- .../webclient/gen/model/update_group.py | 150 - regula/facesdk/webclient/gen/model_utils.py | 2037 ---------- .../facesdk/webclient/gen/models/__init__.py | 297 +- .../gen/models/add_image_to_person_request.py | 96 + .../add_image_to_person_request_data.py | 92 + .../add_image_to_person_request_image.py | 92 + .../models/add_image_to_person_response.py | 92 + .../webclient/gen/models/attribute_config.py | 83 + .../webclient/gen/models/attributes_data.py | 82 + regula/facesdk/webclient/gen/models/crop.py | 88 + .../webclient/gen/models/detail_item.py | 136 + .../gen/models/detect_attributes_details.py | 84 + .../gen/models/detect_details_meta.py | 86 + .../webclient/gen/models/detect_meta_data.py | 84 + .../webclient/gen/models/detect_request.py | 94 + .../gen/models/detect_request_data.py | 90 + .../webclient/gen/models/detect_response.py | 89 + .../gen/models/detect_response_results.py | 86 + .../webclient/gen/models/detect_result.py | 98 + .../facesdk/webclient/gen/models/detection.py | 98 + .../gen/models/detection_attributes.py | 92 + .../detection_attributes_details_inner.py | 132 + .../webclient/gen/models/detection_face.py | 90 + .../webclient/gen/models/detection_quality.py | 107 + .../webclient/gen/models/device_info.py | 111 + .../webclient/gen/models/face_attribute.py | 40 + .../models/face_image_quality_align_type.py | 32 + .../gen/models/face_image_quality_groups.py | 35 + .../face_image_quality_groups_strings.py | 35 + .../gen/models/face_image_quality_status.py | 30 + .../gen/models/face_quality_config_name.py | 75 + .../gen/models/face_quality_scenarios.py | 37 + .../webclient/gen/models/face_sdk_result.py | 83 + .../gen/models/face_sdk_result_code.py | 68 + .../webclient/gen/models/faces_response.py | 100 + .../gen/models/faces_response_data.py | 90 + .../facesdk/webclient/gen/models/filter_op.py | 29 + .../gen/models/filter_search_request.py | 87 + regula/facesdk/webclient/gen/models/group.py | 89 + .../webclient/gen/models/group_data.py | 85 + .../webclient/gen/models/group_page.py | 94 + .../webclient/gen/models/group_page_items.py | 90 + .../webclient/gen/models/group_response.py | 84 + .../webclient/gen/models/group_to_create.py | 86 + regula/facesdk/webclient/gen/models/image.py | 96 + .../webclient/gen/models/image_fields.py | 100 + .../gen/models/image_fields_image.py | 92 + .../webclient/gen/models/image_page.py | 94 + .../webclient/gen/models/image_page_items.py | 90 + .../webclient/gen/models/image_source.py | 34 + .../webclient/gen/models/liveness_type.py | 29 + .../gen/models/match_and_search_request.py | 103 + .../match_and_search_request_images_item.py | 87 + .../gen/models/match_and_search_response.py | 107 + .../models/match_and_search_response_data.py | 104 + ...nd_search_response_data_detections_item.py | 95 + .../webclient/gen/models/match_image.py | 89 + .../gen/models/match_image_detection.py | 95 + .../gen/models/match_image_result.py | 97 + .../webclient/gen/models/match_request.py | 102 + .../gen/models/match_request_data.py | 98 + .../webclient/gen/models/match_response.py | 105 + .../gen/models/match_response_data.py | 102 + .../webclient/gen/models/operation_log.py | 88 + .../gen/models/output_image_params.py | 89 + regula/facesdk/webclient/gen/models/page.py | 84 + regula/facesdk/webclient/gen/models/person.py | 97 + .../webclient/gen/models/person_data.py | 87 + .../webclient/gen/models/person_fields.py | 91 + .../webclient/gen/models/person_items.py | 90 + .../gen/models/person_to_update_fields.py | 89 + .../gen/models/person_with_images.py | 107 + .../gen/models/person_with_images_data.py | 90 + .../webclient/gen/models/persons_page.py | 94 + .../webclient/gen/models/process_param.py | 103 + .../gen/models/process_param_attributes.py | 90 + .../webclient/gen/models/quality_config.py | 86 + .../webclient/gen/models/quality_detail.py | 94 + .../gen/models/quality_details_groups.py | 90 + .../webclient/gen/models/quality_request.py | 93 + .../webclient/gen/models/recognize_image.py | 100 + .../gen/models/recognize_image_data.py | 84 + .../webclient/gen/models/resize_options.py | 86 + .../webclient/gen/models/search_bad_params.py | 86 + .../webclient/gen/models/search_detection.py | 102 + .../webclient/gen/models/search_parameters.py | 95 + .../models/search_parameters_create_person.py | 86 + .../webclient/gen/models/search_person.py | 113 + .../gen/models/search_person_data.py | 96 + .../webclient/gen/models/search_request.py | 119 + .../webclient/gen/models/search_result.py | 92 + .../webclient/gen/models/transaction_info.py | 99 + .../gen/models/transaction_labels.py | 84 + .../webclient/gen/models/update_group.py | 85 + regula/facesdk/webclient/gen/py.typed | 0 regula/facesdk/webclient/gen/rest.py | 368 +- setup.py | 7 +- setup.sh | 9 + update-models.sh | 21 +- 240 files changed, 17494 insertions(+), 27232 deletions(-) delete mode 100644 generator-templates/api.mustache delete mode 100644 generator-templates/api_client.mustache create mode 100644 generator-templates/lenient/model_generic.mustache create mode 100644 generator-templates/lenient/partial_header.mustache delete mode 100755 generator-templates/model.mustache create mode 100644 generator-templates/strict/model_generic.mustache create mode 100644 generator-templates/strict/partial_header.mustache delete mode 100644 regula/facesdk/webclient/gen/api/diagnostics_api.py create mode 100644 regula/facesdk/webclient/gen/api/liveness20_api.py delete mode 100644 regula/facesdk/webclient/gen/api/liveness_2_0_api.py delete mode 100644 regula/facesdk/webclient/gen/api/liveness_api.py create mode 100644 regula/facesdk/webclient/gen/api_response.py delete mode 100644 regula/facesdk/webclient/gen/apis/__init__.py delete mode 100644 regula/facesdk/webclient/gen/model/__init__.py delete mode 100644 regula/facesdk/webclient/gen/model/add_image_to_person_request.py delete mode 100644 regula/facesdk/webclient/gen/model/add_image_to_person_request_image.py delete mode 100644 regula/facesdk/webclient/gen/model/add_image_to_person_response.py delete mode 100644 regula/facesdk/webclient/gen/model/attribute_config.py delete mode 100644 regula/facesdk/webclient/gen/model/attribute_config_list.py delete mode 100644 regula/facesdk/webclient/gen/model/crop.py delete mode 100644 regula/facesdk/webclient/gen/model/detect_attributes_details.py delete mode 100644 regula/facesdk/webclient/gen/model/detect_details_meta.py delete mode 100644 regula/facesdk/webclient/gen/model/detect_request.py delete mode 100644 regula/facesdk/webclient/gen/model/detect_request_attributes.py delete mode 100644 regula/facesdk/webclient/gen/model/detect_response.py delete mode 100644 regula/facesdk/webclient/gen/model/detect_response_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/detect_result.py delete mode 100644 regula/facesdk/webclient/gen/model/detection.py delete mode 100644 regula/facesdk/webclient/gen/model/detection_attributes.py delete mode 100644 regula/facesdk/webclient/gen/model/detection_face.py delete mode 100644 regula/facesdk/webclient/gen/model/detection_quality.py delete mode 100644 regula/facesdk/webclient/gen/model/device_info.py delete mode 100644 regula/facesdk/webclient/gen/model/face_align_type_quality.py delete mode 100644 regula/facesdk/webclient/gen/model/face_attribute.py delete mode 100644 regula/facesdk/webclient/gen/model/face_image_quality_align_type.py delete mode 100644 regula/facesdk/webclient/gen/model/face_image_quality_groups.py delete mode 100644 regula/facesdk/webclient/gen/model/face_image_quality_groups_strings.py delete mode 100644 regula/facesdk/webclient/gen/model/face_image_quality_status.py delete mode 100644 regula/facesdk/webclient/gen/model/face_quality_config_name.py delete mode 100644 regula/facesdk/webclient/gen/model/face_quality_scenarios.py delete mode 100644 regula/facesdk/webclient/gen/model/face_quality_status.py delete mode 100644 regula/facesdk/webclient/gen/model/face_rectangular.py delete mode 100644 regula/facesdk/webclient/gen/model/face_sdk_result.py delete mode 100644 regula/facesdk/webclient/gen/model/face_sdk_result_code.py delete mode 100644 regula/facesdk/webclient/gen/model/faces_response.py delete mode 100644 regula/facesdk/webclient/gen/model/faces_response_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/filter_op.py delete mode 100644 regula/facesdk/webclient/gen/model/filter_search_request.py delete mode 100644 regula/facesdk/webclient/gen/model/group.py delete mode 100644 regula/facesdk/webclient/gen/model/group_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/group_page.py delete mode 100644 regula/facesdk/webclient/gen/model/group_page_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/group_response.py delete mode 100644 regula/facesdk/webclient/gen/model/group_to_create.py delete mode 100644 regula/facesdk/webclient/gen/model/image.py delete mode 100644 regula/facesdk/webclient/gen/model/image_fields.py delete mode 100644 regula/facesdk/webclient/gen/model/image_fields_image.py delete mode 100644 regula/facesdk/webclient/gen/model/image_page.py delete mode 100644 regula/facesdk/webclient/gen/model/image_page_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/image_source.py delete mode 100644 regula/facesdk/webclient/gen/model/liveness_transaction.py delete mode 100644 regula/facesdk/webclient/gen/model/liveness_type.py delete mode 100644 regula/facesdk/webclient/gen/model/match_and_search_request.py delete mode 100644 regula/facesdk/webclient/gen/model/match_and_search_request_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/match_and_search_request_all_of_images.py delete mode 100644 regula/facesdk/webclient/gen/model/match_and_search_request_images.py delete mode 100644 regula/facesdk/webclient/gen/model/match_and_search_response.py delete mode 100644 regula/facesdk/webclient/gen/model/match_and_search_response_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/match_and_search_response_all_of_detections.py delete mode 100644 regula/facesdk/webclient/gen/model/match_image.py delete mode 100644 regula/facesdk/webclient/gen/model/match_image_detection.py delete mode 100644 regula/facesdk/webclient/gen/model/match_image_result.py delete mode 100644 regula/facesdk/webclient/gen/model/match_request.py delete mode 100644 regula/facesdk/webclient/gen/model/match_request_output_image_params.py delete mode 100644 regula/facesdk/webclient/gen/model/match_request_output_image_params_crop.py delete mode 100644 regula/facesdk/webclient/gen/model/match_response.py delete mode 100644 regula/facesdk/webclient/gen/model/match_response_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/operation_log.py delete mode 100644 regula/facesdk/webclient/gen/model/output_image_params.py delete mode 100644 regula/facesdk/webclient/gen/model/page.py delete mode 100644 regula/facesdk/webclient/gen/model/person.py delete mode 100644 regula/facesdk/webclient/gen/model/person_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/person_created_response.py delete mode 100644 regula/facesdk/webclient/gen/model/person_fields.py delete mode 100644 regula/facesdk/webclient/gen/model/person_to_update_fields.py delete mode 100644 regula/facesdk/webclient/gen/model/person_with_images.py delete mode 100644 regula/facesdk/webclient/gen/model/person_with_images_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/persons_page.py delete mode 100644 regula/facesdk/webclient/gen/model/persons_page_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/persons_request.py delete mode 100644 regula/facesdk/webclient/gen/model/persons_request_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/process_param.py delete mode 100644 regula/facesdk/webclient/gen/model/process_param_attributes.py delete mode 100644 regula/facesdk/webclient/gen/model/quality_config.py delete mode 100644 regula/facesdk/webclient/gen/model/quality_config_list.py delete mode 100644 regula/facesdk/webclient/gen/model/quality_detail.py delete mode 100644 regula/facesdk/webclient/gen/model/quality_details_groups.py delete mode 100644 regula/facesdk/webclient/gen/model/quality_request.py delete mode 100644 regula/facesdk/webclient/gen/model/recognize_image.py delete mode 100644 regula/facesdk/webclient/gen/model/recognize_image_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/resize_options.py delete mode 100644 regula/facesdk/webclient/gen/model/rgb.py delete mode 100644 regula/facesdk/webclient/gen/model/search_bad_params.py delete mode 100644 regula/facesdk/webclient/gen/model/search_detection.py delete mode 100644 regula/facesdk/webclient/gen/model/search_parameters.py delete mode 100644 regula/facesdk/webclient/gen/model/search_parameters_create_person.py delete mode 100644 regula/facesdk/webclient/gen/model/search_person.py delete mode 100644 regula/facesdk/webclient/gen/model/search_person_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/search_request.py delete mode 100644 regula/facesdk/webclient/gen/model/search_request_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/search_result.py delete mode 100644 regula/facesdk/webclient/gen/model/search_result_all_of.py delete mode 100644 regula/facesdk/webclient/gen/model/transaction_config.py delete mode 100644 regula/facesdk/webclient/gen/model/transaction_info.py delete mode 100644 regula/facesdk/webclient/gen/model/update_group.py delete mode 100644 regula/facesdk/webclient/gen/model_utils.py create mode 100644 regula/facesdk/webclient/gen/models/add_image_to_person_request.py create mode 100644 regula/facesdk/webclient/gen/models/add_image_to_person_request_data.py create mode 100644 regula/facesdk/webclient/gen/models/add_image_to_person_request_image.py create mode 100644 regula/facesdk/webclient/gen/models/add_image_to_person_response.py create mode 100644 regula/facesdk/webclient/gen/models/attribute_config.py create mode 100644 regula/facesdk/webclient/gen/models/attributes_data.py create mode 100644 regula/facesdk/webclient/gen/models/crop.py create mode 100644 regula/facesdk/webclient/gen/models/detail_item.py create mode 100644 regula/facesdk/webclient/gen/models/detect_attributes_details.py create mode 100644 regula/facesdk/webclient/gen/models/detect_details_meta.py create mode 100644 regula/facesdk/webclient/gen/models/detect_meta_data.py create mode 100644 regula/facesdk/webclient/gen/models/detect_request.py create mode 100644 regula/facesdk/webclient/gen/models/detect_request_data.py create mode 100644 regula/facesdk/webclient/gen/models/detect_response.py create mode 100644 regula/facesdk/webclient/gen/models/detect_response_results.py create mode 100644 regula/facesdk/webclient/gen/models/detect_result.py create mode 100644 regula/facesdk/webclient/gen/models/detection.py create mode 100644 regula/facesdk/webclient/gen/models/detection_attributes.py create mode 100644 regula/facesdk/webclient/gen/models/detection_attributes_details_inner.py create mode 100644 regula/facesdk/webclient/gen/models/detection_face.py create mode 100644 regula/facesdk/webclient/gen/models/detection_quality.py create mode 100644 regula/facesdk/webclient/gen/models/device_info.py create mode 100644 regula/facesdk/webclient/gen/models/face_attribute.py create mode 100644 regula/facesdk/webclient/gen/models/face_image_quality_align_type.py create mode 100644 regula/facesdk/webclient/gen/models/face_image_quality_groups.py create mode 100644 regula/facesdk/webclient/gen/models/face_image_quality_groups_strings.py create mode 100644 regula/facesdk/webclient/gen/models/face_image_quality_status.py create mode 100644 regula/facesdk/webclient/gen/models/face_quality_config_name.py create mode 100644 regula/facesdk/webclient/gen/models/face_quality_scenarios.py create mode 100644 regula/facesdk/webclient/gen/models/face_sdk_result.py create mode 100644 regula/facesdk/webclient/gen/models/face_sdk_result_code.py create mode 100644 regula/facesdk/webclient/gen/models/faces_response.py create mode 100644 regula/facesdk/webclient/gen/models/faces_response_data.py create mode 100644 regula/facesdk/webclient/gen/models/filter_op.py create mode 100644 regula/facesdk/webclient/gen/models/filter_search_request.py create mode 100644 regula/facesdk/webclient/gen/models/group.py create mode 100644 regula/facesdk/webclient/gen/models/group_data.py create mode 100644 regula/facesdk/webclient/gen/models/group_page.py create mode 100644 regula/facesdk/webclient/gen/models/group_page_items.py create mode 100644 regula/facesdk/webclient/gen/models/group_response.py create mode 100644 regula/facesdk/webclient/gen/models/group_to_create.py create mode 100644 regula/facesdk/webclient/gen/models/image.py create mode 100644 regula/facesdk/webclient/gen/models/image_fields.py create mode 100644 regula/facesdk/webclient/gen/models/image_fields_image.py create mode 100644 regula/facesdk/webclient/gen/models/image_page.py create mode 100644 regula/facesdk/webclient/gen/models/image_page_items.py create mode 100644 regula/facesdk/webclient/gen/models/image_source.py create mode 100644 regula/facesdk/webclient/gen/models/liveness_type.py create mode 100644 regula/facesdk/webclient/gen/models/match_and_search_request.py create mode 100644 regula/facesdk/webclient/gen/models/match_and_search_request_images_item.py create mode 100644 regula/facesdk/webclient/gen/models/match_and_search_response.py create mode 100644 regula/facesdk/webclient/gen/models/match_and_search_response_data.py create mode 100644 regula/facesdk/webclient/gen/models/match_and_search_response_data_detections_item.py create mode 100644 regula/facesdk/webclient/gen/models/match_image.py create mode 100644 regula/facesdk/webclient/gen/models/match_image_detection.py create mode 100644 regula/facesdk/webclient/gen/models/match_image_result.py create mode 100644 regula/facesdk/webclient/gen/models/match_request.py create mode 100644 regula/facesdk/webclient/gen/models/match_request_data.py create mode 100644 regula/facesdk/webclient/gen/models/match_response.py create mode 100644 regula/facesdk/webclient/gen/models/match_response_data.py create mode 100644 regula/facesdk/webclient/gen/models/operation_log.py create mode 100644 regula/facesdk/webclient/gen/models/output_image_params.py create mode 100644 regula/facesdk/webclient/gen/models/page.py create mode 100644 regula/facesdk/webclient/gen/models/person.py create mode 100644 regula/facesdk/webclient/gen/models/person_data.py create mode 100644 regula/facesdk/webclient/gen/models/person_fields.py create mode 100644 regula/facesdk/webclient/gen/models/person_items.py create mode 100644 regula/facesdk/webclient/gen/models/person_to_update_fields.py create mode 100644 regula/facesdk/webclient/gen/models/person_with_images.py create mode 100644 regula/facesdk/webclient/gen/models/person_with_images_data.py create mode 100644 regula/facesdk/webclient/gen/models/persons_page.py create mode 100644 regula/facesdk/webclient/gen/models/process_param.py create mode 100644 regula/facesdk/webclient/gen/models/process_param_attributes.py create mode 100644 regula/facesdk/webclient/gen/models/quality_config.py create mode 100644 regula/facesdk/webclient/gen/models/quality_detail.py create mode 100644 regula/facesdk/webclient/gen/models/quality_details_groups.py create mode 100644 regula/facesdk/webclient/gen/models/quality_request.py create mode 100644 regula/facesdk/webclient/gen/models/recognize_image.py create mode 100644 regula/facesdk/webclient/gen/models/recognize_image_data.py create mode 100644 regula/facesdk/webclient/gen/models/resize_options.py create mode 100644 regula/facesdk/webclient/gen/models/search_bad_params.py create mode 100644 regula/facesdk/webclient/gen/models/search_detection.py create mode 100644 regula/facesdk/webclient/gen/models/search_parameters.py create mode 100644 regula/facesdk/webclient/gen/models/search_parameters_create_person.py create mode 100644 regula/facesdk/webclient/gen/models/search_person.py create mode 100644 regula/facesdk/webclient/gen/models/search_person_data.py create mode 100644 regula/facesdk/webclient/gen/models/search_request.py create mode 100644 regula/facesdk/webclient/gen/models/search_result.py create mode 100644 regula/facesdk/webclient/gen/models/transaction_info.py create mode 100644 regula/facesdk/webclient/gen/models/transaction_labels.py create mode 100644 regula/facesdk/webclient/gen/models/update_group.py create mode 100644 regula/facesdk/webclient/gen/py.typed create mode 100755 setup.sh diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index e6c8f1e..b038bbd 100755 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -1,16 +1,15 @@ docs/ test/ -.gitignore .gitlab-ci.yml .travis.yml git_push.sh -README.md -setup.cfg -setup.py test-requirements.txt -tox.ini requirements.txt - -regula/facesdk/webclient/__init__.py +tox.ini +setup.cfg +README.md +.gitignore +setup.py regula/facesdk/webclient/__init__.py -regula/facesdk/webclient/gen/model/detection_attributes.py +pyproject.toml +.github/workflows/python.yml diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 5bce473..4e46ce8 100755 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -4,101 +4,105 @@ regula/facesdk/webclient/gen/__init__.py regula/facesdk/webclient/gen/api/__init__.py regula/facesdk/webclient/gen/api/group_api.py regula/facesdk/webclient/gen/api/healthcheck_api.py -regula/facesdk/webclient/gen/api/liveness_2_0_api.py +regula/facesdk/webclient/gen/api/liveness20_api.py regula/facesdk/webclient/gen/api/match_api.py regula/facesdk/webclient/gen/api/person_api.py regula/facesdk/webclient/gen/api/search_api.py regula/facesdk/webclient/gen/api_client.py -regula/facesdk/webclient/gen/apis/__init__.py +regula/facesdk/webclient/gen/api_response.py regula/facesdk/webclient/gen/configuration.py regula/facesdk/webclient/gen/exceptions.py -regula/facesdk/webclient/gen/model/__init__.py -regula/facesdk/webclient/gen/model/add_image_to_person_request.py -regula/facesdk/webclient/gen/model/add_image_to_person_request_image.py -regula/facesdk/webclient/gen/model/add_image_to_person_response.py -regula/facesdk/webclient/gen/model/attribute_config.py -regula/facesdk/webclient/gen/model/attribute_config_list.py -regula/facesdk/webclient/gen/model/crop.py -regula/facesdk/webclient/gen/model/detect_attributes_details.py -regula/facesdk/webclient/gen/model/detect_details_meta.py -regula/facesdk/webclient/gen/model/detect_request.py -regula/facesdk/webclient/gen/model/detect_response.py -regula/facesdk/webclient/gen/model/detect_response_all_of.py -regula/facesdk/webclient/gen/model/detect_result.py -regula/facesdk/webclient/gen/model/detection.py -regula/facesdk/webclient/gen/model/detection_face.py -regula/facesdk/webclient/gen/model/detection_quality.py -regula/facesdk/webclient/gen/model/device_info.py -regula/facesdk/webclient/gen/model/face_attribute.py -regula/facesdk/webclient/gen/model/face_image_quality_align_type.py -regula/facesdk/webclient/gen/model/face_image_quality_groups.py -regula/facesdk/webclient/gen/model/face_image_quality_groups_strings.py -regula/facesdk/webclient/gen/model/face_image_quality_status.py -regula/facesdk/webclient/gen/model/face_quality_config_name.py -regula/facesdk/webclient/gen/model/face_quality_scenarios.py -regula/facesdk/webclient/gen/model/face_rectangular.py -regula/facesdk/webclient/gen/model/face_sdk_result.py -regula/facesdk/webclient/gen/model/face_sdk_result_code.py -regula/facesdk/webclient/gen/model/faces_response.py -regula/facesdk/webclient/gen/model/faces_response_all_of.py -regula/facesdk/webclient/gen/model/filter_op.py -regula/facesdk/webclient/gen/model/filter_search_request.py -regula/facesdk/webclient/gen/model/group.py -regula/facesdk/webclient/gen/model/group_all_of.py -regula/facesdk/webclient/gen/model/group_page.py -regula/facesdk/webclient/gen/model/group_page_all_of.py -regula/facesdk/webclient/gen/model/group_response.py -regula/facesdk/webclient/gen/model/group_to_create.py -regula/facesdk/webclient/gen/model/image.py -regula/facesdk/webclient/gen/model/image_fields.py -regula/facesdk/webclient/gen/model/image_page.py -regula/facesdk/webclient/gen/model/image_page_all_of.py -regula/facesdk/webclient/gen/model/image_source.py -regula/facesdk/webclient/gen/model/liveness_type.py -regula/facesdk/webclient/gen/model/match_and_search_request.py -regula/facesdk/webclient/gen/model/match_and_search_request_images.py -regula/facesdk/webclient/gen/model/match_and_search_response.py -regula/facesdk/webclient/gen/model/match_and_search_response_all_of.py -regula/facesdk/webclient/gen/model/match_and_search_response_all_of_detections.py -regula/facesdk/webclient/gen/model/match_image.py -regula/facesdk/webclient/gen/model/match_image_detection.py -regula/facesdk/webclient/gen/model/match_image_result.py -regula/facesdk/webclient/gen/model/match_request.py -regula/facesdk/webclient/gen/model/match_response.py -regula/facesdk/webclient/gen/model/match_response_all_of.py -regula/facesdk/webclient/gen/model/operation_log.py -regula/facesdk/webclient/gen/model/output_image_params.py -regula/facesdk/webclient/gen/model/page.py -regula/facesdk/webclient/gen/model/person.py -regula/facesdk/webclient/gen/model/person_all_of.py -regula/facesdk/webclient/gen/model/person_fields.py -regula/facesdk/webclient/gen/model/person_to_update_fields.py -regula/facesdk/webclient/gen/model/person_with_images.py -regula/facesdk/webclient/gen/model/person_with_images_all_of.py -regula/facesdk/webclient/gen/model/persons_page.py -regula/facesdk/webclient/gen/model/persons_page_all_of.py -regula/facesdk/webclient/gen/model/process_param.py -regula/facesdk/webclient/gen/model/process_param_attributes.py -regula/facesdk/webclient/gen/model/quality_config.py -regula/facesdk/webclient/gen/model/quality_config_list.py -regula/facesdk/webclient/gen/model/quality_detail.py -regula/facesdk/webclient/gen/model/quality_details_groups.py -regula/facesdk/webclient/gen/model/quality_request.py -regula/facesdk/webclient/gen/model/recognize_image.py -regula/facesdk/webclient/gen/model/recognize_image_all_of.py -regula/facesdk/webclient/gen/model/resize_options.py -regula/facesdk/webclient/gen/model/rgb.py -regula/facesdk/webclient/gen/model/search_bad_params.py -regula/facesdk/webclient/gen/model/search_detection.py -regula/facesdk/webclient/gen/model/search_parameters.py -regula/facesdk/webclient/gen/model/search_parameters_create_person.py -regula/facesdk/webclient/gen/model/search_person.py -regula/facesdk/webclient/gen/model/search_person_all_of.py -regula/facesdk/webclient/gen/model/search_request.py -regula/facesdk/webclient/gen/model/search_request_all_of.py -regula/facesdk/webclient/gen/model/search_result.py -regula/facesdk/webclient/gen/model/transaction_info.py -regula/facesdk/webclient/gen/model/update_group.py -regula/facesdk/webclient/gen/model_utils.py regula/facesdk/webclient/gen/models/__init__.py +regula/facesdk/webclient/gen/models/add_image_to_person_request.py +regula/facesdk/webclient/gen/models/add_image_to_person_request_data.py +regula/facesdk/webclient/gen/models/add_image_to_person_request_image.py +regula/facesdk/webclient/gen/models/add_image_to_person_response.py +regula/facesdk/webclient/gen/models/attribute_config.py +regula/facesdk/webclient/gen/models/attributes_data.py +regula/facesdk/webclient/gen/models/crop.py +regula/facesdk/webclient/gen/models/detail_item.py +regula/facesdk/webclient/gen/models/detect_attributes_details.py +regula/facesdk/webclient/gen/models/detect_details_meta.py +regula/facesdk/webclient/gen/models/detect_meta_data.py +regula/facesdk/webclient/gen/models/detect_request.py +regula/facesdk/webclient/gen/models/detect_request_data.py +regula/facesdk/webclient/gen/models/detect_response.py +regula/facesdk/webclient/gen/models/detect_response_results.py +regula/facesdk/webclient/gen/models/detect_result.py +regula/facesdk/webclient/gen/models/detection.py +regula/facesdk/webclient/gen/models/detection_attributes.py +regula/facesdk/webclient/gen/models/detection_attributes_details_inner.py +regula/facesdk/webclient/gen/models/detection_face.py +regula/facesdk/webclient/gen/models/detection_quality.py +regula/facesdk/webclient/gen/models/device_info.py +regula/facesdk/webclient/gen/models/face_attribute.py +regula/facesdk/webclient/gen/models/face_image_quality_align_type.py +regula/facesdk/webclient/gen/models/face_image_quality_groups.py +regula/facesdk/webclient/gen/models/face_image_quality_groups_strings.py +regula/facesdk/webclient/gen/models/face_image_quality_status.py +regula/facesdk/webclient/gen/models/face_quality_config_name.py +regula/facesdk/webclient/gen/models/face_quality_scenarios.py +regula/facesdk/webclient/gen/models/face_sdk_result.py +regula/facesdk/webclient/gen/models/face_sdk_result_code.py +regula/facesdk/webclient/gen/models/faces_response.py +regula/facesdk/webclient/gen/models/faces_response_data.py +regula/facesdk/webclient/gen/models/filter_op.py +regula/facesdk/webclient/gen/models/filter_search_request.py +regula/facesdk/webclient/gen/models/group.py +regula/facesdk/webclient/gen/models/group_data.py +regula/facesdk/webclient/gen/models/group_page.py +regula/facesdk/webclient/gen/models/group_page_items.py +regula/facesdk/webclient/gen/models/group_response.py +regula/facesdk/webclient/gen/models/group_to_create.py +regula/facesdk/webclient/gen/models/image.py +regula/facesdk/webclient/gen/models/image_fields.py +regula/facesdk/webclient/gen/models/image_fields_image.py +regula/facesdk/webclient/gen/models/image_page.py +regula/facesdk/webclient/gen/models/image_page_items.py +regula/facesdk/webclient/gen/models/image_source.py +regula/facesdk/webclient/gen/models/liveness_type.py +regula/facesdk/webclient/gen/models/match_and_search_request.py +regula/facesdk/webclient/gen/models/match_and_search_request_images_item.py +regula/facesdk/webclient/gen/models/match_and_search_response.py +regula/facesdk/webclient/gen/models/match_and_search_response_data.py +regula/facesdk/webclient/gen/models/match_and_search_response_data_detections_item.py +regula/facesdk/webclient/gen/models/match_image.py +regula/facesdk/webclient/gen/models/match_image_detection.py +regula/facesdk/webclient/gen/models/match_image_result.py +regula/facesdk/webclient/gen/models/match_request.py +regula/facesdk/webclient/gen/models/match_request_data.py +regula/facesdk/webclient/gen/models/match_response.py +regula/facesdk/webclient/gen/models/match_response_data.py +regula/facesdk/webclient/gen/models/operation_log.py +regula/facesdk/webclient/gen/models/output_image_params.py +regula/facesdk/webclient/gen/models/page.py +regula/facesdk/webclient/gen/models/person.py +regula/facesdk/webclient/gen/models/person_data.py +regula/facesdk/webclient/gen/models/person_fields.py +regula/facesdk/webclient/gen/models/person_items.py +regula/facesdk/webclient/gen/models/person_to_update_fields.py +regula/facesdk/webclient/gen/models/person_with_images.py +regula/facesdk/webclient/gen/models/person_with_images_data.py +regula/facesdk/webclient/gen/models/persons_page.py +regula/facesdk/webclient/gen/models/process_param.py +regula/facesdk/webclient/gen/models/process_param_attributes.py +regula/facesdk/webclient/gen/models/quality_config.py +regula/facesdk/webclient/gen/models/quality_detail.py +regula/facesdk/webclient/gen/models/quality_details_groups.py +regula/facesdk/webclient/gen/models/quality_request.py +regula/facesdk/webclient/gen/models/recognize_image.py +regula/facesdk/webclient/gen/models/recognize_image_data.py +regula/facesdk/webclient/gen/models/resize_options.py +regula/facesdk/webclient/gen/models/search_bad_params.py +regula/facesdk/webclient/gen/models/search_detection.py +regula/facesdk/webclient/gen/models/search_parameters.py +regula/facesdk/webclient/gen/models/search_parameters_create_person.py +regula/facesdk/webclient/gen/models/search_person.py +regula/facesdk/webclient/gen/models/search_person_data.py +regula/facesdk/webclient/gen/models/search_request.py +regula/facesdk/webclient/gen/models/search_result.py +regula/facesdk/webclient/gen/models/transaction_info.py +regula/facesdk/webclient/gen/models/transaction_labels.py +regula/facesdk/webclient/gen/models/update_group.py +regula/facesdk/webclient/gen/py.typed regula/facesdk/webclient/gen/rest.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 1e20ec3..368fd8f 100755 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.4.0 \ No newline at end of file +7.15.0 diff --git a/Pipfile b/Pipfile index 1fde622..a2fa284 100644 --- a/Pipfile +++ b/Pipfile @@ -6,19 +6,23 @@ name = "pypi" [packages] certifi = ">=2024.07.04" six = ">=1.10" -python-dateutil = ">=2.5.3" -urllib3 = ">=2.2.2" +python-dateutil = ">=2.8.2" +urllib3 = ">=2.5.0, <3.0.0" vistir = ">=0.4.0, <=0.6.1" idna = "==3.7" -requests = ">=2.32.3" +requests = ">=2.32.4" +pydantic = ">=2" +typing-extensions = ">=4.7.1" +lazy-imports = "==1.0.1" [dev-packages] -setuptools = ">=78.1.1" wheel = "*" twine = "*" chardet = "*" packaging = ">=22.0" -typing-extensions = "*" +types-python-dateutil = ">=2.8.19.14" +mypy = ">=1.5" +setuptools = "==78.1.1" [requires] python_version = "3.9" diff --git a/Pipfile.lock b/Pipfile.lock index 55ec4de..a0ffaaa 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a41ad7bc09be45c18ef7e519367afb3c04f98ad9634a66899c165cbf4763f468" + "sha256": "a39e6d4a60d45e81be088ea086e1c7e60a6000e7eb1b783227ce24d8535b3150" }, "pipfile-spec": 6, "requires": { @@ -16,112 +16,107 @@ ] }, "default": { + "annotated-types": { + "hashes": [ + "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", + "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89" + ], + "markers": "python_version >= '3.8'", + "version": "==0.7.0" + }, "certifi": { "hashes": [ - "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057", - "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b" + "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", + "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==2025.6.15" + "version": "==2025.8.3" }, "charset-normalizer": { "hashes": [ - "sha256:005fa3432484527f9732ebd315da8da8001593e2cf46a3d817669f062c3d9ed4", - "sha256:046595208aae0120559a67693ecc65dd75d46f7bf687f159127046628178dc45", - "sha256:0c29de6a1a95f24b9a1aa7aefd27d2487263f00dfd55a77719b530788f75cff7", - "sha256:0c8c57f84ccfc871a48a47321cfa49ae1df56cd1d965a09abe84066f6853b9c0", - "sha256:0f5d9ed7f254402c9e7d35d2f5972c9bbea9040e99cd2861bd77dc68263277c7", - "sha256:18dd2e350387c87dabe711b86f83c9c78af772c748904d372ade190b5c7c9d4d", - "sha256:1b1bde144d98e446b056ef98e59c256e9294f6b74d7af6846bf5ffdafd687a7d", - "sha256:1c95a1e2902a8b722868587c0e1184ad5c55631de5afc0eb96bc4b0d738092c0", - "sha256:1cad5f45b3146325bb38d6855642f6fd609c3f7cad4dbaf75549bf3b904d3184", - "sha256:21b2899062867b0e1fde9b724f8aecb1af14f2778d69aacd1a5a1853a597a5db", - "sha256:24498ba8ed6c2e0b56d4acbf83f2d989720a93b41d712ebd4f4979660db4417b", - "sha256:25a23ea5c7edc53e0f29bae2c44fcb5a1aa10591aae107f2a2b2583a9c5cbc64", - "sha256:289200a18fa698949d2b39c671c2cc7a24d44096784e76614899a7ccf2574b7b", - "sha256:28a1005facc94196e1fb3e82a3d442a9d9110b8434fc1ded7a24a2983c9888d8", - "sha256:32fc0341d72e0f73f80acb0a2c94216bd704f4f0bce10aedea38f30502b271ff", - "sha256:36b31da18b8890a76ec181c3cf44326bf2c48e36d393ca1b72b3f484113ea344", - "sha256:3c21d4fca343c805a52c0c78edc01e3477f6dd1ad7c47653241cf2a206d4fc58", - "sha256:3fddb7e2c84ac87ac3a947cb4e66d143ca5863ef48e4a5ecb83bd48619e4634e", - "sha256:43e0933a0eff183ee85833f341ec567c0980dae57c464d8a508e1b2ceb336471", - "sha256:4a476b06fbcf359ad25d34a057b7219281286ae2477cc5ff5e3f70a246971148", - "sha256:4e594135de17ab3866138f496755f302b72157d115086d100c3f19370839dd3a", - "sha256:50bf98d5e563b83cc29471fa114366e6806bc06bc7a25fd59641e41445327836", - "sha256:5a9979887252a82fefd3d3ed2a8e3b937a7a809f65dcb1e068b090e165bbe99e", - "sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63", - "sha256:5bf4545e3b962767e5c06fe1738f951f77d27967cb2caa64c28be7c4563e162c", - "sha256:6333b3aa5a12c26b2a4d4e7335a28f1475e0e5e17d69d55141ee3cab736f66d1", - "sha256:65c981bdbd3f57670af8b59777cbfae75364b483fa8a9f420f08094531d54a01", - "sha256:68a328e5f55ec37c57f19ebb1fdc56a248db2e3e9ad769919a58672958e8f366", - "sha256:6a0289e4589e8bdfef02a80478f1dfcb14f0ab696b5a00e1f4b8a14a307a3c58", - "sha256:6b66f92b17849b85cad91259efc341dce9c1af48e2173bf38a85c6329f1033e5", - "sha256:6c9379d65defcab82d07b2a9dfbfc2e95bc8fe0ebb1b176a3190230a3ef0e07c", - "sha256:6fc1f5b51fa4cecaa18f2bd7a003f3dd039dd615cd69a2afd6d3b19aed6775f2", - "sha256:70f7172939fdf8790425ba31915bfbe8335030f05b9913d7ae00a87d4395620a", - "sha256:721c76e84fe669be19c5791da68232ca2e05ba5185575086e384352e2c309597", - "sha256:7222ffd5e4de8e57e03ce2cef95a4c43c98fcb72ad86909abdfc2c17d227fc1b", - "sha256:75d10d37a47afee94919c4fab4c22b9bc2a8bf7d4f46f87363bcf0573f3ff4f5", - "sha256:76af085e67e56c8816c3ccf256ebd136def2ed9654525348cfa744b6802b69eb", - "sha256:770cab594ecf99ae64c236bc9ee3439c3f46be49796e265ce0cc8bc17b10294f", - "sha256:7a6ab32f7210554a96cd9e33abe3ddd86732beeafc7a28e9955cdf22ffadbab0", - "sha256:7c48ed483eb946e6c04ccbe02c6b4d1d48e51944b6db70f697e089c193404941", - "sha256:7f56930ab0abd1c45cd15be65cc741c28b1c9a34876ce8c17a2fa107810c0af0", - "sha256:8075c35cd58273fee266c58c0c9b670947c19df5fb98e7b66710e04ad4e9ff86", - "sha256:8272b73e1c5603666618805fe821edba66892e2870058c94c53147602eab29c7", - "sha256:82d8fd25b7f4675d0c47cf95b594d4e7b158aca33b76aa63d07186e13c0e0ab7", - "sha256:844da2b5728b5ce0e32d863af26f32b5ce61bc4273a9c720a9f3aa9df73b1455", - "sha256:8755483f3c00d6c9a77f490c17e6ab0c8729e39e6390328e42521ef175380ae6", - "sha256:915f3849a011c1f593ab99092f3cecfcb4d65d8feb4a64cf1bf2d22074dc0ec4", - "sha256:926ca93accd5d36ccdabd803392ddc3e03e6d4cd1cf17deff3b989ab8e9dbcf0", - "sha256:982bb1e8b4ffda883b3d0a521e23abcd6fd17418f6d2c4118d257a10199c0ce3", - "sha256:98f862da73774290f251b9df8d11161b6cf25b599a66baf087c1ffe340e9bfd1", - "sha256:9cbfacf36cb0ec2897ce0ebc5d08ca44213af24265bd56eca54bee7923c48fd6", - "sha256:a370b3e078e418187da8c3674eddb9d983ec09445c99a3a263c2011993522981", - "sha256:a955b438e62efdf7e0b7b52a64dc5c3396e2634baa62471768a64bc2adb73d5c", - "sha256:aa6af9e7d59f9c12b33ae4e9450619cf2488e2bbe9b44030905877f0b2324980", - "sha256:aa88ca0b1932e93f2d961bf3addbb2db902198dca337d88c89e1559e066e7645", - "sha256:aaeeb6a479c7667fbe1099af9617c83aaca22182d6cf8c53966491a0f1b7ffb7", - "sha256:aaf27faa992bfee0264dc1f03f4c75e9fcdda66a519db6b957a3f826e285cf12", - "sha256:b2680962a4848b3c4f155dc2ee64505a9c57186d0d56b43123b17ca3de18f0fa", - "sha256:b2d318c11350e10662026ad0eb71bb51c7812fc8590825304ae0bdd4ac283acd", - "sha256:b33de11b92e9f75a2b545d6e9b6f37e398d86c3e9e9653c4864eb7e89c5773ef", - "sha256:b3daeac64d5b371dea99714f08ffc2c208522ec6b06fbc7866a450dd446f5c0f", - "sha256:be1e352acbe3c78727a16a455126d9ff83ea2dfdcbc83148d2982305a04714c2", - "sha256:bee093bf902e1d8fc0ac143c88902c3dfc8941f7ea1d6a8dd2bcb786d33db03d", - "sha256:c72fbbe68c6f32f251bdc08b8611c7b3060612236e960ef848e0a517ddbe76c5", - "sha256:c9e36a97bee9b86ef9a1cf7bb96747eb7a15c2f22bdb5b516434b00f2a599f02", - "sha256:cddf7bd982eaa998934a91f69d182aec997c6c468898efe6679af88283b498d3", - "sha256:cf713fe9a71ef6fd5adf7a79670135081cd4431c2943864757f0fa3a65b1fafd", - "sha256:d11b54acf878eef558599658b0ffca78138c8c3655cf4f3a4a673c437e67732e", - "sha256:d41c4d287cfc69060fa91cae9683eacffad989f1a10811995fa309df656ec214", - "sha256:d524ba3f1581b35c03cb42beebab4a13e6cdad7b36246bd22541fa585a56cccd", - "sha256:daac4765328a919a805fa5e2720f3e94767abd632ae410a9062dff5412bae65a", - "sha256:db4c7bf0e07fc3b7d89ac2a5880a6a8062056801b83ff56d8464b70f65482b6c", - "sha256:dc7039885fa1baf9be153a0626e337aa7ec8bf96b0128605fb0d77788ddc1681", - "sha256:dccab8d5fa1ef9bfba0590ecf4d46df048d18ffe3eec01eeb73a42e0d9e7a8ba", - "sha256:dedb8adb91d11846ee08bec4c8236c8549ac721c245678282dcb06b221aab59f", - "sha256:e45ba65510e2647721e35323d6ef54c7974959f6081b58d4ef5d87c60c84919a", - "sha256:e53efc7c7cee4c1e70661e2e112ca46a575f90ed9ae3fef200f2a25e954f4b28", - "sha256:e635b87f01ebc977342e2697d05b56632f5f879a4f15955dfe8cef2448b51691", - "sha256:e70e990b2137b29dc5564715de1e12701815dacc1d056308e2b17e9095372a82", - "sha256:e8082b26888e2f8b36a042a58307d5b917ef2b1cacab921ad3323ef91901c71a", - "sha256:e8323a9b031aa0393768b87f04b4164a40037fb2a3c11ac06a03ffecd3618027", - "sha256:e92fca20c46e9f5e1bb485887d074918b13543b1c2a1185e69bb8d17ab6236a7", - "sha256:eb30abc20df9ab0814b5a2524f23d75dcf83cde762c161917a2b4b7b55b1e518", - "sha256:eba9904b0f38a143592d9fc0e19e2df0fa2e41c3c3745554761c5f6447eedabf", - "sha256:ef8de666d6179b009dce7bcb2ad4c4a779f113f12caf8dc77f0162c29d20490b", - "sha256:efd387a49825780ff861998cd959767800d54f8308936b21025326de4b5a42b9", - "sha256:f0aa37f3c979cf2546b73e8222bbfa3dc07a641585340179d768068e3455e544", - "sha256:f4074c5a429281bf056ddd4c5d3b740ebca4d43ffffe2ef4bf4d2d05114299da", - "sha256:f69a27e45c43520f5487f27627059b64aaf160415589230992cec34c5e18a509", - "sha256:fb707f3e15060adf5b7ada797624a6c6e0138e2a26baa089df64c68ee98e040f", - "sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a", - "sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f" + "sha256:00237675befef519d9af72169d8604a067d92755e84fe76492fef5441db05b91", + "sha256:02425242e96bcf29a49711b0ca9f37e451da7c70562bc10e8ed992a5a7a25cc0", + "sha256:027b776c26d38b7f15b26a5da1044f376455fb3766df8fc38563b4efbc515154", + "sha256:07a0eae9e2787b586e129fdcbe1af6997f8d0e5abaa0bc98c0e20e124d67e601", + "sha256:0cacf8f7297b0c4fcb74227692ca46b4a5852f8f4f24b3c766dd94a1075c4884", + "sha256:0e78314bdc32fa80696f72fa16dc61168fda4d6a0c014e0380f9d02f0e5d8a07", + "sha256:0f2be7e0cf7754b9a30eb01f4295cc3d4358a479843b31f328afd210e2c7598c", + "sha256:13faeacfe61784e2559e690fc53fa4c5ae97c6fcedb8eb6fb8d0a15b475d2c64", + "sha256:14c2a87c65b351109f6abfc424cab3927b3bdece6f706e4d12faaf3d52ee5efe", + "sha256:1606f4a55c0fd363d754049cdf400175ee96c992b1f8018b993941f221221c5f", + "sha256:16a8770207946ac75703458e2c743631c79c59c5890c80011d536248f8eaa432", + "sha256:18343b2d246dc6761a249ba1fb13f9ee9a2bcd95decc767319506056ea4ad4dc", + "sha256:18b97b8404387b96cdbd30ad660f6407799126d26a39ca65729162fd810a99aa", + "sha256:1bb60174149316da1c35fa5233681f7c0f9f514509b8e399ab70fea5f17e45c9", + "sha256:1e8ac75d72fa3775e0b7cb7e4629cec13b7514d928d15ef8ea06bca03ef01cae", + "sha256:1ef99f0456d3d46a50945c98de1774da86f8e992ab5c77865ea8b8195341fc19", + "sha256:2001a39612b241dae17b4687898843f254f8748b796a2e16f1051a17078d991d", + "sha256:23b6b24d74478dc833444cbd927c338349d6ae852ba53a0d02a2de1fce45b96e", + "sha256:252098c8c7a873e17dd696ed98bbe91dbacd571da4b87df3736768efa7a792e4", + "sha256:257f26fed7d7ff59921b78244f3cd93ed2af1800ff048c33f624c87475819dd7", + "sha256:2c322db9c8c89009a990ef07c3bcc9f011a3269bc06782f916cd3d9eed7c9312", + "sha256:30a96e1e1f865f78b030d65241c1ee850cdf422d869e9028e2fc1d5e4db73b92", + "sha256:30d006f98569de3459c2fc1f2acde170b7b2bd265dc1943e87e1a4efe1b67c31", + "sha256:31a9a6f775f9bcd865d88ee350f0ffb0e25936a7f930ca98995c05abf1faf21c", + "sha256:320e8e66157cc4e247d9ddca8e21f427efc7a04bbd0ac8a9faf56583fa543f9f", + "sha256:34a7f768e3f985abdb42841e20e17b330ad3aaf4bb7e7aeeb73db2e70f077b99", + "sha256:3653fad4fe3ed447a596ae8638b437f827234f01a8cd801842e43f3d0a6b281b", + "sha256:3cd35b7e8aedeb9e34c41385fda4f73ba609e561faedfae0a9e75e44ac558a15", + "sha256:3cfb2aad70f2c6debfbcb717f23b7eb55febc0bb23dcffc0f076009da10c6392", + "sha256:416175faf02e4b0810f1f38bcb54682878a4af94059a1cd63b8747244420801f", + "sha256:41d1fc408ff5fdfb910200ec0e74abc40387bccb3252f3f27c0676731df2b2c8", + "sha256:42e5088973e56e31e4fa58eb6bd709e42fc03799c11c42929592889a2e54c491", + "sha256:4ca4c094de7771a98d7fbd67d9e5dbf1eb73efa4f744a730437d8a3a5cf994f0", + "sha256:511729f456829ef86ac41ca78c63a5cb55240ed23b4b737faca0eb1abb1c41bc", + "sha256:53cd68b185d98dde4ad8990e56a58dea83a4162161b1ea9272e5c9182ce415e0", + "sha256:585f3b2a80fbd26b048a0be90c5aae8f06605d3c92615911c3a2b03a8a3b796f", + "sha256:5b413b0b1bfd94dbf4023ad6945889f374cd24e3f62de58d6bb102c4d9ae534a", + "sha256:5d8d01eac18c423815ed4f4a2ec3b439d654e55ee4ad610e153cf02faf67ea40", + "sha256:6aab0f181c486f973bc7262a97f5aca3ee7e1437011ef0c2ec04b5a11d16c927", + "sha256:6cf8fd4c04756b6b60146d98cd8a77d0cdae0e1ca20329da2ac85eed779b6849", + "sha256:6fb70de56f1859a3f71261cbe41005f56a7842cc348d3aeb26237560bfa5e0ce", + "sha256:6fce4b8500244f6fcb71465d4a4930d132ba9ab8e71a7859e6a5d59851068d14", + "sha256:70bfc5f2c318afece2f5838ea5e4c3febada0be750fcf4775641052bbba14d05", + "sha256:73dc19b562516fc9bcf6e5d6e596df0b4eb98d87e4f79f3ae71840e6ed21361c", + "sha256:74d77e25adda8581ffc1c720f1c81ca082921329452eba58b16233ab1842141c", + "sha256:78deba4d8f9590fe4dae384aeff04082510a709957e968753ff3c48399f6f92a", + "sha256:86df271bf921c2ee3818f0522e9a5b8092ca2ad8b065ece5d7d9d0e9f4849bcc", + "sha256:88ab34806dea0671532d3f82d82b85e8fc23d7b2dd12fa837978dad9bb392a34", + "sha256:8999f965f922ae054125286faf9f11bc6932184b93011d138925a1773830bbe9", + "sha256:8dcfc373f888e4fb39a7bc57e93e3b845e7f462dacc008d9749568b1c4ece096", + "sha256:939578d9d8fd4299220161fdd76e86c6a251987476f5243e8864a7844476ba14", + "sha256:96b2b3d1a83ad55310de8c7b4a2d04d9277d5591f40761274856635acc5fcb30", + "sha256:a2d08ac246bb48479170408d6c19f6385fa743e7157d716e144cad849b2dd94b", + "sha256:b256ee2e749283ef3ddcff51a675ff43798d92d746d1a6e4631bf8c707d22d0b", + "sha256:b5e3b2d152e74e100a9e9573837aba24aab611d39428ded46f4e4022ea7d1942", + "sha256:b89bc04de1d83006373429975f8ef9e7932534b8cc9ca582e4db7d20d91816db", + "sha256:bd28b817ea8c70215401f657edef3a8aa83c29d447fb0b622c35403780ba11d5", + "sha256:c60e092517a73c632ec38e290eba714e9627abe9d301c8c8a12ec32c314a2a4b", + "sha256:c6dbd0ccdda3a2ba7c2ecd9d77b37f3b5831687d8dc1b6ca5f56a4880cc7b7ce", + "sha256:c6e490913a46fa054e03699c70019ab869e990270597018cef1d8562132c2669", + "sha256:c6f162aabe9a91a309510d74eeb6507fab5fff92337a15acbe77753d88d9dcf0", + "sha256:c6fd51128a41297f5409deab284fecbe5305ebd7e5a1f959bee1c054622b7018", + "sha256:cc34f233c9e71701040d772aa7490318673aa7164a0efe3172b2981218c26d93", + "sha256:cc9370a2da1ac13f0153780040f465839e6cccb4a1e44810124b4e22483c93fe", + "sha256:ccf600859c183d70eb47e05a44cd80a4ce77394d1ac0f79dbd2dd90a69a3a049", + "sha256:ce571ab16d890d23b5c278547ba694193a45011ff86a9162a71307ed9f86759a", + "sha256:cf1ebb7d78e1ad8ec2a8c4732c7be2e736f6e5123a4146c5b89c9d1f585f8cef", + "sha256:d0e909868420b7049dafd3a31d45125b31143eec59235311fc4c57ea26a4acd2", + "sha256:d22dbedd33326a4a5190dd4fe9e9e693ef12160c77382d9e87919bce54f3d4ca", + "sha256:d716a916938e03231e86e43782ca7878fb602a125a91e7acb8b5112e2e96ac16", + "sha256:d79c198e27580c8e958906f803e63cddb77653731be08851c7df0b1a14a8fc0f", + "sha256:d95bfb53c211b57198bb91c46dd5a2d8018b3af446583aab40074bf7988401cb", + "sha256:e28e334d3ff134e88989d90ba04b47d84382a828c061d0d1027b1b12a62b39b1", + "sha256:ec557499516fc90fd374bf2e32349a2887a876fbf162c160e3c01b6849eaf557", + "sha256:fb6fecfd65564f208cbf0fba07f107fb661bcd1a7c389edbced3f7a493f70e37", + "sha256:fb731e5deb0c7ef82d698b0f4c5bb724633ee2a489401594c5c88b02e6cb15f7", + "sha256:fb7f67a1bfa6e40b438170ebdc8158b78dc465a5a67b6dde178a46987b244a72", + "sha256:fd10de089bcdcd1be95a2f73dbe6254798ec1bda9f450d5828c96f93e2536b9c", + "sha256:fdabf8315679312cfa71302f9bd509ded4f2f263fb5b765cf1433b39106c3cc9" ], "markers": "python_version >= '3.7'", - "version": "==3.4.2" + "version": "==3.4.3" }, "colorama": { "hashes": [ @@ -140,23 +135,146 @@ "markers": "python_version >= '3.5'", "version": "==3.7" }, + "lazy-imports": { + "hashes": [ + "sha256:7d3e4b1547cb574ec7ef3c47a074673e2612330b2b50bf7eec939f2c393fc261", + "sha256:eb5accc33bf9987e5197e79476bbeb960b74a2c16619bdf41281b3240f730846" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==1.0.1" + }, + "pydantic": { + "hashes": [ + "sha256:6b8ffda597a14812a7975c90b82a8a2e777d9257aba3453f973acd3c032a18e2", + "sha256:c42dd626f5cfc1c6950ce6205ea58c93efa406da65f479dcb4029d5934857da2" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==2.11.9" + }, + "pydantic-core": { + "hashes": [ + "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d", + "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac", + "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02", + "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56", + "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4", + "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22", + "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef", + "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec", + "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d", + "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b", + "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a", + "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f", + "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052", + "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab", + "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916", + "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c", + "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf", + "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27", + "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a", + "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8", + "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7", + "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612", + "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1", + "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039", + "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca", + "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7", + "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a", + "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6", + "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782", + "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b", + "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7", + "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025", + "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849", + "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7", + "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b", + "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa", + "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e", + "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea", + "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac", + "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51", + "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e", + "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162", + "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65", + "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2", + "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954", + "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b", + "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de", + "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc", + "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64", + "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb", + "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9", + "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101", + "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d", + "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef", + "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3", + "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1", + "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5", + "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88", + "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d", + "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290", + "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e", + "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d", + "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808", + "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc", + "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d", + "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc", + "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e", + "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640", + "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30", + "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e", + "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9", + "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a", + "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9", + "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f", + "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb", + "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5", + "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab", + "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d", + "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572", + "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593", + "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29", + "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535", + "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1", + "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f", + "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8", + "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf", + "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246", + "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9", + "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011", + "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9", + "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a", + "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3", + "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6", + "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8", + "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a", + "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2", + "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c", + "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6", + "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d" + ], + "markers": "python_version >= '3.9'", + "version": "==2.33.2" + }, "python-dateutil": { "hashes": [ "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427" ], "index": "pypi", - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==2.9.0.post0" }, "requests": { "hashes": [ - "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c", - "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422" + "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", + "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf" ], "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==2.32.4" + "markers": "python_version >= '3.9'", + "version": "==2.32.5" }, "six": { "hashes": [ @@ -164,9 +282,26 @@ "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81" ], "index": "pypi", - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==1.17.0" }, + "typing-extensions": { + "hashes": [ + "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", + "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==4.15.0" + }, + "typing-inspection": { + "hashes": [ + "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51", + "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28" + ], + "markers": "python_version >= '3.9'", + "version": "==0.4.1" + }, "urllib3": { "hashes": [ "sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760", @@ -192,17 +327,17 @@ "sha256:77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34", "sha256:d75e02c268746e1b8144c278978b6e98e85de6ad16f8e4b0844a154557eca991" ], - "markers": "python_version < '3.12'", + "markers": "python_version >= '3.8'", "version": "==1.2.0" }, "certifi": { "hashes": [ - "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057", - "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b" + "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", + "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==2025.6.15" + "version": "==2025.8.3" }, "chardet": { "hashes": [ @@ -215,109 +350,96 @@ }, "charset-normalizer": { "hashes": [ - "sha256:005fa3432484527f9732ebd315da8da8001593e2cf46a3d817669f062c3d9ed4", - "sha256:046595208aae0120559a67693ecc65dd75d46f7bf687f159127046628178dc45", - "sha256:0c29de6a1a95f24b9a1aa7aefd27d2487263f00dfd55a77719b530788f75cff7", - "sha256:0c8c57f84ccfc871a48a47321cfa49ae1df56cd1d965a09abe84066f6853b9c0", - "sha256:0f5d9ed7f254402c9e7d35d2f5972c9bbea9040e99cd2861bd77dc68263277c7", - "sha256:18dd2e350387c87dabe711b86f83c9c78af772c748904d372ade190b5c7c9d4d", - "sha256:1b1bde144d98e446b056ef98e59c256e9294f6b74d7af6846bf5ffdafd687a7d", - "sha256:1c95a1e2902a8b722868587c0e1184ad5c55631de5afc0eb96bc4b0d738092c0", - "sha256:1cad5f45b3146325bb38d6855642f6fd609c3f7cad4dbaf75549bf3b904d3184", - "sha256:21b2899062867b0e1fde9b724f8aecb1af14f2778d69aacd1a5a1853a597a5db", - "sha256:24498ba8ed6c2e0b56d4acbf83f2d989720a93b41d712ebd4f4979660db4417b", - "sha256:25a23ea5c7edc53e0f29bae2c44fcb5a1aa10591aae107f2a2b2583a9c5cbc64", - "sha256:289200a18fa698949d2b39c671c2cc7a24d44096784e76614899a7ccf2574b7b", - "sha256:28a1005facc94196e1fb3e82a3d442a9d9110b8434fc1ded7a24a2983c9888d8", - "sha256:32fc0341d72e0f73f80acb0a2c94216bd704f4f0bce10aedea38f30502b271ff", - "sha256:36b31da18b8890a76ec181c3cf44326bf2c48e36d393ca1b72b3f484113ea344", - "sha256:3c21d4fca343c805a52c0c78edc01e3477f6dd1ad7c47653241cf2a206d4fc58", - "sha256:3fddb7e2c84ac87ac3a947cb4e66d143ca5863ef48e4a5ecb83bd48619e4634e", - "sha256:43e0933a0eff183ee85833f341ec567c0980dae57c464d8a508e1b2ceb336471", - "sha256:4a476b06fbcf359ad25d34a057b7219281286ae2477cc5ff5e3f70a246971148", - "sha256:4e594135de17ab3866138f496755f302b72157d115086d100c3f19370839dd3a", - "sha256:50bf98d5e563b83cc29471fa114366e6806bc06bc7a25fd59641e41445327836", - "sha256:5a9979887252a82fefd3d3ed2a8e3b937a7a809f65dcb1e068b090e165bbe99e", - "sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63", - "sha256:5bf4545e3b962767e5c06fe1738f951f77d27967cb2caa64c28be7c4563e162c", - "sha256:6333b3aa5a12c26b2a4d4e7335a28f1475e0e5e17d69d55141ee3cab736f66d1", - "sha256:65c981bdbd3f57670af8b59777cbfae75364b483fa8a9f420f08094531d54a01", - "sha256:68a328e5f55ec37c57f19ebb1fdc56a248db2e3e9ad769919a58672958e8f366", - "sha256:6a0289e4589e8bdfef02a80478f1dfcb14f0ab696b5a00e1f4b8a14a307a3c58", - "sha256:6b66f92b17849b85cad91259efc341dce9c1af48e2173bf38a85c6329f1033e5", - "sha256:6c9379d65defcab82d07b2a9dfbfc2e95bc8fe0ebb1b176a3190230a3ef0e07c", - "sha256:6fc1f5b51fa4cecaa18f2bd7a003f3dd039dd615cd69a2afd6d3b19aed6775f2", - "sha256:70f7172939fdf8790425ba31915bfbe8335030f05b9913d7ae00a87d4395620a", - "sha256:721c76e84fe669be19c5791da68232ca2e05ba5185575086e384352e2c309597", - "sha256:7222ffd5e4de8e57e03ce2cef95a4c43c98fcb72ad86909abdfc2c17d227fc1b", - "sha256:75d10d37a47afee94919c4fab4c22b9bc2a8bf7d4f46f87363bcf0573f3ff4f5", - "sha256:76af085e67e56c8816c3ccf256ebd136def2ed9654525348cfa744b6802b69eb", - "sha256:770cab594ecf99ae64c236bc9ee3439c3f46be49796e265ce0cc8bc17b10294f", - "sha256:7a6ab32f7210554a96cd9e33abe3ddd86732beeafc7a28e9955cdf22ffadbab0", - "sha256:7c48ed483eb946e6c04ccbe02c6b4d1d48e51944b6db70f697e089c193404941", - "sha256:7f56930ab0abd1c45cd15be65cc741c28b1c9a34876ce8c17a2fa107810c0af0", - "sha256:8075c35cd58273fee266c58c0c9b670947c19df5fb98e7b66710e04ad4e9ff86", - "sha256:8272b73e1c5603666618805fe821edba66892e2870058c94c53147602eab29c7", - "sha256:82d8fd25b7f4675d0c47cf95b594d4e7b158aca33b76aa63d07186e13c0e0ab7", - "sha256:844da2b5728b5ce0e32d863af26f32b5ce61bc4273a9c720a9f3aa9df73b1455", - "sha256:8755483f3c00d6c9a77f490c17e6ab0c8729e39e6390328e42521ef175380ae6", - "sha256:915f3849a011c1f593ab99092f3cecfcb4d65d8feb4a64cf1bf2d22074dc0ec4", - "sha256:926ca93accd5d36ccdabd803392ddc3e03e6d4cd1cf17deff3b989ab8e9dbcf0", - "sha256:982bb1e8b4ffda883b3d0a521e23abcd6fd17418f6d2c4118d257a10199c0ce3", - "sha256:98f862da73774290f251b9df8d11161b6cf25b599a66baf087c1ffe340e9bfd1", - "sha256:9cbfacf36cb0ec2897ce0ebc5d08ca44213af24265bd56eca54bee7923c48fd6", - "sha256:a370b3e078e418187da8c3674eddb9d983ec09445c99a3a263c2011993522981", - "sha256:a955b438e62efdf7e0b7b52a64dc5c3396e2634baa62471768a64bc2adb73d5c", - "sha256:aa6af9e7d59f9c12b33ae4e9450619cf2488e2bbe9b44030905877f0b2324980", - "sha256:aa88ca0b1932e93f2d961bf3addbb2db902198dca337d88c89e1559e066e7645", - "sha256:aaeeb6a479c7667fbe1099af9617c83aaca22182d6cf8c53966491a0f1b7ffb7", - "sha256:aaf27faa992bfee0264dc1f03f4c75e9fcdda66a519db6b957a3f826e285cf12", - "sha256:b2680962a4848b3c4f155dc2ee64505a9c57186d0d56b43123b17ca3de18f0fa", - "sha256:b2d318c11350e10662026ad0eb71bb51c7812fc8590825304ae0bdd4ac283acd", - "sha256:b33de11b92e9f75a2b545d6e9b6f37e398d86c3e9e9653c4864eb7e89c5773ef", - "sha256:b3daeac64d5b371dea99714f08ffc2c208522ec6b06fbc7866a450dd446f5c0f", - "sha256:be1e352acbe3c78727a16a455126d9ff83ea2dfdcbc83148d2982305a04714c2", - "sha256:bee093bf902e1d8fc0ac143c88902c3dfc8941f7ea1d6a8dd2bcb786d33db03d", - "sha256:c72fbbe68c6f32f251bdc08b8611c7b3060612236e960ef848e0a517ddbe76c5", - "sha256:c9e36a97bee9b86ef9a1cf7bb96747eb7a15c2f22bdb5b516434b00f2a599f02", - "sha256:cddf7bd982eaa998934a91f69d182aec997c6c468898efe6679af88283b498d3", - "sha256:cf713fe9a71ef6fd5adf7a79670135081cd4431c2943864757f0fa3a65b1fafd", - "sha256:d11b54acf878eef558599658b0ffca78138c8c3655cf4f3a4a673c437e67732e", - "sha256:d41c4d287cfc69060fa91cae9683eacffad989f1a10811995fa309df656ec214", - "sha256:d524ba3f1581b35c03cb42beebab4a13e6cdad7b36246bd22541fa585a56cccd", - "sha256:daac4765328a919a805fa5e2720f3e94767abd632ae410a9062dff5412bae65a", - "sha256:db4c7bf0e07fc3b7d89ac2a5880a6a8062056801b83ff56d8464b70f65482b6c", - "sha256:dc7039885fa1baf9be153a0626e337aa7ec8bf96b0128605fb0d77788ddc1681", - "sha256:dccab8d5fa1ef9bfba0590ecf4d46df048d18ffe3eec01eeb73a42e0d9e7a8ba", - "sha256:dedb8adb91d11846ee08bec4c8236c8549ac721c245678282dcb06b221aab59f", - "sha256:e45ba65510e2647721e35323d6ef54c7974959f6081b58d4ef5d87c60c84919a", - "sha256:e53efc7c7cee4c1e70661e2e112ca46a575f90ed9ae3fef200f2a25e954f4b28", - "sha256:e635b87f01ebc977342e2697d05b56632f5f879a4f15955dfe8cef2448b51691", - "sha256:e70e990b2137b29dc5564715de1e12701815dacc1d056308e2b17e9095372a82", - "sha256:e8082b26888e2f8b36a042a58307d5b917ef2b1cacab921ad3323ef91901c71a", - "sha256:e8323a9b031aa0393768b87f04b4164a40037fb2a3c11ac06a03ffecd3618027", - "sha256:e92fca20c46e9f5e1bb485887d074918b13543b1c2a1185e69bb8d17ab6236a7", - "sha256:eb30abc20df9ab0814b5a2524f23d75dcf83cde762c161917a2b4b7b55b1e518", - "sha256:eba9904b0f38a143592d9fc0e19e2df0fa2e41c3c3745554761c5f6447eedabf", - "sha256:ef8de666d6179b009dce7bcb2ad4c4a779f113f12caf8dc77f0162c29d20490b", - "sha256:efd387a49825780ff861998cd959767800d54f8308936b21025326de4b5a42b9", - "sha256:f0aa37f3c979cf2546b73e8222bbfa3dc07a641585340179d768068e3455e544", - "sha256:f4074c5a429281bf056ddd4c5d3b740ebca4d43ffffe2ef4bf4d2d05114299da", - "sha256:f69a27e45c43520f5487f27627059b64aaf160415589230992cec34c5e18a509", - "sha256:fb707f3e15060adf5b7ada797624a6c6e0138e2a26baa089df64c68ee98e040f", - "sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a", - "sha256:fdb20a30fe1175ecabed17cbf7812f7b804b8a315a25f24678bcdf120a90077f" + "sha256:00237675befef519d9af72169d8604a067d92755e84fe76492fef5441db05b91", + "sha256:02425242e96bcf29a49711b0ca9f37e451da7c70562bc10e8ed992a5a7a25cc0", + "sha256:027b776c26d38b7f15b26a5da1044f376455fb3766df8fc38563b4efbc515154", + "sha256:07a0eae9e2787b586e129fdcbe1af6997f8d0e5abaa0bc98c0e20e124d67e601", + "sha256:0cacf8f7297b0c4fcb74227692ca46b4a5852f8f4f24b3c766dd94a1075c4884", + "sha256:0e78314bdc32fa80696f72fa16dc61168fda4d6a0c014e0380f9d02f0e5d8a07", + "sha256:0f2be7e0cf7754b9a30eb01f4295cc3d4358a479843b31f328afd210e2c7598c", + "sha256:13faeacfe61784e2559e690fc53fa4c5ae97c6fcedb8eb6fb8d0a15b475d2c64", + "sha256:14c2a87c65b351109f6abfc424cab3927b3bdece6f706e4d12faaf3d52ee5efe", + "sha256:1606f4a55c0fd363d754049cdf400175ee96c992b1f8018b993941f221221c5f", + "sha256:16a8770207946ac75703458e2c743631c79c59c5890c80011d536248f8eaa432", + "sha256:18343b2d246dc6761a249ba1fb13f9ee9a2bcd95decc767319506056ea4ad4dc", + "sha256:18b97b8404387b96cdbd30ad660f6407799126d26a39ca65729162fd810a99aa", + "sha256:1bb60174149316da1c35fa5233681f7c0f9f514509b8e399ab70fea5f17e45c9", + "sha256:1e8ac75d72fa3775e0b7cb7e4629cec13b7514d928d15ef8ea06bca03ef01cae", + "sha256:1ef99f0456d3d46a50945c98de1774da86f8e992ab5c77865ea8b8195341fc19", + "sha256:2001a39612b241dae17b4687898843f254f8748b796a2e16f1051a17078d991d", + "sha256:23b6b24d74478dc833444cbd927c338349d6ae852ba53a0d02a2de1fce45b96e", + "sha256:252098c8c7a873e17dd696ed98bbe91dbacd571da4b87df3736768efa7a792e4", + "sha256:257f26fed7d7ff59921b78244f3cd93ed2af1800ff048c33f624c87475819dd7", + "sha256:2c322db9c8c89009a990ef07c3bcc9f011a3269bc06782f916cd3d9eed7c9312", + "sha256:30a96e1e1f865f78b030d65241c1ee850cdf422d869e9028e2fc1d5e4db73b92", + "sha256:30d006f98569de3459c2fc1f2acde170b7b2bd265dc1943e87e1a4efe1b67c31", + "sha256:31a9a6f775f9bcd865d88ee350f0ffb0e25936a7f930ca98995c05abf1faf21c", + "sha256:320e8e66157cc4e247d9ddca8e21f427efc7a04bbd0ac8a9faf56583fa543f9f", + "sha256:34a7f768e3f985abdb42841e20e17b330ad3aaf4bb7e7aeeb73db2e70f077b99", + "sha256:3653fad4fe3ed447a596ae8638b437f827234f01a8cd801842e43f3d0a6b281b", + "sha256:3cd35b7e8aedeb9e34c41385fda4f73ba609e561faedfae0a9e75e44ac558a15", + "sha256:3cfb2aad70f2c6debfbcb717f23b7eb55febc0bb23dcffc0f076009da10c6392", + "sha256:416175faf02e4b0810f1f38bcb54682878a4af94059a1cd63b8747244420801f", + "sha256:41d1fc408ff5fdfb910200ec0e74abc40387bccb3252f3f27c0676731df2b2c8", + "sha256:42e5088973e56e31e4fa58eb6bd709e42fc03799c11c42929592889a2e54c491", + "sha256:4ca4c094de7771a98d7fbd67d9e5dbf1eb73efa4f744a730437d8a3a5cf994f0", + "sha256:511729f456829ef86ac41ca78c63a5cb55240ed23b4b737faca0eb1abb1c41bc", + "sha256:53cd68b185d98dde4ad8990e56a58dea83a4162161b1ea9272e5c9182ce415e0", + "sha256:585f3b2a80fbd26b048a0be90c5aae8f06605d3c92615911c3a2b03a8a3b796f", + "sha256:5b413b0b1bfd94dbf4023ad6945889f374cd24e3f62de58d6bb102c4d9ae534a", + "sha256:5d8d01eac18c423815ed4f4a2ec3b439d654e55ee4ad610e153cf02faf67ea40", + "sha256:6aab0f181c486f973bc7262a97f5aca3ee7e1437011ef0c2ec04b5a11d16c927", + "sha256:6cf8fd4c04756b6b60146d98cd8a77d0cdae0e1ca20329da2ac85eed779b6849", + "sha256:6fb70de56f1859a3f71261cbe41005f56a7842cc348d3aeb26237560bfa5e0ce", + "sha256:6fce4b8500244f6fcb71465d4a4930d132ba9ab8e71a7859e6a5d59851068d14", + "sha256:70bfc5f2c318afece2f5838ea5e4c3febada0be750fcf4775641052bbba14d05", + "sha256:73dc19b562516fc9bcf6e5d6e596df0b4eb98d87e4f79f3ae71840e6ed21361c", + "sha256:74d77e25adda8581ffc1c720f1c81ca082921329452eba58b16233ab1842141c", + "sha256:78deba4d8f9590fe4dae384aeff04082510a709957e968753ff3c48399f6f92a", + "sha256:86df271bf921c2ee3818f0522e9a5b8092ca2ad8b065ece5d7d9d0e9f4849bcc", + "sha256:88ab34806dea0671532d3f82d82b85e8fc23d7b2dd12fa837978dad9bb392a34", + "sha256:8999f965f922ae054125286faf9f11bc6932184b93011d138925a1773830bbe9", + "sha256:8dcfc373f888e4fb39a7bc57e93e3b845e7f462dacc008d9749568b1c4ece096", + "sha256:939578d9d8fd4299220161fdd76e86c6a251987476f5243e8864a7844476ba14", + "sha256:96b2b3d1a83ad55310de8c7b4a2d04d9277d5591f40761274856635acc5fcb30", + "sha256:a2d08ac246bb48479170408d6c19f6385fa743e7157d716e144cad849b2dd94b", + "sha256:b256ee2e749283ef3ddcff51a675ff43798d92d746d1a6e4631bf8c707d22d0b", + "sha256:b5e3b2d152e74e100a9e9573837aba24aab611d39428ded46f4e4022ea7d1942", + "sha256:b89bc04de1d83006373429975f8ef9e7932534b8cc9ca582e4db7d20d91816db", + "sha256:bd28b817ea8c70215401f657edef3a8aa83c29d447fb0b622c35403780ba11d5", + "sha256:c60e092517a73c632ec38e290eba714e9627abe9d301c8c8a12ec32c314a2a4b", + "sha256:c6dbd0ccdda3a2ba7c2ecd9d77b37f3b5831687d8dc1b6ca5f56a4880cc7b7ce", + "sha256:c6e490913a46fa054e03699c70019ab869e990270597018cef1d8562132c2669", + "sha256:c6f162aabe9a91a309510d74eeb6507fab5fff92337a15acbe77753d88d9dcf0", + "sha256:c6fd51128a41297f5409deab284fecbe5305ebd7e5a1f959bee1c054622b7018", + "sha256:cc34f233c9e71701040d772aa7490318673aa7164a0efe3172b2981218c26d93", + "sha256:cc9370a2da1ac13f0153780040f465839e6cccb4a1e44810124b4e22483c93fe", + "sha256:ccf600859c183d70eb47e05a44cd80a4ce77394d1ac0f79dbd2dd90a69a3a049", + "sha256:ce571ab16d890d23b5c278547ba694193a45011ff86a9162a71307ed9f86759a", + "sha256:cf1ebb7d78e1ad8ec2a8c4732c7be2e736f6e5123a4146c5b89c9d1f585f8cef", + "sha256:d0e909868420b7049dafd3a31d45125b31143eec59235311fc4c57ea26a4acd2", + "sha256:d22dbedd33326a4a5190dd4fe9e9e693ef12160c77382d9e87919bce54f3d4ca", + "sha256:d716a916938e03231e86e43782ca7878fb602a125a91e7acb8b5112e2e96ac16", + "sha256:d79c198e27580c8e958906f803e63cddb77653731be08851c7df0b1a14a8fc0f", + "sha256:d95bfb53c211b57198bb91c46dd5a2d8018b3af446583aab40074bf7988401cb", + "sha256:e28e334d3ff134e88989d90ba04b47d84382a828c061d0d1027b1b12a62b39b1", + "sha256:ec557499516fc90fd374bf2e32349a2887a876fbf162c160e3c01b6849eaf557", + "sha256:fb6fecfd65564f208cbf0fba07f107fb661bcd1a7c389edbced3f7a493f70e37", + "sha256:fb731e5deb0c7ef82d698b0f4c5bb724633ee2a489401594c5c88b02e6cb15f7", + "sha256:fb7f67a1bfa6e40b438170ebdc8158b78dc465a5a67b6dde178a46987b244a72", + "sha256:fd10de089bcdcd1be95a2f73dbe6254798ec1bda9f450d5828c96f93e2536b9c", + "sha256:fdabf8315679312cfa71302f9bd509ded4f2f263fb5b765cf1433b39106c3cc9" ], "markers": "python_version >= '3.7'", - "version": "==3.4.2" + "version": "==3.4.3" }, "docutils": { "hashes": [ - "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f", - "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2" + "sha256:9fdb771707c8784c8f2728b67cb2c691305933d68137ef95a75db5f4dfbc213d", + "sha256:b0e98d679283fc3bb0ead8a5da7f501baa632654e7056e9c5846842213d674d8" ], "markers": "python_version >= '3.9'", - "version": "==0.21.2" + "version": "==0.22.2" }, "id": { "hashes": [ @@ -341,7 +463,7 @@ "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd" ], - "markers": "python_version < '3.10'", + "markers": "python_version >= '3.9'", "version": "==8.7.0" }, "jaraco.classes": { @@ -362,18 +484,18 @@ }, "jaraco.functools": { "hashes": [ - "sha256:590486285803805f4b1f99c60ca9e94ed348d4added84b74c7a12885561e524e", - "sha256:be634abfccabce56fa3053f8c7ebe37b682683a4ee7793670ced17bab0087353" + "sha256:227ff8ed6f7b8f62c56deff101545fa7543cf2c8e7b82a7c2116e672f29c26e8", + "sha256:cfd13ad0dd2c47a3600b439ef72d8615d482cedcff1632930d6f28924d92f294" ], "markers": "python_version >= '3.9'", - "version": "==4.2.1" + "version": "==4.3.0" }, "keyring": { "hashes": [ "sha256:0b39998aa941431eb3d9b0d4b2460bc773b9df6fed7621c2dfb291a7e0187a66", "sha256:552a3f7af126ece7ed5c89753650eec89c7eaae8617d0aa4d9ad2b75111266bd" ], - "markers": "platform_machine != 'ppc64le' and platform_machine != 's390x'", + "markers": "python_version >= '3.9'", "version": "==25.6.0" }, "markdown-it-py": { @@ -394,41 +516,96 @@ }, "more-itertools": { "hashes": [ - "sha256:9fddd5403be01a94b204faadcff459ec3568cf110265d3c54323e1e866ad29d3", - "sha256:d43980384673cb07d2f7d2d918c616b30c659c089ee23953f601d6609c67510e" + "sha256:52d4362373dcf7c52546bc4af9a86ee7c4579df9a8dc268be0a2f949d376cc9b", + "sha256:f638ddf8a1a0d134181275fb5d58b086ead7c6a72429ad725c67503f13ba30bd" + ], + "markers": "python_version >= '3.9'", + "version": "==10.8.0" + }, + "mypy": { + "hashes": [ + "sha256:01199871b6110a2ce984bde85acd481232d17413868c9807e95c1b0739a58914", + "sha256:030c52d0ea8144e721e49b1f68391e39553d7451f0c3f8a7565b59e19fcb608b", + "sha256:06a398102a5f203d7477b2923dda3634c36727fa5c237d8f859ef90c42a9924b", + "sha256:07b8b0f580ca6d289e69209ec9d3911b4a26e5abfde32228a288eb79df129fcc", + "sha256:0e2785a84b34a72ba55fb5daf079a1003a34c05b22238da94fcae2bbe46f3544", + "sha256:1331eb7fd110d60c24999893320967594ff84c38ac6d19e0a76c5fd809a84c86", + "sha256:1379451880512ffce14505493bd9fe469e0697543717298242574882cf8cdb8d", + "sha256:20c02215a080e3a2be3aa50506c67242df1c151eaba0dcbc1e4e557922a26075", + "sha256:22a1748707dd62b58d2ae53562ffc4d7f8bcc727e8ac7cbc69c053ddc874d47e", + "sha256:22f27105f1525ec024b5c630c0b9f36d5c1cc4d447d61fe51ff4bd60633f47ac", + "sha256:25a9c8fb67b00599f839cf472713f54249a62efd53a54b565eb61956a7e3296b", + "sha256:33eca32dd124b29400c31d7cf784e795b050ace0e1f91b8dc035672725617e34", + "sha256:3ca30b50a51e7ba93b00422e486cbb124f1c56a535e20eff7b2d6ab72b3b2e37", + "sha256:448acd386266989ef11662ce3c8011fd2a7b632e0ec7d61a98edd8e27472225b", + "sha256:592ec214750bc00741af1f80cbf96b5013d81486b7bb24cb052382c19e40b428", + "sha256:5d6c838e831a062f5f29d11c9057c6009f60cb294fea33a98422688181fe2893", + "sha256:62f0e1e988ad41c2a110edde6c398383a889d95b36b3e60bcf155f5164c4fdce", + "sha256:664dc726e67fa54e14536f6e1224bcfce1d9e5ac02426d2326e2bb4e081d1ce8", + "sha256:6ca1e64b24a700ab5ce10133f7ccd956a04715463d30498e64ea8715236f9c9c", + "sha256:749b5f83198f1ca64345603118a6f01a4e99ad4bf9d103ddc5a3200cc4614adf", + "sha256:776bb00de1778caf4db739c6e83919c1d85a448f71979b6a0edd774ea8399341", + "sha256:7a780ca61fc239e4865968ebc5240bb3bf610ef59ac398de9a7421b54e4a207e", + "sha256:7ab28cc197f1dd77a67e1c6f35cd1f8e8b73ed2217e4fc005f9e6a504e46e7ba", + "sha256:7fb95f97199ea11769ebe3638c29b550b5221e997c63b14ef93d2e971606ebed", + "sha256:807d9315ab9d464125aa9fcf6d84fde6e1dc67da0b6f80e7405506b8ac72bc7f", + "sha256:8795a039bab805ff0c1dfdb8cd3344642c2b99b8e439d057aba30850b8d3423d", + "sha256:a2afc0fa0b0e91b4599ddfe0f91e2c26c2b5a5ab263737e998d6817874c5f7c8", + "sha256:a3c47adf30d65e89b2dcd2fa32f3aeb5e94ca970d2c15fcb25e297871c8e4764", + "sha256:a431a6f1ef14cf8c144c6b14793a23ec4eae3db28277c358136e79d7d062f62d", + "sha256:aa5e07ac1a60a253445797e42b8b2963c9675563a94f11291ab40718b016a7a0", + "sha256:c1eab0cf6294dafe397c261a75f96dc2c31bffe3b944faa24db5def4e2b0f77c", + "sha256:c2b9c7e284ee20e7598d6f42e13ca40b4928e6957ed6813d1ab6348aa3f47133", + "sha256:c3ad2afadd1e9fea5cf99a45a822346971ede8685cc581ed9cd4d42eaf940986", + "sha256:d6985ed057513e344e43a26cc1cd815c7a94602fb6a3130a34798625bc2f07b6", + "sha256:d8068d0afe682c7c4897c0f7ce84ea77f6de953262b12d07038f4d296d547074", + "sha256:d924eef3795cc89fecf6bedc6ed32b33ac13e8321344f6ddbf8ee89f706c05cb", + "sha256:ed4482847168439651d3feee5833ccedbf6657e964572706a2adb1f7fa4dfe2e", + "sha256:f9e171c465ad3901dc652643ee4bffa8e9fef4d7d0eece23b428908c77a76a66" ], + "index": "pypi", "markers": "python_version >= '3.9'", - "version": "==10.7.0" + "version": "==1.18.2" + }, + "mypy-extensions": { + "hashes": [ + "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", + "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558" + ], + "markers": "python_version >= '3.8'", + "version": "==1.1.0" }, "nh3": { "hashes": [ - "sha256:087ffadfdcd497658c3adc797258ce0f06be8a537786a7217649fc1c0c60c293", - "sha256:20979783526641c81d2f5bfa6ca5ccca3d1e4472474b162c6256745fbfe31cd1", - "sha256:2a5174551f95f2836f2ad6a8074560f261cf9740a48437d6151fd2d4d7d617ab", - "sha256:31eedcd7d08b0eae28ba47f43fd33a653b4cdb271d64f1aeda47001618348fde", - "sha256:4990e7ee6a55490dbf00d61a6f476c9a3258e31e711e13713b2ea7d6616f670e", - "sha256:55823c5ea1f6b267a4fad5de39bc0524d49a47783e1fe094bcf9c537a37df251", - "sha256:6141caabe00bbddc869665b35fc56a478eb774a8c1dfd6fba9fe1dfdf29e6efa", - "sha256:637d4a10c834e1b7d9548592c7aad760611415fcd5bd346f77fd8a064309ae6d", - "sha256:63ca02ac6f27fc80f9894409eb61de2cb20ef0a23740c7e29f9ec827139fa578", - "sha256:6ae319f17cd8960d0612f0f0ddff5a90700fa71926ca800e9028e7851ce44a6f", - "sha256:6c9c30b8b0d291a7c5ab0967ab200598ba33208f754f2f4920e9343bdd88f79a", - "sha256:713d16686596e556b65e7f8c58328c2df63f1a7abe1277d87625dcbbc012ef82", - "sha256:818f2b6df3763e058efa9e69677b5a92f9bc0acff3295af5ed013da544250d5b", - "sha256:9d67709bc0d7d1f5797b21db26e7a8b3d15d21c9c5f58ccfe48b5328483b685b", - "sha256:a5f77e62aed5c4acad635239ac1290404c7e940c81abe561fd2af011ff59f585", - "sha256:a772dec5b7b7325780922dd904709f0f5f3a79fbf756de5291c01370f6df0967", - "sha256:a7ea28cd49293749d67e4fcf326c554c83ec912cd09cd94aa7ec3ab1921c8283", - "sha256:ac7006c3abd097790e611fe4646ecb19a8d7f2184b882f6093293b8d9b887431", - "sha256:b3b5c58161e08549904ac4abd450dacd94ff648916f7c376ae4b2c0652b98ff9", - "sha256:b8d55ea1fc7ae3633d758a92aafa3505cd3cc5a6e40470c9164d54dff6f96d42", - "sha256:bb0014948f04d7976aabae43fcd4cb7f551f9f8ce785a4c9ef66e6c2590f8629", - "sha256:d002b648592bf3033adfd875a48f09b8ecc000abd7f6a8769ed86b6ccc70c759", - "sha256:d426d7be1a2f3d896950fe263332ed1662f6c78525b4520c8e9861f8d7f0d243", - "sha256:fcff321bd60c6c5c9cb4ddf2554e22772bb41ebd93ad88171bbbb6f271255286" + "sha256:0649464ac8eee018644aacbc103874ccbfac80e3035643c3acaab4287e36e7f5", + "sha256:16f8670201f7e8e0e05ed1a590eb84bfa51b01a69dd5caf1d3ea57733de6a52f", + "sha256:1adeb1062a1c2974bc75b8d1ecb014c5fd4daf2df646bbe2831f7c23659793f9", + "sha256:37d3003d98dedca6cd762bf88f2e70b67f05100f6b949ffe540e189cc06887f9", + "sha256:389d93d59b8214d51c400fb5b07866c2a4f79e4e14b071ad66c92184fec3a392", + "sha256:3f1b4f8a264a0c86ea01da0d0c390fe295ea0bcacc52c2103aca286f6884f518", + "sha256:423201bbdf3164a9e09aa01e540adbb94c9962cc177d5b1cbb385f5e1e79216e", + "sha256:634e34e6162e0408e14fb61d5e69dbaea32f59e847cfcfa41b66100a6b796f62", + "sha256:6d68fa277b4a3cf04e5c4b84dd0c6149ff7d56c12b3e3fab304c525b850f613d", + "sha256:7275fdffaab10cc5801bf026e3c089d8de40a997afc9e41b981f7ac48c5aa7d5", + "sha256:7852f038a054e0096dac12b8141191e02e93e0b4608c4b993ec7d4ffafea4e49", + "sha256:7c915060a2c8131bef6a29f78debc29ba40859b6dbe2362ef9e5fd44f11487c2", + "sha256:80fe20171c6da69c7978ecba33b638e951b85fb92059259edd285ff108b82a6d", + "sha256:a537ece1bf513e5a88d8cff8a872e12fe8d0f42ef71dd15a5e7520fecd191bbb", + "sha256:af5aa8127f62bbf03d68f67a956627b1bd0469703a35b3dad28d0c1195e6c7fb", + "sha256:b0612ccf5de8a480cf08f047b08f9d3fecc12e63d2ee91769cb19d7290614c23", + "sha256:ba0caa8aa184196daa6e574d997a33867d6d10234018012d35f86d46024a2a95", + "sha256:bae63772408fd63ad836ec569a7c8f444dd32863d0c67f6e0b25ebbd606afa95", + "sha256:c7a32a7f0d89f7d30cb8f4a84bdbd56d1eb88b78a2434534f62c71dac538c450", + "sha256:ce5e7185599f89b0e391e2f29cc12dc2e206167380cea49b33beda4891be2fe1", + "sha256:d8ba24cb31525492ea71b6aac11a4adac91d828aadeff7c4586541bf5dc34d2f", + "sha256:d97d3efd61404af7e5721a0e74d81cdbfc6e5f97e11e731bb6d090e30a7b62b2", + "sha256:e90883f9f85288f423c77b3f5a6f4486375636f25f793165112679a7b6363b35", + "sha256:e9e6a7e4d38f7e8dda9edd1433af5170c597336c1a74b4693c5cb75ab2b30f2a", + "sha256:ec6cfdd2e0399cb79ba4dcffb2332b94d9696c52272ff9d48a630c5dca5e325a", + "sha256:f416c35efee3e6a6c9ab7716d9e57aa0a49981be915963a82697952cba1353e1" ], "markers": "python_version >= '3.8'", - "version": "==0.2.21" + "version": "==0.3.0" }, "packaging": { "hashes": [ @@ -439,6 +616,14 @@ "markers": "python_version >= '3.8'", "version": "==25.0" }, + "pathspec": { + "hashes": [ + "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", + "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712" + ], + "markers": "python_version >= '3.8'", + "version": "==0.12.1" + }, "pygments": { "hashes": [ "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", @@ -457,12 +642,12 @@ }, "requests": { "hashes": [ - "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c", - "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422" + "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", + "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf" ], "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==2.32.4" + "markers": "python_version >= '3.9'", + "version": "==2.32.5" }, "requests-toolbelt": { "hashes": [ @@ -482,38 +667,85 @@ }, "rich": { "hashes": [ - "sha256:1c9491e1951aac09caffd42f448ee3d04e58923ffe14993f6e83068dc395d7e0", - "sha256:82f1bc23a6a21ebca4ae0c45af9bdbc492ed20231dcb63f297d6d1021a9d5725" + "sha256:536f5f1785986d6dbdea3c75205c473f970777b4a0d6c6dd1b696aa05a3fa04f", + "sha256:e497a48b844b0320d45007cdebfeaeed8db2a4f4bcf49f15e455cfc4af11eaa8" ], "markers": "python_full_version >= '3.8.0'", - "version": "==14.0.0" + "version": "==14.1.0" }, "setuptools": { "hashes": [ - "sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922", - "sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c" + "sha256:c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561", + "sha256:fcc17fd9cd898242f6b4adfaca46137a9edef687f43e6f78469692a5e70d851d" ], "index": "pypi", "markers": "python_version >= '3.9'", - "version": "==80.9.0" + "version": "==78.1.1" + }, + "tomli": { + "hashes": [ + "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6", + "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd", + "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c", + "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b", + "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8", + "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6", + "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77", + "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff", + "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea", + "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192", + "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249", + "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee", + "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4", + "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98", + "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8", + "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4", + "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281", + "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744", + "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69", + "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13", + "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140", + "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e", + "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e", + "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", + "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff", + "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec", + "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2", + "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222", + "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106", + "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272", + "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a", + "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7" + ], + "markers": "python_version >= '3.8'", + "version": "==2.2.1" }, "twine": { "hashes": [ - "sha256:a47f973caf122930bf0fbbf17f80b83bc1602c9ce393c7845f289a3001dc5384", - "sha256:be324f6272eff91d07ee93f251edf232fc647935dd585ac003539b42404a8dbd" + "sha256:418ebf08ccda9a8caaebe414433b0ba5e25eb5e4a927667122fbe8f829f985d8", + "sha256:e5ed0d2fd70c9959770dce51c8f39c8945c574e18173a7b81802dab51b4b75cf" ], "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==6.1.0" + "markers": "python_version >= '3.9'", + "version": "==6.2.0" + }, + "types-python-dateutil": { + "hashes": [ + "sha256:849d52b737e10a6dc6621d2bd7940ec7c65fcb69e6aa2882acf4e56b2b508ddc", + "sha256:84c92c34bd8e68b117bff742bc00b692a1e8531262d4507b33afcc9f7716cd53" + ], + "index": "pypi", + "markers": "python_version >= '3.9'", + "version": "==2.9.0.20250822" }, "typing-extensions": { "hashes": [ - "sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4", - "sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af" + "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", + "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548" ], "index": "pypi", "markers": "python_version >= '3.9'", - "version": "==4.14.0" + "version": "==4.15.0" }, "urllib3": { "hashes": [ diff --git a/README.md b/README.md index 6b67aba..7c454ca 100755 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ with FaceSdk(host="http://0.0.0.0:41101") as sdk: MatchImage(index=2, data=face_1_bytes, type=ImageSource.DOCUMENT_RFID), MatchImage(index=3, data=face_2_bytes) ] - match_request = MatchRequest(images=images, thumbnails=True) + match_request = MatchRequest(images=images) match_response = sdk.match_api.match(match_request) detect_request = DetectRequest(image=face_1_bytes) diff --git a/dev.md b/dev.md index 2974956..125d4f3 100755 --- a/dev.md +++ b/dev.md @@ -1,13 +1,39 @@ # Development -Client is written using python, mainly generated from [OpenAPI spec](https://github.com/regulaforensics/FaceSDK-web-openapi). -Openapi-generator output used as implementation base(see packages `regula/facesdk/webclient/gen`). -All custom logic, on top of generated files, should be places in `regula/facesdk/webclient/ext` folder. +Models generation based on [openapi spec](https://github.com/regulaforensics/FaceSDK-api-openapi). + +## Generation To regenerate models from openapi definition, -clone [latest open api definitions](https://github.com/regulaforensics/FaceSDK-web-openapi) -to a client's parent folder ./../. -Than,use next command from the project root: +clone [latest open api definitions](https://github.com/regulaforensics/FaceSDK-api-openapi) +and use next command from the project root. ```bash ./update-models.sh ``` + +## Generator configuration Features + +1. Two client generation modes have been added: +strict (for client testing) and lenient (for release). +In strict mode, the client will throw an exception if the +types do not match or the required fields are missing; +in lenient mode, error data will be output as a warning to +the console. The templates for generating these modes +are located in the generator-templates folder. +2. When generating oneOf schemas, the generator creates its +own abstract class, which does not look like it would like. +The problem was solved by replacing the abstract generator +class with ours using typeMappings in the generator config. +3. By default, when the discriminator was unknown, the client +threw an error. To avoid this, such models will be skipped. +To solve this problem, changes have been made +to the model_generic.mustache template. + +## Problem solving + +To solve new problems, use the generator +settings ([python](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/python.md), +[common](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md)) +and [templates](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/python). + +**Do not edit the generated files! They will be overwritten after generation!** \ No newline at end of file diff --git a/example/example.py b/example/example.py index a7a8392..e3f556e 100755 --- a/example/example.py +++ b/example/example.py @@ -2,9 +2,9 @@ from regula.facesdk.webclient import MatchImage, MatchRequest from regula.facesdk.webclient.ext import FaceSdk, DetectRequest -from regula.facesdk.webclient.gen.model.face_quality_scenarios import FaceQualityScenarios -from regula.facesdk.webclient.gen.model.image_source import ImageSource -from regula.facesdk.webclient.gen.model.process_param import ProcessParam +from regula.facesdk.webclient.gen.models.face_quality_scenarios import FaceQualityScenarios +from regula.facesdk.webclient.gen.models.image_source import ImageSource +from regula.facesdk.webclient.gen.models.process_param import ProcessParam api_base_path = os.getenv("API_BASE_PATH", "https://faceapi.regulaforensics.com") @@ -48,7 +48,7 @@ image=face_1_bytes, process_param=ProcessParam( scenario=FaceQualityScenarios.QUALITY_ICAO, - only_central_face=True + onlyCentralFace=True ) ) detect_image_quality_response = sdk.match_api.detect(detect_image_quality_request) diff --git a/generator-config.json b/generator-config.json index 55f2cb8..6f76ff1 100755 --- a/generator-config.json +++ b/generator-config.json @@ -1,4 +1,7 @@ { "packageName": "regula.facesdk.webclient.gen", - "extPackageName": "regula.facesdk.webclient.ext" + "extPackageName": "regula.facesdk.webclient.ext", + "typeMappings" : { + "DetectionAttributesDetailsInner": "DetailItem" + } } \ No newline at end of file diff --git a/generator-templates/api.mustache b/generator-templates/api.mustache deleted file mode 100644 index 518d919..0000000 --- a/generator-templates/api.mustache +++ /dev/null @@ -1,277 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from {{packageName}}.api_client import ApiClient -from {{packageName}}.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -{{#operations}} -class {{classname}}(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client -{{#operation}} - - def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 - """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{notes}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - -{{#sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} -{{^sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} - >>> result = thread.get() - -{{#allParams}} - :param {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} - :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}} -{{/allParams}} - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} - """ - kwargs['_return_http_data_only'] = True - return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501 - - def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 - """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{notes}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - -{{#sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} -{{^sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} - >>> result = thread.get() - -{{#allParams}} - :param {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} - :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}} -{{/allParams}} - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: {{#returnType}}tuple({{returnType}}, status_code(int), headers(HTTPHeaderDict)){{/returnType}}{{^returnType}}None{{/returnType}} - """ - - {{#servers.0}} - local_var_hosts = [ -{{#servers}} - '{{{url}}}'{{^-last}},{{/-last}} -{{/servers}} - ] - local_var_host = local_var_hosts[0] - if kwargs.get('_host_index'): - _host_index = int(kwargs.get('_host_index')) - if _host_index < 0 or _host_index >= len(local_var_hosts): - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" - % len(local_var_host) - ) - local_var_host = local_var_hosts[_host_index] - {{/servers.0}} - local_var_params = locals() - - all_params = [ -{{#allParams}} - '{{paramName}}', -{{/allParams}} - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params{{#servers.0}} and key != "_host_index"{{/servers.0}}: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method {{operationId}}" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] -{{#allParams}} -{{^isNullable}} -{{#required}} - # verify the required parameter '{{paramName}}' is set - if self.api_client.client_side_validation and ('{{paramName}}' not in local_var_params or # noqa: E501 - local_var_params['{{paramName}}'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 -{{/required}} -{{/isNullable}} -{{/allParams}} - -{{#allParams}} -{{#hasValidation}} - {{#maxLength}} - if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 - len(local_var_params['{{paramName}}']) > {{maxLength}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 - {{/maxLength}} - {{#minLength}} - if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 - len(local_var_params['{{paramName}}']) < {{minLength}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 - {{/minLength}} - {{#maximum}} - if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 - {{/maximum}} - {{#minimum}} - if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 - {{/minimum}} - {{#pattern}} - if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and not re.search(r'{{{vendorExtensions.x-regex}}}', local_var_params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501 - {{/pattern}} - {{#maxItems}} - if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 - len(local_var_params['{{paramName}}']) > {{maxItems}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 - {{/maxItems}} - {{#minItems}} - if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 - len(local_var_params['{{paramName}}']) < {{minItems}}): # noqa: E501 - raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 - {{/minItems}} -{{/hasValidation}} -{{#-last}} -{{/-last}} -{{/allParams}} - collection_formats = {} - - path_params = {} -{{#pathParams}} - if '{{paramName}}' in local_var_params: - path_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 -{{/pathParams}} - - query_params = [] -{{#queryParams}} - if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] is not None: # noqa: E501 - query_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 -{{/queryParams}} - - header_params = {} -{{#headerParams}} - if '{{paramName}}' in local_var_params: - header_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 -{{/headerParams}} - - form_params = [] - local_var_files = {} -{{#formParams}} - if '{{paramName}}' in local_var_params: - {{^isFile}}form_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{/isFile}}{{#isFile}}local_var_files['{{baseName}}'] = local_var_params['{{paramName}}']{{/isFile}}{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 -{{/formParams}} - - body_params = None -{{#bodyParam}} - if '{{paramName}}' in local_var_params: - body_params = local_var_params['{{paramName}}'] -{{/bodyParam}} - {{#hasProduces}} - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) # noqa: E501 - - {{/hasProduces}} - {{#hasConsumes}} - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) # noqa: E501 - - {{/hasConsumes}} - # Authentication setting - auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] # noqa: E501 - - return self.api_client.call_api( - '{{{path}}}', '{{httpMethod}}', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - {{#servers.0}} - _host=local_var_host, - {{/servers.0}} - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) -{{/operation}} -{{/operations}} diff --git a/generator-templates/api_client.mustache b/generator-templates/api_client.mustache deleted file mode 100644 index 128faf0..0000000 --- a/generator-templates/api_client.mustache +++ /dev/null @@ -1,719 +0,0 @@ -# coding: utf-8 -{{>partial_header}} -from __future__ import absolute_import - -import atexit -import datetime -from dateutil.parser import parse -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os -import re -import tempfile - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote -{{#tornado}} -import tornado.gen -{{/tornado}} - -from {{packageName}}.configuration import Configuration -import {{modelPackage}} -from {{packageName}} import rest -from {{packageName}}.exceptions import ApiValueError, ApiException - - -class ModelSerDe: - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize_raw(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('['): - sub_kls = re.match(r'\[(.*)\]', klass).group(1) - return [self.deserialize_raw(sub_data, sub_kls) - for sub_data in data] - - if klass == '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}': - return data - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr({{modelPackage}}s, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - else: - return self.__deserialize_model(data, klass) - - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - has_discriminator = False - if (hasattr(klass, 'get_real_child_model') - and klass.discriminator_value_class_map): - has_discriminator = True - - if not klass.openapi_types and has_discriminator is False: - return data - - kwargs = {} - if (data is not None and - klass.openapi_types is not None and - isinstance(data, (list, dict))): - for attr, attr_type in six.iteritems(klass.openapi_types): - if klass.attribute_map[attr] in data: - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.deserialize_raw(value, attr_type) - - instance = klass(**kwargs) - - if has_discriminator: - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.deserialize_raw(data, klass_name) - return instance - - - -class ApiClient(ModelSerDe, object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' - self.client_side_validation = configuration.client_side_validation - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.deserialize_raw(data, response_type) - - {{#asyncio}} - async def __aenter__(self): - return self - - async def __aexit__(self, exc_type, exc_value, traceback): - await self.close() - {{/asyncio}} - {{^asyncio}} - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - {{/asyncio}} - - {{#asyncio}}async {{/asyncio}}def close(self): - {{#asyncio}} - await self.rest_client.close() - {{/asyncio}} - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - {{#tornado}} - @tornado.gen.coroutine - {{/tornado}} - {{#asyncio}}async {{/asyncio}}def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, query_params, auth_settings, - request_auth=_request_auth) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body - raise e - - content_type = response_data.getheader('content-type') - - self.last_response = response_data - - return_data = response_data - - if not _preload_content: - {{^tornado}} - return return_data - {{/tornado}} - {{#tornado}} - raise tornado.gen.Return(return_data) - {{/tornado}} - - if six.PY3 and response_type not in ["file", "bytes"]: - match = None - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - -{{^tornado}} - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) -{{/tornado}} -{{#tornado}} - if _return_http_data_only: - raise tornado.gen.Return(return_data) - else: - raise tornado.gen.Return((return_data, response_data.status, - response_data.getheaders())) -{{/tornado}} - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, querys, auth_settings, - request_auth=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params(headers, querys, request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, querys, auth_setting) - - def _apply_auth_params(self, headers, querys, auth_setting): - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path diff --git a/generator-templates/lenient/model_generic.mustache b/generator-templates/lenient/model_generic.mustache new file mode 100644 index 0000000..e38367d --- /dev/null +++ b/generator-templates/lenient/model_generic.mustache @@ -0,0 +1,404 @@ +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +{{#vendorExtensions.x-py-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-model-imports}} +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +{{#hasChildren}} +{{#discriminator}} +{{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }} +from typing import TYPE_CHECKING +if TYPE_CHECKING: +{{#mappedModels}} + from {{packageName}}.models.{{model.classFilename}} import {{modelName}} +{{/mappedModels}} + +{{/discriminator}} +{{/hasChildren}} +class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): + """ + {{#description}}{{{description}}}{{/description}}{{^description}}{{{classname}}}{{/description}} + """ # noqa: E501 +{{#vars}} + {{name}}: SkipValidation[{{^required}}Optional[{{/required}}{{dataType}}{{^required}}]{{/required}}] = Field(alias="{{baseName}}"{{^required}}, default=None{{/required}}{{#description}}, description="{{description}}"{{/description}}) +{{/vars}} +{{#isAdditionalPropertiesTrue}} + additional_properties: Dict[str, Any] = {} +{{/isAdditionalPropertiesTrue}} + __properties: ClassVar[List[str]] = [{{#allVars}}"{{baseName}}"{{^-last}}, {{/-last}}{{/allVars}}] +{{#vars}} + {{#vendorExtensions.x-regex}} + + @field_validator('{{{name}}}') + def {{{name}}}_validate_regular_expression(cls, value): + """Validates the regular expression""" + {{^required}} + if value is None: + return value + + {{/required}} + {{#required}} + {{#isNullable}} + if value is None: + return value + + {{/isNullable}} + {{/required}} + if not re.match(r"{{{.}}}", value{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}): + raise ValueError(r"must validate the regular expression {{{vendorExtensions.x-pattern}}}") + return value + {{/vendorExtensions.x-regex}} + {{#isEnum}} + + @field_validator('{{{name}}}') + def {{{name}}}_validate_enum(cls, value): + """Validates the enum""" + {{^required}} + if value is None: + return value + + {{/required}} + {{#required}} + {{#isNullable}} + if value is None: + return value + + {{/isNullable}} + {{/required}} + {{#isContainer}} + {{#isArray}} + for i in value: + if i not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("each list item must be one of ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isArray}} + {{#isMap}} + for i in value.values(): + if i not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("dict values must be one of enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + if value not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("must be one of enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isContainer}} + return value + {{/isEnum}} +{{/vars}} + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + +{{#hasChildren}} +{{#discriminator}} + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = '{{discriminator.propertyBaseName}}' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + {{#mappedModels}}'{{{mappingName}}}': '{{{modelName}}}'{{^-last}},{{/-last}}{{/mappedModels}} + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + +{{/discriminator}} +{{/hasChildren}} + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[{{^hasChildren}}Self{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}{{/hasChildren}}]: + """Create an instance of {{{classname}}} from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + {{#vendorExtensions.x-py-readonly}} + * OpenAPI `readOnly` fields are excluded. + {{/vendorExtensions.x-py-readonly}} + {{#isAdditionalPropertiesTrue}} + * Fields in `self.additional_properties` are added to the output dict. + {{/isAdditionalPropertiesTrue}} + """ + excluded_fields: Set[str] = set([ + {{#vendorExtensions.x-py-readonly}} + "{{{.}}}", + {{/vendorExtensions.x-py-readonly}} + {{#isAdditionalPropertiesTrue}} + "additional_properties", + {{/isAdditionalPropertiesTrue}} + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + {{#allVars}} + {{#isContainer}} + {{#isArray}} + {{#items.isArray}} + {{^items.items.isPrimitiveType}} + # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list of list) + _items = [] + if self.{{{name}}}: + for _item_{{{name}}} in self.{{{name}}}: + if _item_{{{name}}}: + _items.append( + [_inner_item.to_dict() for _inner_item in _item_{{{name}}} if _inner_item is not None] + ) + _dict['{{{baseName}}}'] = _items + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list) + _items = [] + if self.{{{name}}}: + for _item_{{{name}}} in self.{{{name}}}: + if _item_{{{name}}}: + _items.append(_item_{{{name}}}.to_dict()) + _dict['{{{baseName}}}'] = _items + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isArray}} + {{#isMap}} + {{#items.isArray}} + {{^items.items.isPrimitiveType}} + # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict of array) + _field_dict_of_array = {} + if self.{{{name}}}: + for _key_{{{name}}} in self.{{{name}}}: + if self.{{{name}}}[_key_{{{name}}}] is not None: + _field_dict_of_array[_key_{{{name}}}] = [ + _item.to_dict() for _item in self.{{{name}}}[_key_{{{name}}}] + ] + _dict['{{{baseName}}}'] = _field_dict_of_array + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict) + _field_dict = {} + if self.{{{name}}}: + for _key_{{{name}}} in self.{{{name}}}: + if self.{{{name}}}[_key_{{{name}}}]: + _field_dict[_key_{{{name}}}] = self.{{{name}}}[_key_{{{name}}}].to_dict() + _dict['{{{baseName}}}'] = _field_dict + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of {{{name}}} + if self.{{{name}}}: + _dict['{{{baseName}}}'] = self.{{{name}}}.to_dict() + {{/isEnumOrRef}} + {{/isPrimitiveType}} + {{/isContainer}} + {{/allVars}} + {{#isAdditionalPropertiesTrue}} + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + {{/isAdditionalPropertiesTrue}} + {{#allVars}} + {{#isNullable}} + # set to None if {{{name}}} (nullable) is None + # and model_fields_set contains the field + if self.{{name}} is None and "{{{name}}}" in self.model_fields_set: + _dict['{{{baseName}}}'] = None + + {{/isNullable}} + {{/allVars}} + return _dict + + {{#hasChildren}} + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}]: + """Create an instance of {{{classname}}} from a dict""" + {{#discriminator}} + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + {{#mappedModels}} + if object_type == '{{{modelName}}}': + return import_module("{{packageName}}.models.{{model.classFilename}}").{{modelName}}.from_dict(obj) + {{/mappedModels}} + + return None + {{/discriminator}} + {{/hasChildren}} + {{^hasChildren}} + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of {{{classname}}} from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + {{#disallowAdditionalPropertiesIfNotPresent}} + {{^isAdditionalPropertiesTrue}} + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in {{classname}}) in the input: " + _key) + + {{/isAdditionalPropertiesTrue}} + {{/disallowAdditionalPropertiesIfNotPresent}} + _obj = cls.model_validate({ + {{#allVars}} + {{#isContainer}} + {{#isArray}} + {{#items.isArray}} + {{#items.items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.items.isPrimitiveType}} + {{^items.items.isPrimitiveType}} + "{{{baseName}}}": [ + [{{{items.items.dataType}}}.from_dict(_inner_item) for _inner_item in _item] + for _item in obj["{{{baseName}}}"] + ] if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{#items.isEnumOrRef}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{^items.isEnumOrRef}} + "{{{baseName}}}": [{{{items.dataType}}}.from_dict(_item) for _item in obj.get("{{{baseName}}}", []) if {{{items.dataType}}}.from_dict(_item) is not None]{{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{#items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isArray}} + {{#isMap}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + {{#items.isContainer}} + {{#items.isMap}} + "{{{baseName}}}": dict( + (_k, dict( + (_ik, {{{items.items.dataType}}}.from_dict(_iv)) + for _ik, _iv in _v.items() + ) + if _v is not None + else None + ) + for _k, _v in obj.get("{{{baseName}}}").items() + ) + if obj.get("{{{baseName}}}") is not None + else None{{^-last}},{{/-last}} + {{/items.isMap}} + {{#items.isArray}} + "{{{baseName}}}": dict( + (_k, + [{{{items.items.dataType}}}.from_dict(_item) for _item in _v] + if _v is not None + else None + ) + for _k, _v in obj.get("{{{baseName}}}", {}).items() + ){{^-last}},{{/-last}} + {{/items.isArray}} + {{/items.isContainer}} + {{^items.isContainer}} + "{{{baseName}}}": dict( + (_k, {{{items.dataType}}}.from_dict(_v)) + for _k, _v in obj["{{{baseName}}}"].items() + ) + if obj.get("{{{baseName}}}") is not None + else None{{^-last}},{{/-last}} + {{/items.isContainer}} + {{/items.isEnumOrRef}} + {{#items.isEnumOrRef}} + "{{{baseName}}}": dict((_k, _v) for _k, _v in obj.get("{{{baseName}}}").items()) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{#items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isPrimitiveType}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnumOrRef}} + "{{{baseName}}}": {{{dataType}}}.from_dict(obj["{{{baseName}}}"]) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/isEnumOrRef}} + {{#isEnumOrRef}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{#defaultValue}} if obj.get("{{baseName}}") is not None else {{{defaultValue}}}{{/defaultValue}}{{^-last}},{{/-last}} + {{/isEnumOrRef}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{#defaultValue}} + "{{{baseName}}}": obj.get("{{{baseName}}}") if obj.get("{{{baseName}}}") is not None else {{{defaultValue}}}{{^-last}},{{/-last}} + {{/defaultValue}} + {{^defaultValue}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/defaultValue}} + {{/isPrimitiveType}} + {{/isContainer}} + {{/allVars}} + }) + {{#isAdditionalPropertiesTrue}} + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + {{/isAdditionalPropertiesTrue}} + return _obj + {{/hasChildren}} + +{{#vendorExtensions.x-py-postponed-model-imports.size}} +{{#vendorExtensions.x-py-postponed-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-model-imports}} +# TODO: Rewrite to not use raise_errors +{{classname}}.model_rebuild(raise_errors=False) +{{/vendorExtensions.x-py-postponed-model-imports.size}} \ No newline at end of file diff --git a/generator-templates/lenient/partial_header.mustache b/generator-templates/lenient/partial_header.mustache new file mode 100644 index 0000000..1ce7639 --- /dev/null +++ b/generator-templates/lenient/partial_header.mustache @@ -0,0 +1,3 @@ +""" + Generated by: https://openapi-generator.tech +""" \ No newline at end of file diff --git a/generator-templates/model.mustache b/generator-templates/model.mustache deleted file mode 100755 index 293d5b5..0000000 --- a/generator-templates/model.mustache +++ /dev/null @@ -1,240 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import pprint -import re # noqa: F401 - -import six - -from {{packageName}}.configuration import Configuration - - -{{#models}} -{{#model}} -class {{classname}}(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ -{{#allowableValues}}{{#enumVars}} - "{{enumDescription}}" - {{#model.isString}}{{name}} = {{{value}}}{{/model.isString}}{{^model.isString}}{{name}} = int({{{value}}}){{/model.isString}} -{{/enumVars}}{{/allowableValues}} -{{#allowableValues}} - allowable_values = [{{#enumVars}}{{name}}{{^-last}}, {{/-last}}{{/enumVars}}] # noqa: E501 - -{{/allowableValues}} - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { -{{#vars}} - '{{name}}': '{{{dataType}}}',{{#hasMore}},{{/hasMore}} -{{/vars}} - } - - attribute_map = { -{{#vars}} - '{{name}}': '{{baseName}}',{{#hasMore}},{{/hasMore}} -{{/vars}} - } -{{#discriminator}} - discriminator_value_class_map = { -{{#children}} - '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}} -{{/children}} - } -{{/discriminator}} - - def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, local_vars_configuration=None): # noqa: E501 - """{{classname}} - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration -{{#vars}}{{#-first}} -{{/-first}} - self._{{name}} = None -{{/vars}} - self.discriminator = {{#discriminator}}'{{{discriminatorName}}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}} -{{#vars}}{{#-first}} -{{/-first}} -{{#required}} - self.{{name}} = {{name}} -{{/required}} -{{^required}} -{{#isNullable}} - self.{{name}} = {{name}} -{{/isNullable}} -{{^isNullable}} - if {{name}} is not None: - self.{{name}} = {{name}} -{{/isNullable}} -{{/required}} -{{/vars}} - -{{#vars}} - @property - def {{name}}(self): - """Gets the {{name}} of this {{classname}}. # noqa: E501 - -{{#description}} - {{{description}}} # noqa: E501 -{{/description}} - - :return: The {{name}} of this {{classname}}. # noqa: E501 - :rtype: {{dataType}} - """ - return self._{{name}} - - @{{name}}.setter - def {{name}}(self, {{name}}): - """Sets the {{name}} of this {{classname}}. - -{{#description}} - {{{description}}} # noqa: E501 -{{/description}} - - :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501 - :type {{name}}: {{dataType}} - """ -{{^isNullable}} -{{#required}} - if self.local_vars_configuration.client_side_validation and {{name}} is None: # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501 -{{/required}} -{{/isNullable}} -{{#isEnum}} -{{#isContainer}} - allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 -{{#isListContainer}} - if (self.local_vars_configuration.client_side_validation and - not set({{{name}}}).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isListContainer}} -{{#isMapContainer}} - if (self.local_vars_configuration.client_side_validation and - not set({{{name}}}.keys()).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isMapContainer}} -{{/isContainer}} -{{^isContainer}} - allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 - if self.local_vars_configuration.client_side_validation and {{{name}}} not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501 - .format({{{name}}}, allowed_values) - ) -{{/isContainer}} -{{/isEnum}} -{{^isEnum}} -{{#hasValidation}} -{{#maxLength}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and len({{name}}) > {{maxLength}}): - raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 -{{/maxLength}} -{{#minLength}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and len({{name}}) < {{minLength}}): - raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 -{{/minLength}} -{{#maximum}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 -{{/maximum}} -{{#minimum}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 -{{/minimum}} -{{#pattern}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501 - raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 -{{/pattern}} -{{#maxItems}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and len({{name}}) > {{maxItems}}): - raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 -{{/maxItems}} -{{#minItems}} - if (self.local_vars_configuration.client_side_validation and - {{name}} is not None and len({{name}}) < {{minItems}}): - raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 -{{/minItems}} -{{/hasValidation}} -{{/isEnum}} - - self._{{name}} = {{name}} - -{{/vars}} -{{#discriminator}} - def get_real_child_model(self, data): - """Returns the real base class specified by the discriminator""" - discriminator_key = self.attribute_map[self.discriminator] - discriminator_value = data[discriminator_key] - return self.discriminator_value_class_map.get(discriminator_value) - -{{/discriminator}} - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, {{classname}}): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, {{classname}}): - return True - - return self.to_dict() != other.to_dict() -{{/model}} -{{/models}} \ No newline at end of file diff --git a/generator-templates/strict/model_generic.mustache b/generator-templates/strict/model_generic.mustache new file mode 100644 index 0000000..8b7f1b4 --- /dev/null +++ b/generator-templates/strict/model_generic.mustache @@ -0,0 +1,401 @@ +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +{{#vendorExtensions.x-py-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-model-imports}} +from typing import Optional, Set +from typing_extensions import Self + +{{#hasChildren}} +{{#discriminator}} +{{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }} +from typing import TYPE_CHECKING +if TYPE_CHECKING: +{{#mappedModels}} + from {{packageName}}.models.{{model.classFilename}} import {{modelName}} +{{/mappedModels}} + +{{/discriminator}} +{{/hasChildren}} +class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): + """ + {{#description}}{{{description}}}{{/description}}{{^description}}{{{classname}}}{{/description}} + """ # noqa: E501 +{{#vars}} + {{name}}: {{{vendorExtensions.x-py-typing}}} +{{/vars}} +{{#isAdditionalPropertiesTrue}} + additional_properties: Dict[str, Any] = {} +{{/isAdditionalPropertiesTrue}} + __properties: ClassVar[List[str]] = [{{#allVars}}"{{baseName}}"{{^-last}}, {{/-last}}{{/allVars}}] +{{#vars}} + {{#vendorExtensions.x-regex}} + + @field_validator('{{{name}}}') + def {{{name}}}_validate_regular_expression(cls, value): + """Validates the regular expression""" + {{^required}} + if value is None: + return value + + {{/required}} + {{#required}} + {{#isNullable}} + if value is None: + return value + + {{/isNullable}} + {{/required}} + if not re.match(r"{{{.}}}", value{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}): + raise ValueError(r"must validate the regular expression {{{vendorExtensions.x-pattern}}}") + return value + {{/vendorExtensions.x-regex}} + {{#isEnum}} + + @field_validator('{{{name}}}') + def {{{name}}}_validate_enum(cls, value): + """Validates the enum""" + {{^required}} + if value is None: + return value + + {{/required}} + {{#required}} + {{#isNullable}} + if value is None: + return value + + {{/isNullable}} + {{/required}} + {{#isContainer}} + {{#isArray}} + for i in value: + if i not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("each list item must be one of ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isArray}} + {{#isMap}} + for i in value.values(): + if i not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("dict values must be one of enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + if value not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("must be one of enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isContainer}} + return value + {{/isEnum}} +{{/vars}} + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + +{{#hasChildren}} +{{#discriminator}} + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = '{{discriminator.propertyBaseName}}' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + {{#mappedModels}}'{{{mappingName}}}': '{{{modelName}}}'{{^-last}},{{/-last}}{{/mappedModels}} + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + +{{/discriminator}} +{{/hasChildren}} + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[{{^hasChildren}}Self{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}{{/hasChildren}}]: + """Create an instance of {{{classname}}} from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + {{#vendorExtensions.x-py-readonly}} + * OpenAPI `readOnly` fields are excluded. + {{/vendorExtensions.x-py-readonly}} + {{#isAdditionalPropertiesTrue}} + * Fields in `self.additional_properties` are added to the output dict. + {{/isAdditionalPropertiesTrue}} + """ + excluded_fields: Set[str] = set([ + {{#vendorExtensions.x-py-readonly}} + "{{{.}}}", + {{/vendorExtensions.x-py-readonly}} + {{#isAdditionalPropertiesTrue}} + "additional_properties", + {{/isAdditionalPropertiesTrue}} + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + {{#allVars}} + {{#isContainer}} + {{#isArray}} + {{#items.isArray}} + {{^items.items.isPrimitiveType}} + # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list of list) + _items = [] + if self.{{{name}}}: + for _item_{{{name}}} in self.{{{name}}}: + if _item_{{{name}}}: + _items.append( + [_inner_item.to_dict() for _inner_item in _item_{{{name}}} if _inner_item is not None] + ) + _dict['{{{baseName}}}'] = _items + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list) + _items = [] + if self.{{{name}}}: + for _item_{{{name}}} in self.{{{name}}}: + if _item_{{{name}}}: + _items.append(_item_{{{name}}}.to_dict()) + _dict['{{{baseName}}}'] = _items + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isArray}} + {{#isMap}} + {{#items.isArray}} + {{^items.items.isPrimitiveType}} + # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict of array) + _field_dict_of_array = {} + if self.{{{name}}}: + for _key_{{{name}}} in self.{{{name}}}: + if self.{{{name}}}[_key_{{{name}}}] is not None: + _field_dict_of_array[_key_{{{name}}}] = [ + _item.to_dict() for _item in self.{{{name}}}[_key_{{{name}}}] + ] + _dict['{{{baseName}}}'] = _field_dict_of_array + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict) + _field_dict = {} + if self.{{{name}}}: + for _key_{{{name}}} in self.{{{name}}}: + if self.{{{name}}}[_key_{{{name}}}]: + _field_dict[_key_{{{name}}}] = self.{{{name}}}[_key_{{{name}}}].to_dict() + _dict['{{{baseName}}}'] = _field_dict + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of {{{name}}} + if self.{{{name}}}: + _dict['{{{baseName}}}'] = self.{{{name}}}.to_dict() + {{/isEnumOrRef}} + {{/isPrimitiveType}} + {{/isContainer}} + {{/allVars}} + {{#isAdditionalPropertiesTrue}} + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + {{/isAdditionalPropertiesTrue}} + {{#allVars}} + {{#isNullable}} + # set to None if {{{name}}} (nullable) is None + # and model_fields_set contains the field + if self.{{name}} is None and "{{{name}}}" in self.model_fields_set: + _dict['{{{baseName}}}'] = None + + {{/isNullable}} + {{/allVars}} + return _dict + + {{#hasChildren}} + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}]: + """Create an instance of {{{classname}}} from a dict""" + {{#discriminator}} + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + {{#mappedModels}} + if object_type == '{{{modelName}}}': + return import_module("{{packageName}}.models.{{model.classFilename}}").{{modelName}}.from_dict(obj) + {{/mappedModels}} + + return None + {{/discriminator}} + {{/hasChildren}} + {{^hasChildren}} + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of {{{classname}}} from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + {{#disallowAdditionalPropertiesIfNotPresent}} + {{^isAdditionalPropertiesTrue}} + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in {{classname}}) in the input: " + _key) + + {{/isAdditionalPropertiesTrue}} + {{/disallowAdditionalPropertiesIfNotPresent}} + _obj = cls.model_validate({ + {{#allVars}} + {{#isContainer}} + {{#isArray}} + {{#items.isArray}} + {{#items.items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.items.isPrimitiveType}} + {{^items.items.isPrimitiveType}} + "{{{baseName}}}": [ + [{{{items.items.dataType}}}.from_dict(_inner_item) for _inner_item in _item] + for _item in obj["{{{baseName}}}"] + ] if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{#items.isEnumOrRef}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{^items.isEnumOrRef}} + "{{{baseName}}}": [{{{items.dataType}}}.from_dict(_item) for _item in obj.get("{{{baseName}}}", []) if {{{items.dataType}}}.from_dict(_item) is not None]{{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{#items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isArray}} + {{#isMap}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + {{#items.isContainer}} + {{#items.isMap}} + "{{{baseName}}}": dict( + (_k, dict( + (_ik, {{{items.items.dataType}}}.from_dict(_iv)) + for _ik, _iv in _v.items() + ) + if _v is not None + else None + ) + for _k, _v in obj.get("{{{baseName}}}").items() + ) + if obj.get("{{{baseName}}}") is not None + else None{{^-last}},{{/-last}} + {{/items.isMap}} + {{#items.isArray}} + "{{{baseName}}}": dict( + (_k, + [{{{items.items.dataType}}}.from_dict(_item) for _item in _v] + if _v is not None + else None + ) + for _k, _v in obj.get("{{{baseName}}}", {}).items() + ){{^-last}},{{/-last}} + {{/items.isArray}} + {{/items.isContainer}} + {{^items.isContainer}} + "{{{baseName}}}": dict( + (_k, {{{items.dataType}}}.from_dict(_v)) + for _k, _v in obj["{{{baseName}}}"].items() + ) + if obj.get("{{{baseName}}}") is not None + else None{{^-last}},{{/-last}} + {{/items.isContainer}} + {{/items.isEnumOrRef}} + {{#items.isEnumOrRef}} + "{{{baseName}}}": dict((_k, _v) for _k, _v in obj.get("{{{baseName}}}").items()) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{#items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isPrimitiveType}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnumOrRef}} + "{{{baseName}}}": {{{dataType}}}.from_dict(obj["{{{baseName}}}"]) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/isEnumOrRef}} + {{#isEnumOrRef}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{#defaultValue}} if obj.get("{{baseName}}") is not None else {{{defaultValue}}}{{/defaultValue}}{{^-last}},{{/-last}} + {{/isEnumOrRef}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{#defaultValue}} + "{{{baseName}}}": obj.get("{{{baseName}}}") if obj.get("{{{baseName}}}") is not None else {{{defaultValue}}}{{^-last}},{{/-last}} + {{/defaultValue}} + {{^defaultValue}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/defaultValue}} + {{/isPrimitiveType}} + {{/isContainer}} + {{/allVars}} + }) + {{#isAdditionalPropertiesTrue}} + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + {{/isAdditionalPropertiesTrue}} + return _obj + {{/hasChildren}} + +{{#vendorExtensions.x-py-postponed-model-imports.size}} +{{#vendorExtensions.x-py-postponed-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-model-imports}} +# TODO: Rewrite to not use raise_errors +{{classname}}.model_rebuild(raise_errors=False) +{{/vendorExtensions.x-py-postponed-model-imports.size}} \ No newline at end of file diff --git a/generator-templates/strict/partial_header.mustache b/generator-templates/strict/partial_header.mustache new file mode 100644 index 0000000..1ce7639 --- /dev/null +++ b/generator-templates/strict/partial_header.mustache @@ -0,0 +1,3 @@ +""" + Generated by: https://openapi-generator.tech +""" \ No newline at end of file diff --git a/regula/facesdk/webclient/__init__.py b/regula/facesdk/webclient/__init__.py index 91f2b54..a59c387 100644 --- a/regula/facesdk/webclient/__init__.py +++ b/regula/facesdk/webclient/__init__.py @@ -1,10 +1,10 @@ # compatibility import from regula.facesdk.webclient.ext import MatchImage, MatchRequest -from regula.facesdk.webclient.gen.model.face_sdk_result import FaceSDKResult -from regula.facesdk.webclient.gen.model.face_sdk_result_code import FaceSDKResultCode -from regula.facesdk.webclient.gen.model.match_image_detection import MatchImageDetection -from regula.facesdk.webclient.gen.model.match_image_result import MatchImageResult -from regula.facesdk.webclient.gen.model.match_response import MatchResponse +from regula.facesdk.webclient.gen.models.face_sdk_result import FaceSDKResult +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode +from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection +from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult +from regula.facesdk.webclient.gen.models.match_response import MatchResponse FaceRecognitionResult = FaceSDKResult FaceRecognitionResultCode = FaceSDKResultCode diff --git a/regula/facesdk/webclient/ext/api/group_api.py b/regula/facesdk/webclient/ext/api/group_api.py index 8500698..55cad1a 100644 --- a/regula/facesdk/webclient/ext/api/group_api.py +++ b/regula/facesdk/webclient/ext/api/group_api.py @@ -1,36 +1,11 @@ -from regula.facesdk.webclient.gen import ApiClient from regula.facesdk.webclient.gen.api.group_api import GroupApi as GenGroupApi -from regula.facesdk.webclient.gen.model.group import Group -from regula.facesdk.webclient.gen.model.group_page import GroupPage -from regula.facesdk.webclient.gen.model.group_to_create import GroupToCreate -from regula.facesdk.webclient.gen.model.persons_page import PersonsPage -from regula.facesdk.webclient.gen.model.update_group import UpdateGroup +from regula.facesdk.webclient.gen.models.group import Group +from regula.facesdk.webclient.gen.models.group_to_create import GroupToCreate class GroupApi(GenGroupApi): - def __init__(self, api_client: ApiClient): - super().__init__(api_client) - def create_group(self, group_name: str, metadata=None, **kwargs) -> Group: if metadata is None: metadata = {} group_to_create = GroupToCreate(name=group_name, metadata=metadata) return super().create_group(group_to_create, **kwargs) - - def delete_group(self, group_id: str, **kwargs) -> None: - return super().delete_group(group_id, **kwargs) - - def get_all_groups(self, **kwargs) -> GroupPage: - return super().get_all_groups(**kwargs) - - def get_all_persons_by_group_id(self, group_id: str, **kwargs) -> PersonsPage: - return super().get_all_persons_by_group_id(group_id, **kwargs) - - def get_group(self, group_id: str, **kwargs) -> Group: - return super().get_group(group_id, **kwargs) - - def update_group(self, group_id: str, group_to_create: GroupToCreate, **kwargs) -> None: - return super().update_group(group_id, group_to_create, **kwargs) - - def update_persons_in_group(self, group_id: str, update_group: UpdateGroup, **kwargs) -> None: - return super().update_persons_in_group(group_id, update_group, **kwargs) diff --git a/regula/facesdk/webclient/ext/api/match_api.py b/regula/facesdk/webclient/ext/api/match_api.py index 81ce354..54b2fdd 100755 --- a/regula/facesdk/webclient/ext/api/match_api.py +++ b/regula/facesdk/webclient/ext/api/match_api.py @@ -1,13 +1,5 @@ -from typing import List - from regula.facesdk.webclient.gen import Configuration, ApiClient -from regula.facesdk.webclient.gen.apis import MatchApi as GenMatchApi -from regula.facesdk.webclient.ext.models import MatchRequest, DetectRequest -from regula.facesdk.webclient.gen.model.detect_response import DetectResponse -from regula.facesdk.webclient.gen.model.match_and_search_request import MatchAndSearchRequest -from regula.facesdk.webclient.gen.model.match_and_search_request_all_of_images import MatchAndSearchRequestAllOfImages -from regula.facesdk.webclient.gen.model.match_and_search_response import MatchAndSearchResponse -from regula.facesdk.webclient.gen.model.match_response import MatchResponse +from regula.facesdk.webclient.gen.api import MatchApi as GenMatchApi class MatchApi(GenMatchApi): @@ -24,23 +16,5 @@ def __init__(self, host=None, debug=False, verify_ssl=False, api_client=None): def __enter__(self): return self - def __exit__(self, exc_type, exc_val, exc_tb): - self.api_client.close() - - def match_and_search(self, images: List[MatchAndSearchRequestAllOfImages], group_ids: List[int], - limit: int = 100, threshold: float = 1.0) -> MatchAndSearchResponse: - body = MatchAndSearchRequest( - images=images, - group_ids=group_ids - ) - return super().match_and_search(body) - - def match(self, match_request: MatchRequest, **kwargs) -> MatchResponse: - return super().match(match_request, **kwargs) - - # deprecated use match - def compare(self, compare_request: MatchRequest, **kwargs) -> MatchResponse: - return super().match(compare_request, **kwargs) - - def detect(self, detect_request: DetectRequest, **kwargs) -> DetectResponse: - return super().detect(detect_request, **kwargs) + def __exit__(self, exc_type, exc_value, traceback): + pass diff --git a/regula/facesdk/webclient/ext/api/person_api.py b/regula/facesdk/webclient/ext/api/person_api.py index 2bccf4c..90f2a8a 100644 --- a/regula/facesdk/webclient/ext/api/person_api.py +++ b/regula/facesdk/webclient/ext/api/person_api.py @@ -1,46 +1,20 @@ import base64 -from regula.facesdk.webclient.gen import ApiClient +from regula.facesdk.webclient.gen.models.add_image_to_person_request import AddImageToPersonRequest +from regula.facesdk.webclient.gen.models.add_image_to_person_request_image import AddImageToPersonRequestImage +from regula.facesdk.webclient.gen.models.add_image_to_person_response import AddImageToPersonResponse from regula.facesdk.webclient.gen.api.person_api import PersonApi as GenPersonApi -from regula.facesdk.webclient.gen.model.image import Image -from regula.facesdk.webclient.gen.model.image_fields import ImageFields -from regula.facesdk.webclient.gen.model.image_fields_image import ImageFieldsImage -from regula.facesdk.webclient.gen.model.image_page import ImagePage -from regula.facesdk.webclient.gen.model.person import Person -from regula.facesdk.webclient.gen.model.person_fields import PersonFields - +from regula.facesdk.webclient.gen.models.person import Person +from regula.facesdk.webclient.gen.models.person_fields import PersonFields +from uuid import UUID class PersonApi(GenPersonApi): - def __init__(self, api_client: ApiClient): - super().__init__(api_client) - - def add_image_to_person(self, person_id: str, content: bytes, content_type: str = None, **kwargs) -> Image: + def add_image_to_person(self, person_id: UUID, content: bytes, content_type: str = None, **kwargs) -> AddImageToPersonResponse: base_image = base64.b64encode(content).decode("UTF-8") - image = ImageFields(image=ImageFieldsImage(content_type, base_image)) + image = AddImageToPersonRequest(image=AddImageToPersonRequestImage(contentType=content_type, content=base_image)) return super().add_image_to_person(person_id, image, **kwargs) def create_person(self, person_fields: PersonFields, **kwargs) -> Person: if person_fields.metadata is None: person_fields.metadata = {} return super().create_person(person_fields, **kwargs) - - def delete_image_of_person(self, image_id: str, person_id: str, **kwargs) -> None: - return super().delete_image_of_person(image_id, person_id, **kwargs) - - def delete_person(self, person_id: str, **kwargs) -> None: - return super().delete_person(person_id, **kwargs) - - def get_all_groups_by_person_id(self, person_id: str, **kwargs): - return super().get_all_groups_by_person_id(person_id) - - def get_all_images_by_person_id(self, person_id: str, **kwargs) -> ImagePage: - return super().get_all_images_by_person_id(person_id, **kwargs) - - def get_image_of_person(self, image_id: str, person_id: str, **kwargs): - return super().get_image_of_person(image_id, person_id, **kwargs) - - def get_person(self, person_id: str, **kwargs) -> Person: - return super().get_person(person_id, **kwargs) - - def update_person(self, person_id: str, person_fields: PersonFields, **kwargs) -> None: - return super().update_person(person_id, person_fields, **kwargs) diff --git a/regula/facesdk/webclient/ext/api/sdk.py b/regula/facesdk/webclient/ext/api/sdk.py index 05b68d6..a674a83 100755 --- a/regula/facesdk/webclient/ext/api/sdk.py +++ b/regula/facesdk/webclient/ext/api/sdk.py @@ -2,7 +2,7 @@ from regula.facesdk.webclient.ext.api import PersonApi from regula.facesdk.webclient.ext.api.group_api import GroupApi from regula.facesdk.webclient.ext.api.search_api import SearchApi -from regula.facesdk.webclient.gen import ApiClient, Configuration +from regula.facesdk.webclient.gen import ApiClient, Configuration, HealthcheckApi, Liveness20Api class FaceSdk: @@ -20,9 +20,11 @@ def __init__(self, host=None, debug=None, verify_ssl=True, api_client=None): self.person_api = PersonApi(api_client=self.__api_client) self.group_api = GroupApi(api_client=self.__api_client) self.search_api = SearchApi(api_client=self.__api_client) + self.healthcheck = HealthcheckApi(api_client=self.__api_client) + self.liveness = Liveness20Api(api_client=self.__api_client) def __enter__(self): return self - def __exit__(self, exc_type, exc_val, exc_tb): - self.__api_client.close() + def __exit__(self, exc_type, exc_value, traceback): + pass diff --git a/regula/facesdk/webclient/ext/api/search_api.py b/regula/facesdk/webclient/ext/api/search_api.py index 7ff7fa6..ae120ca 100644 --- a/regula/facesdk/webclient/ext/api/search_api.py +++ b/regula/facesdk/webclient/ext/api/search_api.py @@ -1,15 +1,11 @@ import base64 -from regula.facesdk.webclient.gen import ApiClient from regula.facesdk.webclient.gen.api.search_api import SearchApi as GenSearchApi -from regula.facesdk.webclient.gen.model.search_request import SearchRequest -from regula.facesdk.webclient.gen.model.search_result import SearchResult +from regula.facesdk.webclient.gen.models.search_request import SearchRequest +from regula.facesdk.webclient.gen.models.search_result import SearchResult class SearchApi(GenSearchApi): - def __init__(self, api_client: ApiClient): - super().__init__(api_client) - def search(self, search_request: SearchRequest, **kwargs) -> SearchResult: image = search_request.image if image is not None: diff --git a/regula/facesdk/webclient/ext/models/detect_request.py b/regula/facesdk/webclient/ext/models/detect_request.py index 7c64b03..430041c 100755 --- a/regula/facesdk/webclient/ext/models/detect_request.py +++ b/regula/facesdk/webclient/ext/models/detect_request.py @@ -2,7 +2,7 @@ from regula.facesdk.webclient.ext.common import Base64String, bytes_to_base64 from regula.facesdk.webclient.gen import ApiValueError -from regula.facesdk.webclient.gen.model.process_param import ProcessParam +from regula.facesdk.webclient.gen.models.process_param import ProcessParam from regula.facesdk.webclient.gen.models import DetectRequest as GetDetectRequest diff --git a/regula/facesdk/webclient/ext/models/match_image.py b/regula/facesdk/webclient/ext/models/match_image.py index c10693f..6fe9101 100755 --- a/regula/facesdk/webclient/ext/models/match_image.py +++ b/regula/facesdk/webclient/ext/models/match_image.py @@ -2,7 +2,7 @@ from regula.facesdk.webclient.ext.common import Base64String, bytes_to_base64 from regula.facesdk.webclient.gen import ApiValueError -from regula.facesdk.webclient.gen.model.image_source import ImageSource +from regula.facesdk.webclient.gen.models.image_source import ImageSource from regula.facesdk.webclient.gen.models import MatchImage as GenMatchImage @@ -16,4 +16,4 @@ def __init__(self, index=None, type=None, data: Union[Base64String, bytes] = Non if isinstance(data, bytes): data = bytes_to_base64(data) - super().__init__(index, type, data, local_vars_configuration) + super().__init__(index=index, type=type, data=data, local_vars_configuration) diff --git a/regula/facesdk/webclient/gen/__init__.py b/regula/facesdk/webclient/gen/__init__.py index 0475eb8..60ba8d2 100644 --- a/regula/facesdk/webclient/gen/__init__.py +++ b/regula/facesdk/webclient/gen/__init__.py @@ -1,27 +1,358 @@ +# coding: utf-8 + # flake8: noqa """ - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 Generated by: https://openapi-generator.tech """ - __version__ = "1.0.0" +# Define package exports +__all__ = [ + "GroupApi", + "HealthcheckApi", + "Liveness20Api", + "MatchApi", + "PersonApi", + "SearchApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AddImageToPersonRequest", + "AddImageToPersonRequestData", + "AddImageToPersonRequestImage", + "AddImageToPersonResponse", + "AttributeConfig", + "AttributesData", + "Crop", + "DetailItem", + "DetectAttributesDetails", + "DetectDetailsMeta", + "DetectMetaData", + "DetectRequest", + "DetectRequestData", + "DetectResponse", + "DetectResponseResults", + "DetectResult", + "Detection", + "DetectionAttributes", + "DetectionAttributesDetailsInner", + "DetectionFace", + "DetectionQuality", + "DeviceInfo", + "FaceAttribute", + "FaceImageQualityAlignType", + "FaceImageQualityGroups", + "FaceImageQualityGroupsStrings", + "FaceImageQualityStatus", + "FaceQualityConfigName", + "FaceQualityScenarios", + "FaceSDKResult", + "FaceSDKResultCode", + "FacesResponse", + "FacesResponseData", + "FilterOp", + "FilterSearchRequest", + "Group", + "GroupData", + "GroupPage", + "GroupPageItems", + "GroupResponse", + "GroupToCreate", + "Image", + "ImageFields", + "ImageFieldsImage", + "ImagePage", + "ImagePageItems", + "ImageSource", + "LivenessType", + "MatchAndSearchRequest", + "MatchAndSearchRequestImagesItem", + "MatchAndSearchResponse", + "MatchAndSearchResponseData", + "MatchAndSearchResponseDataDetectionsItem", + "MatchImage", + "MatchImageDetection", + "MatchImageResult", + "MatchRequest", + "MatchRequestData", + "MatchResponse", + "MatchResponseData", + "OperationLog", + "OutputImageParams", + "Page", + "Person", + "PersonData", + "PersonFields", + "PersonItems", + "PersonToUpdateFields", + "PersonWithImages", + "PersonWithImagesData", + "PersonsPage", + "ProcessParam", + "ProcessParamAttributes", + "QualityConfig", + "QualityDetail", + "QualityDetailsGroups", + "QualityRequest", + "RecognizeImage", + "RecognizeImageData", + "ResizeOptions", + "SearchBadParams", + "SearchDetection", + "SearchParameters", + "SearchParametersCreatePerson", + "SearchPerson", + "SearchPersonData", + "SearchRequest", + "SearchResult", + "TransactionInfo", + "TransactionLabels", + "UpdateGroup", +] + +if __import__("typing").TYPE_CHECKING: + # import apis into sdk package + from regula.facesdk.webclient.gen.api.group_api import GroupApi as GroupApi + from regula.facesdk.webclient.gen.api.healthcheck_api import HealthcheckApi as HealthcheckApi + from regula.facesdk.webclient.gen.api.liveness20_api import Liveness20Api as Liveness20Api + from regula.facesdk.webclient.gen.api.match_api import MatchApi as MatchApi + from regula.facesdk.webclient.gen.api.person_api import PersonApi as PersonApi + from regula.facesdk.webclient.gen.api.search_api import SearchApi as SearchApi + + # import ApiClient + from regula.facesdk.webclient.gen.api_response import ApiResponse as ApiResponse + from regula.facesdk.webclient.gen.api_client import ApiClient as ApiClient + from regula.facesdk.webclient.gen.configuration import Configuration as Configuration + from regula.facesdk.webclient.gen.exceptions import OpenApiException as OpenApiException + from regula.facesdk.webclient.gen.exceptions import ApiTypeError as ApiTypeError + from regula.facesdk.webclient.gen.exceptions import ApiValueError as ApiValueError + from regula.facesdk.webclient.gen.exceptions import ApiKeyError as ApiKeyError + from regula.facesdk.webclient.gen.exceptions import ApiAttributeError as ApiAttributeError + from regula.facesdk.webclient.gen.exceptions import ApiException as ApiException + + # import models into sdk package + from regula.facesdk.webclient.gen.models.add_image_to_person_request import AddImageToPersonRequest as AddImageToPersonRequest + from regula.facesdk.webclient.gen.models.add_image_to_person_request_data import AddImageToPersonRequestData as AddImageToPersonRequestData + from regula.facesdk.webclient.gen.models.add_image_to_person_request_image import AddImageToPersonRequestImage as AddImageToPersonRequestImage + from regula.facesdk.webclient.gen.models.add_image_to_person_response import AddImageToPersonResponse as AddImageToPersonResponse + from regula.facesdk.webclient.gen.models.attribute_config import AttributeConfig as AttributeConfig + from regula.facesdk.webclient.gen.models.attributes_data import AttributesData as AttributesData + from regula.facesdk.webclient.gen.models.crop import Crop as Crop + from regula.facesdk.webclient.gen.models.detail_item import DetailItem as DetailItem + from regula.facesdk.webclient.gen.models.detect_attributes_details import DetectAttributesDetails as DetectAttributesDetails + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta as DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_meta_data import DetectMetaData as DetectMetaData + from regula.facesdk.webclient.gen.models.detect_request import DetectRequest as DetectRequest + from regula.facesdk.webclient.gen.models.detect_request_data import DetectRequestData as DetectRequestData + from regula.facesdk.webclient.gen.models.detect_response import DetectResponse as DetectResponse + from regula.facesdk.webclient.gen.models.detect_response_results import DetectResponseResults as DetectResponseResults + from regula.facesdk.webclient.gen.models.detect_result import DetectResult as DetectResult + from regula.facesdk.webclient.gen.models.detection import Detection as Detection + from regula.facesdk.webclient.gen.models.detection_attributes import DetectionAttributes as DetectionAttributes + from regula.facesdk.webclient.gen.models.detection_attributes_details_inner import DetectionAttributesDetailsInner as DetectionAttributesDetailsInner + from regula.facesdk.webclient.gen.models.detection_face import DetectionFace as DetectionFace + from regula.facesdk.webclient.gen.models.detection_quality import DetectionQuality as DetectionQuality + from regula.facesdk.webclient.gen.models.device_info import DeviceInfo as DeviceInfo + from regula.facesdk.webclient.gen.models.face_attribute import FaceAttribute as FaceAttribute + from regula.facesdk.webclient.gen.models.face_image_quality_align_type import FaceImageQualityAlignType as FaceImageQualityAlignType + from regula.facesdk.webclient.gen.models.face_image_quality_groups import FaceImageQualityGroups as FaceImageQualityGroups + from regula.facesdk.webclient.gen.models.face_image_quality_groups_strings import FaceImageQualityGroupsStrings as FaceImageQualityGroupsStrings + from regula.facesdk.webclient.gen.models.face_image_quality_status import FaceImageQualityStatus as FaceImageQualityStatus + from regula.facesdk.webclient.gen.models.face_quality_config_name import FaceQualityConfigName as FaceQualityConfigName + from regula.facesdk.webclient.gen.models.face_quality_scenarios import FaceQualityScenarios as FaceQualityScenarios + from regula.facesdk.webclient.gen.models.face_sdk_result import FaceSDKResult as FaceSDKResult + from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode as FaceSDKResultCode + from regula.facesdk.webclient.gen.models.faces_response import FacesResponse as FacesResponse + from regula.facesdk.webclient.gen.models.faces_response_data import FacesResponseData as FacesResponseData + from regula.facesdk.webclient.gen.models.filter_op import FilterOp as FilterOp + from regula.facesdk.webclient.gen.models.filter_search_request import FilterSearchRequest as FilterSearchRequest + from regula.facesdk.webclient.gen.models.group import Group as Group + from regula.facesdk.webclient.gen.models.group_data import GroupData as GroupData + from regula.facesdk.webclient.gen.models.group_page import GroupPage as GroupPage + from regula.facesdk.webclient.gen.models.group_page_items import GroupPageItems as GroupPageItems + from regula.facesdk.webclient.gen.models.group_response import GroupResponse as GroupResponse + from regula.facesdk.webclient.gen.models.group_to_create import GroupToCreate as GroupToCreate + from regula.facesdk.webclient.gen.models.image import Image as Image + from regula.facesdk.webclient.gen.models.image_fields import ImageFields as ImageFields + from regula.facesdk.webclient.gen.models.image_fields_image import ImageFieldsImage as ImageFieldsImage + from regula.facesdk.webclient.gen.models.image_page import ImagePage as ImagePage + from regula.facesdk.webclient.gen.models.image_page_items import ImagePageItems as ImagePageItems + from regula.facesdk.webclient.gen.models.image_source import ImageSource as ImageSource + from regula.facesdk.webclient.gen.models.liveness_type import LivenessType as LivenessType + from regula.facesdk.webclient.gen.models.match_and_search_request import MatchAndSearchRequest as MatchAndSearchRequest + from regula.facesdk.webclient.gen.models.match_and_search_request_images_item import MatchAndSearchRequestImagesItem as MatchAndSearchRequestImagesItem + from regula.facesdk.webclient.gen.models.match_and_search_response import MatchAndSearchResponse as MatchAndSearchResponse + from regula.facesdk.webclient.gen.models.match_and_search_response_data import MatchAndSearchResponseData as MatchAndSearchResponseData + from regula.facesdk.webclient.gen.models.match_and_search_response_data_detections_item import MatchAndSearchResponseDataDetectionsItem as MatchAndSearchResponseDataDetectionsItem + from regula.facesdk.webclient.gen.models.match_image import MatchImage as MatchImage + from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection as MatchImageDetection + from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult as MatchImageResult + from regula.facesdk.webclient.gen.models.match_request import MatchRequest as MatchRequest + from regula.facesdk.webclient.gen.models.match_request_data import MatchRequestData as MatchRequestData + from regula.facesdk.webclient.gen.models.match_response import MatchResponse as MatchResponse + from regula.facesdk.webclient.gen.models.match_response_data import MatchResponseData as MatchResponseData + from regula.facesdk.webclient.gen.models.operation_log import OperationLog as OperationLog + from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams as OutputImageParams + from regula.facesdk.webclient.gen.models.page import Page as Page + from regula.facesdk.webclient.gen.models.person import Person as Person + from regula.facesdk.webclient.gen.models.person_data import PersonData as PersonData + from regula.facesdk.webclient.gen.models.person_fields import PersonFields as PersonFields + from regula.facesdk.webclient.gen.models.person_items import PersonItems as PersonItems + from regula.facesdk.webclient.gen.models.person_to_update_fields import PersonToUpdateFields as PersonToUpdateFields + from regula.facesdk.webclient.gen.models.person_with_images import PersonWithImages as PersonWithImages + from regula.facesdk.webclient.gen.models.person_with_images_data import PersonWithImagesData as PersonWithImagesData + from regula.facesdk.webclient.gen.models.persons_page import PersonsPage as PersonsPage + from regula.facesdk.webclient.gen.models.process_param import ProcessParam as ProcessParam + from regula.facesdk.webclient.gen.models.process_param_attributes import ProcessParamAttributes as ProcessParamAttributes + from regula.facesdk.webclient.gen.models.quality_config import QualityConfig as QualityConfig + from regula.facesdk.webclient.gen.models.quality_detail import QualityDetail as QualityDetail + from regula.facesdk.webclient.gen.models.quality_details_groups import QualityDetailsGroups as QualityDetailsGroups + from regula.facesdk.webclient.gen.models.quality_request import QualityRequest as QualityRequest + from regula.facesdk.webclient.gen.models.recognize_image import RecognizeImage as RecognizeImage + from regula.facesdk.webclient.gen.models.recognize_image_data import RecognizeImageData as RecognizeImageData + from regula.facesdk.webclient.gen.models.resize_options import ResizeOptions as ResizeOptions + from regula.facesdk.webclient.gen.models.search_bad_params import SearchBadParams as SearchBadParams + from regula.facesdk.webclient.gen.models.search_detection import SearchDetection as SearchDetection + from regula.facesdk.webclient.gen.models.search_parameters import SearchParameters as SearchParameters + from regula.facesdk.webclient.gen.models.search_parameters_create_person import SearchParametersCreatePerson as SearchParametersCreatePerson + from regula.facesdk.webclient.gen.models.search_person import SearchPerson as SearchPerson + from regula.facesdk.webclient.gen.models.search_person_data import SearchPersonData as SearchPersonData + from regula.facesdk.webclient.gen.models.search_request import SearchRequest as SearchRequest + from regula.facesdk.webclient.gen.models.search_result import SearchResult as SearchResult + from regula.facesdk.webclient.gen.models.transaction_info import TransactionInfo as TransactionInfo + from regula.facesdk.webclient.gen.models.transaction_labels import TransactionLabels as TransactionLabels + from regula.facesdk.webclient.gen.models.update_group import UpdateGroup as UpdateGroup + +else: + from lazy_imports import LazyModule, as_package, load + + load( + LazyModule( + *as_package(__file__), + ("__version__", __version__), + ("__all__", __all__), + """# import apis into sdk package +from regula.facesdk.webclient.gen.api.group_api import GroupApi as GroupApi +from regula.facesdk.webclient.gen.api.healthcheck_api import HealthcheckApi as HealthcheckApi +from regula.facesdk.webclient.gen.api.liveness20_api import Liveness20Api as Liveness20Api +from regula.facesdk.webclient.gen.api.match_api import MatchApi as MatchApi +from regula.facesdk.webclient.gen.api.person_api import PersonApi as PersonApi +from regula.facesdk.webclient.gen.api.search_api import SearchApi as SearchApi + # import ApiClient -from regula.facesdk.webclient.gen.api_client import ApiClient - -# import Configuration -from regula.facesdk.webclient.gen.configuration import Configuration - -# import exceptions -from regula.facesdk.webclient.gen.exceptions import OpenApiException -from regula.facesdk.webclient.gen.exceptions import ApiAttributeError -from regula.facesdk.webclient.gen.exceptions import ApiTypeError -from regula.facesdk.webclient.gen.exceptions import ApiValueError -from regula.facesdk.webclient.gen.exceptions import ApiKeyError -from regula.facesdk.webclient.gen.exceptions import ApiException +from regula.facesdk.webclient.gen.api_response import ApiResponse as ApiResponse +from regula.facesdk.webclient.gen.api_client import ApiClient as ApiClient +from regula.facesdk.webclient.gen.configuration import Configuration as Configuration +from regula.facesdk.webclient.gen.exceptions import OpenApiException as OpenApiException +from regula.facesdk.webclient.gen.exceptions import ApiTypeError as ApiTypeError +from regula.facesdk.webclient.gen.exceptions import ApiValueError as ApiValueError +from regula.facesdk.webclient.gen.exceptions import ApiKeyError as ApiKeyError +from regula.facesdk.webclient.gen.exceptions import ApiAttributeError as ApiAttributeError +from regula.facesdk.webclient.gen.exceptions import ApiException as ApiException + +# import models into sdk package +from regula.facesdk.webclient.gen.models.add_image_to_person_request import AddImageToPersonRequest as AddImageToPersonRequest +from regula.facesdk.webclient.gen.models.add_image_to_person_request_data import AddImageToPersonRequestData as AddImageToPersonRequestData +from regula.facesdk.webclient.gen.models.add_image_to_person_request_image import AddImageToPersonRequestImage as AddImageToPersonRequestImage +from regula.facesdk.webclient.gen.models.add_image_to_person_response import AddImageToPersonResponse as AddImageToPersonResponse +from regula.facesdk.webclient.gen.models.attribute_config import AttributeConfig as AttributeConfig +from regula.facesdk.webclient.gen.models.attributes_data import AttributesData as AttributesData +from regula.facesdk.webclient.gen.models.crop import Crop as Crop +from regula.facesdk.webclient.gen.models.detail_item import DetailItem as DetailItem +from regula.facesdk.webclient.gen.models.detect_attributes_details import DetectAttributesDetails as DetectAttributesDetails +from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta as DetectDetailsMeta +from regula.facesdk.webclient.gen.models.detect_meta_data import DetectMetaData as DetectMetaData +from regula.facesdk.webclient.gen.models.detect_request import DetectRequest as DetectRequest +from regula.facesdk.webclient.gen.models.detect_request_data import DetectRequestData as DetectRequestData +from regula.facesdk.webclient.gen.models.detect_response import DetectResponse as DetectResponse +from regula.facesdk.webclient.gen.models.detect_response_results import DetectResponseResults as DetectResponseResults +from regula.facesdk.webclient.gen.models.detect_result import DetectResult as DetectResult +from regula.facesdk.webclient.gen.models.detection import Detection as Detection +from regula.facesdk.webclient.gen.models.detection_attributes import DetectionAttributes as DetectionAttributes +from regula.facesdk.webclient.gen.models.detection_attributes_details_inner import DetectionAttributesDetailsInner as DetectionAttributesDetailsInner +from regula.facesdk.webclient.gen.models.detection_face import DetectionFace as DetectionFace +from regula.facesdk.webclient.gen.models.detection_quality import DetectionQuality as DetectionQuality +from regula.facesdk.webclient.gen.models.device_info import DeviceInfo as DeviceInfo +from regula.facesdk.webclient.gen.models.face_attribute import FaceAttribute as FaceAttribute +from regula.facesdk.webclient.gen.models.face_image_quality_align_type import FaceImageQualityAlignType as FaceImageQualityAlignType +from regula.facesdk.webclient.gen.models.face_image_quality_groups import FaceImageQualityGroups as FaceImageQualityGroups +from regula.facesdk.webclient.gen.models.face_image_quality_groups_strings import FaceImageQualityGroupsStrings as FaceImageQualityGroupsStrings +from regula.facesdk.webclient.gen.models.face_image_quality_status import FaceImageQualityStatus as FaceImageQualityStatus +from regula.facesdk.webclient.gen.models.face_quality_config_name import FaceQualityConfigName as FaceQualityConfigName +from regula.facesdk.webclient.gen.models.face_quality_scenarios import FaceQualityScenarios as FaceQualityScenarios +from regula.facesdk.webclient.gen.models.face_sdk_result import FaceSDKResult as FaceSDKResult +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode as FaceSDKResultCode +from regula.facesdk.webclient.gen.models.faces_response import FacesResponse as FacesResponse +from regula.facesdk.webclient.gen.models.faces_response_data import FacesResponseData as FacesResponseData +from regula.facesdk.webclient.gen.models.filter_op import FilterOp as FilterOp +from regula.facesdk.webclient.gen.models.filter_search_request import FilterSearchRequest as FilterSearchRequest +from regula.facesdk.webclient.gen.models.group import Group as Group +from regula.facesdk.webclient.gen.models.group_data import GroupData as GroupData +from regula.facesdk.webclient.gen.models.group_page import GroupPage as GroupPage +from regula.facesdk.webclient.gen.models.group_page_items import GroupPageItems as GroupPageItems +from regula.facesdk.webclient.gen.models.group_response import GroupResponse as GroupResponse +from regula.facesdk.webclient.gen.models.group_to_create import GroupToCreate as GroupToCreate +from regula.facesdk.webclient.gen.models.image import Image as Image +from regula.facesdk.webclient.gen.models.image_fields import ImageFields as ImageFields +from regula.facesdk.webclient.gen.models.image_fields_image import ImageFieldsImage as ImageFieldsImage +from regula.facesdk.webclient.gen.models.image_page import ImagePage as ImagePage +from regula.facesdk.webclient.gen.models.image_page_items import ImagePageItems as ImagePageItems +from regula.facesdk.webclient.gen.models.image_source import ImageSource as ImageSource +from regula.facesdk.webclient.gen.models.liveness_type import LivenessType as LivenessType +from regula.facesdk.webclient.gen.models.match_and_search_request import MatchAndSearchRequest as MatchAndSearchRequest +from regula.facesdk.webclient.gen.models.match_and_search_request_images_item import MatchAndSearchRequestImagesItem as MatchAndSearchRequestImagesItem +from regula.facesdk.webclient.gen.models.match_and_search_response import MatchAndSearchResponse as MatchAndSearchResponse +from regula.facesdk.webclient.gen.models.match_and_search_response_data import MatchAndSearchResponseData as MatchAndSearchResponseData +from regula.facesdk.webclient.gen.models.match_and_search_response_data_detections_item import MatchAndSearchResponseDataDetectionsItem as MatchAndSearchResponseDataDetectionsItem +from regula.facesdk.webclient.gen.models.match_image import MatchImage as MatchImage +from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection as MatchImageDetection +from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult as MatchImageResult +from regula.facesdk.webclient.gen.models.match_request import MatchRequest as MatchRequest +from regula.facesdk.webclient.gen.models.match_request_data import MatchRequestData as MatchRequestData +from regula.facesdk.webclient.gen.models.match_response import MatchResponse as MatchResponse +from regula.facesdk.webclient.gen.models.match_response_data import MatchResponseData as MatchResponseData +from regula.facesdk.webclient.gen.models.operation_log import OperationLog as OperationLog +from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams as OutputImageParams +from regula.facesdk.webclient.gen.models.page import Page as Page +from regula.facesdk.webclient.gen.models.person import Person as Person +from regula.facesdk.webclient.gen.models.person_data import PersonData as PersonData +from regula.facesdk.webclient.gen.models.person_fields import PersonFields as PersonFields +from regula.facesdk.webclient.gen.models.person_items import PersonItems as PersonItems +from regula.facesdk.webclient.gen.models.person_to_update_fields import PersonToUpdateFields as PersonToUpdateFields +from regula.facesdk.webclient.gen.models.person_with_images import PersonWithImages as PersonWithImages +from regula.facesdk.webclient.gen.models.person_with_images_data import PersonWithImagesData as PersonWithImagesData +from regula.facesdk.webclient.gen.models.persons_page import PersonsPage as PersonsPage +from regula.facesdk.webclient.gen.models.process_param import ProcessParam as ProcessParam +from regula.facesdk.webclient.gen.models.process_param_attributes import ProcessParamAttributes as ProcessParamAttributes +from regula.facesdk.webclient.gen.models.quality_config import QualityConfig as QualityConfig +from regula.facesdk.webclient.gen.models.quality_detail import QualityDetail as QualityDetail +from regula.facesdk.webclient.gen.models.quality_details_groups import QualityDetailsGroups as QualityDetailsGroups +from regula.facesdk.webclient.gen.models.quality_request import QualityRequest as QualityRequest +from regula.facesdk.webclient.gen.models.recognize_image import RecognizeImage as RecognizeImage +from regula.facesdk.webclient.gen.models.recognize_image_data import RecognizeImageData as RecognizeImageData +from regula.facesdk.webclient.gen.models.resize_options import ResizeOptions as ResizeOptions +from regula.facesdk.webclient.gen.models.search_bad_params import SearchBadParams as SearchBadParams +from regula.facesdk.webclient.gen.models.search_detection import SearchDetection as SearchDetection +from regula.facesdk.webclient.gen.models.search_parameters import SearchParameters as SearchParameters +from regula.facesdk.webclient.gen.models.search_parameters_create_person import SearchParametersCreatePerson as SearchParametersCreatePerson +from regula.facesdk.webclient.gen.models.search_person import SearchPerson as SearchPerson +from regula.facesdk.webclient.gen.models.search_person_data import SearchPersonData as SearchPersonData +from regula.facesdk.webclient.gen.models.search_request import SearchRequest as SearchRequest +from regula.facesdk.webclient.gen.models.search_result import SearchResult as SearchResult +from regula.facesdk.webclient.gen.models.transaction_info import TransactionInfo as TransactionInfo +from regula.facesdk.webclient.gen.models.transaction_labels import TransactionLabels as TransactionLabels +from regula.facesdk.webclient.gen.models.update_group import UpdateGroup as UpdateGroup + +""", + name=__name__, + doc=__doc__, + ) + ) diff --git a/regula/facesdk/webclient/gen/api/__init__.py b/regula/facesdk/webclient/gen/api/__init__.py index 3d25784..11f863f 100644 --- a/regula/facesdk/webclient/gen/api/__init__.py +++ b/regula/facesdk/webclient/gen/api/__init__.py @@ -1,3 +1,30 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from regula.facesdk.webclient.gen.apis import GroupApi +# flake8: noqa + +if __import__("typing").TYPE_CHECKING: + # import apis into api package + from regula.facesdk.webclient.gen.api.group_api import GroupApi + from regula.facesdk.webclient.gen.api.healthcheck_api import HealthcheckApi + from regula.facesdk.webclient.gen.api.liveness20_api import Liveness20Api + from regula.facesdk.webclient.gen.api.match_api import MatchApi + from regula.facesdk.webclient.gen.api.person_api import PersonApi + from regula.facesdk.webclient.gen.api.search_api import SearchApi + +else: + from lazy_imports import LazyModule, as_package, load + + load( + LazyModule( + *as_package(__file__), + """# import apis into api package +from regula.facesdk.webclient.gen.api.group_api import GroupApi +from regula.facesdk.webclient.gen.api.healthcheck_api import HealthcheckApi +from regula.facesdk.webclient.gen.api.liveness20_api import Liveness20Api +from regula.facesdk.webclient.gen.api.match_api import MatchApi +from regula.facesdk.webclient.gen.api.person_api import PersonApi +from regula.facesdk.webclient.gen.api.search_api import SearchApi + +""", + name=__name__, + doc=__doc__, + ) + ) diff --git a/regula/facesdk/webclient/gen/api/diagnostics_api.py b/regula/facesdk/webclient/gen/api/diagnostics_api.py deleted file mode 100644 index 3fe922e..0000000 --- a/regula/facesdk/webclient/gen/api/diagnostics_api.py +++ /dev/null @@ -1,162 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 6.2.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from regula.facesdk.webclient.gen.api_client import ApiClient -from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class DiagnosticsApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def readiness(self, **kwargs): # noqa: E501 - """Checking the license status # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.readiness(async_req=True) - >>> result = thread.get() - - :param x_request_id: Request header label. - :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - kwargs['_return_http_data_only'] = True - return self.readiness_with_http_info(**kwargs) # noqa: E501 - - def readiness_with_http_info(self, **kwargs): # noqa: E501 - """Checking the license status # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.readiness_with_http_info(async_req=True) - >>> result = thread.get() - - :param x_request_id: Request header label. - :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'x_request_id', - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method readiness" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/readiness', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/regula/facesdk/webclient/gen/api/group_api.py b/regula/facesdk/webclient/gen/api/group_api.py index 1ce41a7..15aad3e 100644 --- a/regula/facesdk/webclient/gen/api/group_api.py +++ b/regula/facesdk/webclient/gen/api/group_api.py @@ -1,750 +1,1585 @@ # coding: utf-8 """ - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 Generated by: https://openapi-generator.tech """ - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from regula.facesdk.webclient.gen.api_client import ApiClient -from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class GroupApi(object): +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from uuid import UUID +from regula.facesdk.webclient.gen.models.group import Group +from regula.facesdk.webclient.gen.models.group_page import GroupPage +from regula.facesdk.webclient.gen.models.group_to_create import GroupToCreate +from regula.facesdk.webclient.gen.models.persons_page import PersonsPage +from regula.facesdk.webclient.gen.models.update_group import UpdateGroup + +from regula.facesdk.webclient.gen.api_client import ApiClient, RequestSerialized +from regula.facesdk.webclient.gen.api_response import ApiResponse +from regula.facesdk.webclient.gen.rest import RESTResponseType + + +class GroupApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - def create_group(self, group_to_create, **kwargs): # noqa: E501 - """Create group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_group( + self, + group_to_create: Annotated[GroupToCreate, Field(description="Request body for the group to create.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Group: + """Create group - >>> thread = api.create_group(group_to_create, async_req=True) - >>> result = thread.get() :param group_to_create: Request body for the group to create. (required) :type group_to_create: GroupToCreate :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Group - """ - kwargs['_return_http_data_only'] = True - return self.create_group_with_http_info(group_to_create, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._create_group_serialize( + group_to_create=group_to_create, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Group", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_group_with_http_info( + self, + group_to_create: Annotated[GroupToCreate, Field(description="Request body for the group to create.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Group]: + """Create group + + + :param group_to_create: Request body for the group to create. (required) + :type group_to_create: GroupToCreate + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_group_serialize( + group_to_create=group_to_create, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Group", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def create_group_with_http_info(self, group_to_create, **kwargs): # noqa: E501 - """Create group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_group_without_preload_content( + self, + group_to_create: Annotated[GroupToCreate, Field(description="Request body for the group to create.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create group - >>> thread = api.create_group_with_http_info(group_to_create, async_req=True) - >>> result = thread.get() :param group_to_create: Request body for the group to create. (required) :type group_to_create: GroupToCreate :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Group, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_group_serialize( + group_to_create=group_to_create, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Group", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_group_serialize( + self, + group_to_create, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if group_to_create is not None: + _body_params = group_to_create + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'group_to_create', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_group( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete group + + + :param group_id: Group ID. (required) + :type group_id: str + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_group_serialize( + group_id=group_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_group" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'group_to_create' is set - if self.api_client.client_side_validation and ('group_to_create' not in local_var_params or # noqa: E501 - local_var_params['group_to_create'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `group_to_create` when calling `create_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'group_to_create' in local_var_params: - body_params = local_var_params['group_to_create'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/groups', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Group', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_group(self, group_id, **kwargs): # noqa: E501 - """Delete group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_group(group_id, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_group_with_http_info( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete group + :param group_id: Group ID. (required) :type group_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_group_with_http_info(group_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._delete_group_serialize( + group_id=group_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - def delete_group_with_http_info(self, group_id, **kwargs): # noqa: E501 - """Delete group # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_group_with_http_info(group_id, async_req=True) - >>> result = thread.get() + @validate_call + def delete_group_without_preload_content( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete group + :param group_id: Group ID. (required) :type group_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() + """ # noqa: E501 + + _param = self._delete_group_serialize( + group_id=group_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - all_params = [ - 'group_id', - 'x_request_id', + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_group_serialize( + self, + group_id, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/groups/{groupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_group" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'group_id' is set - if self.api_client.client_side_validation and ('group_id' not in local_var_params or # noqa: E501 - local_var_params['group_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `group_id` when calling `delete_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in local_var_params: - path_params['groupId'] = local_var_params['group_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/groups/{groupId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_all_groups(self, **kwargs): # noqa: E501 - """Get groups # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_all_groups(async_req=True) - >>> result = thread.get() + + + @validate_call + def get_all_groups( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupPage: + """Get groups + + + :param x_request_id: Request header label. + :type x_request_id: str :param page: The page number to get a list of persons or groups. :type page: int :param size: The page size with a list of persons or groups, items. :type size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_all_groups_serialize( + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupPage", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_all_groups_with_http_info( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupPage]: + """Get groups + + :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional + :param page: The page number to get a list of persons or groups. + :type page: int + :param size: The page size with a list of persons or groups, items. + :type size: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GroupPage - """ - kwargs['_return_http_data_only'] = True - return self.get_all_groups_with_http_info(**kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_all_groups_serialize( + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupPage", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def get_all_groups_with_http_info(self, **kwargs): # noqa: E501 - """Get groups # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_all_groups_without_preload_content( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get groups - >>> thread = api.get_all_groups_with_http_info(async_req=True) - >>> result = thread.get() + :param x_request_id: Request header label. + :type x_request_id: str :param page: The page number to get a list of persons or groups. :type page: int :param size: The page size with a list of persons or groups, items. :type size: int - :param x_request_id: Request header label. - :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GroupPage, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() + """ # noqa: E501 + + _param = self._get_all_groups_serialize( + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - all_params = [ - 'page', - 'size', - 'x_request_id', + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupPage", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_all_groups_serialize( + self, + x_request_id, + page, + size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_groups" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'size' in local_var_params and local_var_params['size'] is not None: # noqa: E501 - query_params.append(('size', local_var_params['size'])) # noqa: E501 - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/groups', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GroupPage', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_all_persons_by_group_id(self, group_id, **kwargs): # noqa: E501 - """Get group persons # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_all_persons_by_group_id(group_id, async_req=True) - >>> result = thread.get() + + + + @validate_call + def get_all_persons_by_group_id( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PersonsPage: + """Get group persons + :param group_id: Group ID. (required) :type group_id: str + :param x_request_id: Request header label. + :type x_request_id: str :param page: The page number to get a list of persons or groups. :type page: int :param size: The page size with a list of persons or groups, items. :type size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_all_persons_by_group_id_serialize( + group_id=group_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PersonsPage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_all_persons_by_group_id_with_http_info( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PersonsPage]: + """Get group persons + + + :param group_id: Group ID. (required) + :type group_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional + :param page: The page number to get a list of persons or groups. + :type page: int + :param size: The page size with a list of persons or groups, items. + :type size: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PersonsPage - """ - kwargs['_return_http_data_only'] = True - return self.get_all_persons_by_group_id_with_http_info(group_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_all_persons_by_group_id_serialize( + group_id=group_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PersonsPage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def get_all_persons_by_group_id_with_http_info(self, group_id, **kwargs): # noqa: E501 - """Get group persons # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_all_persons_by_group_id_without_preload_content( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get group persons - >>> thread = api.get_all_persons_by_group_id_with_http_info(group_id, async_req=True) - >>> result = thread.get() :param group_id: Group ID. (required) :type group_id: str + :param x_request_id: Request header label. + :type x_request_id: str :param page: The page number to get a list of persons or groups. :type page: int :param size: The page size with a list of persons or groups, items. :type size: int - :param x_request_id: Request header label. - :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PersonsPage, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'group_id', - 'page', - 'size', - 'x_request_id', + """ # noqa: E501 + + _param = self._get_all_persons_by_group_id_serialize( + group_id=group_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PersonsPage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_all_persons_by_group_id_serialize( + self, + group_id, + x_request_id, + page, + size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/groups/{groupId}/persons', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_group( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Group: + """Get group + + + :param group_id: Group ID. (required) + :type group_id: str + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_persons_by_group_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'group_id' is set - if self.api_client.client_side_validation and ('group_id' not in local_var_params or # noqa: E501 - local_var_params['group_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `group_id` when calling `get_all_persons_by_group_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in local_var_params: - path_params['groupId'] = local_var_params['group_id'] # noqa: E501 - - query_params = [] - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'size' in local_var_params and local_var_params['size'] is not None: # noqa: E501 - query_params.append(('size', local_var_params['size'])) # noqa: E501 - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/groups/{groupId}/persons', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PersonsPage', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_group(self, group_id, **kwargs): # noqa: E501 - """Get group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_group(group_id, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Group", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_group_with_http_info( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Group]: + """Get group + :param group_id: Group ID. (required) :type group_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Group - """ - kwargs['_return_http_data_only'] = True - return self.get_group_with_http_info(group_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - def get_group_with_http_info(self, group_id, **kwargs): # noqa: E501 - """Get group # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '200': "Group", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_group_with_http_info(group_id, async_req=True) - >>> result = thread.get() + @validate_call + def get_group_without_preload_content( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get group + :param group_id: Group ID. (required) :type group_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Group, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - all_params = [ - 'group_id', - 'x_request_id', + _response_types_map: Dict[str, Optional[str]] = { + '200': "Group", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_group_serialize( + self, + group_id, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/groups/{groupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_group( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + group_to_create: Annotated[GroupToCreate, Field(description="Request body for the group to update.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update group + + + :param group_id: Group ID. (required) + :type group_id: str + :param group_to_create: Request body for the group to update. (required) + :type group_to_create: GroupToCreate + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_group_serialize( + group_id=group_id, + group_to_create=group_to_create, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_group" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'group_id' is set - if self.api_client.client_side_validation and ('group_id' not in local_var_params or # noqa: E501 - local_var_params['group_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `group_id` when calling `get_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in local_var_params: - path_params['groupId'] = local_var_params['group_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/groups/{groupId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Group', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_group(self, group_id, group_to_create, **kwargs): # noqa: E501 - """Update group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_group(group_id, group_to_create, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_group_with_http_info( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + group_to_create: Annotated[GroupToCreate, Field(description="Request body for the group to update.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update group + :param group_id: Group ID. (required) :type group_id: str @@ -752,32 +1587,75 @@ def update_group(self, group_id, group_to_create, **kwargs): # noqa: E501 :type group_to_create: GroupToCreate :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_group_with_http_info(group_id, group_to_create, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._update_group_serialize( + group_id=group_id, + group_to_create=group_to_create, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def update_group_with_http_info(self, group_id, group_to_create, **kwargs): # noqa: E501 - """Update group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_group_without_preload_content( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + group_to_create: Annotated[GroupToCreate, Field(description="Request body for the group to update.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update group - >>> thread = api.update_group_with_http_info(group_id, group_to_create, async_req=True) - >>> result = thread.get() :param group_id: Group ID. (required) :type group_id: str @@ -785,117 +1663,229 @@ def update_group_with_http_info(self, group_id, group_to_create, **kwargs): # n :type group_to_create: GroupToCreate :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_group_serialize( + group_id=group_id, + group_to_create=group_to_create, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_group_serialize( + self, + group_id, + group_to_create, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if group_to_create is not None: + _body_params = group_to_create + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'group_id', - 'group_to_create', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/groups/{groupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_persons_in_group( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + update_group: Annotated[UpdateGroup, Field(description="Request body for person IDs to add or remove.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Add/remove persons to group + + + :param group_id: Group ID. (required) + :type group_id: str + :param update_group: Request body for person IDs to add or remove. (required) + :type update_group: UpdateGroup + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_persons_in_group_serialize( + group_id=group_id, + update_group=update_group, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_group" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'group_id' is set - if self.api_client.client_side_validation and ('group_id' not in local_var_params or # noqa: E501 - local_var_params['group_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `group_id` when calling `update_group`") # noqa: E501 - # verify the required parameter 'group_to_create' is set - if self.api_client.client_side_validation and ('group_to_create' not in local_var_params or # noqa: E501 - local_var_params['group_to_create'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `group_to_create` when calling `update_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in local_var_params: - path_params['groupId'] = local_var_params['group_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'group_to_create' in local_var_params: - body_params = local_var_params['group_to_create'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/groups/{groupId}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_persons_in_group(self, group_id, update_group, **kwargs): # noqa: E501 - """Add/remove persons to group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_persons_in_group(group_id, update_group, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_persons_in_group_with_http_info( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + update_group: Annotated[UpdateGroup, Field(description="Request body for person IDs to add or remove.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Add/remove persons to group + :param group_id: Group ID. (required) :type group_id: str @@ -903,32 +1893,75 @@ def update_persons_in_group(self, group_id, update_group, **kwargs): # noqa: E5 :type update_group: UpdateGroup :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_persons_in_group_with_http_info(group_id, update_group, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._update_persons_in_group_serialize( + group_id=group_id, + update_group=update_group, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def update_persons_in_group_with_http_info(self, group_id, update_group, **kwargs): # noqa: E501 - """Add/remove persons to group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_persons_in_group_without_preload_content( + self, + group_id: Annotated[UUID, Field(description="Group ID.")], + update_group: Annotated[UpdateGroup, Field(description="Request body for person IDs to add or remove.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add/remove persons to group - >>> thread = api.update_persons_in_group_with_http_info(group_id, update_group, async_req=True) - >>> result = thread.get() :param group_id: Group ID. (required) :type group_id: str @@ -936,105 +1969,127 @@ def update_persons_in_group_with_http_info(self, group_id, update_group, **kwarg :type update_group: UpdateGroup :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_persons_in_group_serialize( + group_id=group_id, + update_group=update_group, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_persons_in_group_serialize( + self, + group_id, + update_group, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if update_group is not None: + _body_params = update_group + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'group_id', - 'update_group', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/groups/{groupId}/persons', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_persons_in_group" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'group_id' is set - if self.api_client.client_side_validation and ('group_id' not in local_var_params or # noqa: E501 - local_var_params['group_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `group_id` when calling `update_persons_in_group`") # noqa: E501 - # verify the required parameter 'update_group' is set - if self.api_client.client_side_validation and ('update_group' not in local_var_params or # noqa: E501 - local_var_params['update_group'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `update_group` when calling `update_persons_in_group`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in local_var_params: - path_params['groupId'] = local_var_params['group_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'update_group' in local_var_params: - body_params = local_var_params['update_group'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/groups/{groupId}/persons', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) + diff --git a/regula/facesdk/webclient/gen/api/healthcheck_api.py b/regula/facesdk/webclient/gen/api/healthcheck_api.py index c65a6f3..7a913c6 100644 --- a/regula/facesdk/webclient/gen/api/healthcheck_api.py +++ b/regula/facesdk/webclient/gen/api/healthcheck_api.py @@ -1,287 +1,547 @@ # coding: utf-8 """ - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 Generated by: https://openapi-generator.tech """ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from regula.facesdk.webclient.gen.models.device_info import DeviceInfo -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from regula.facesdk.webclient.gen.api_client import ApiClient -from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from regula.facesdk.webclient.gen.api_client import ApiClient, RequestSerialized +from regula.facesdk.webclient.gen.api_response import ApiResponse +from regula.facesdk.webclient.gen.rest import RESTResponseType -class HealthcheckApi(object): +class HealthcheckApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - def healthz(self, **kwargs): # noqa: E501 - """Server healthcheck # noqa: E501 - The `/api/healthz` endpoint performs a server health check, providing details such as the application name, license ID, serial number, validity, and product version.

Comprehensive information about service diagnostics is available on the [Monitoring page](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/monitoring/). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def healthz( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeviceInfo: + """Server healthcheck - >>> thread = api.healthz(async_req=True) - >>> result = thread.get() + The `/api/healthz` endpoint performs a server health check, providing details such as the application name, license ID, serial number, validity, and product version.

Comprehensive information about service diagnostics is available on the [Monitoring page](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/monitoring/). :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: DeviceInfo - """ - kwargs['_return_http_data_only'] = True - return self.healthz_with_http_info(**kwargs) # noqa: E501 - - def healthz_with_http_info(self, **kwargs): # noqa: E501 - """Server healthcheck # noqa: E501 + """ # noqa: E501 + + _param = self._healthz_serialize( + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - The `/api/healthz` endpoint performs a server health check, providing details such as the application name, license ID, serial number, validity, and product version.

Comprehensive information about service diagnostics is available on the [Monitoring page](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/monitoring/). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def healthz_with_http_info( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeviceInfo]: + """Server healthcheck - >>> thread = api.healthz_with_http_info(async_req=True) - >>> result = thread.get() + The `/api/healthz` endpoint performs a server health check, providing details such as the application name, license ID, serial number, validity, and product version.

Comprehensive information about service diagnostics is available on the [Monitoring page](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/monitoring/). :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(DeviceInfo, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._healthz_serialize( + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def healthz_without_preload_content( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Server healthcheck + + The `/api/healthz` endpoint performs a server health check, providing details such as the application name, license ID, serial number, validity, and product version.

Comprehensive information about service diagnostics is available on the [Monitoring page](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/monitoring/). - local_var_params = locals() + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._healthz_serialize( + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - all_params = [ - 'x_request_id', + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _healthz_serialize( + self, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/healthz', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def readyz( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """License healthcheck + + The `/api/readyz` endpoint checks the license's health to determine if the application is ready for operation. It validates the license and returns a response indicating whether the license is valid (`200`) or invalid (`400`). + + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._readyz_serialize( + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method healthz" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/healthz', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='DeviceInfo', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def readyz(self, **kwargs): # noqa: E501 - """License healthcheck # noqa: E501 - - The `/api/readyz` endpoint checks the license's health to determine if the application is ready for operation. It validates the license and returns a response indicating whether the license is valid (`200`) or invalid (`400`). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.readyz(async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def readyz_with_http_info( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """License healthcheck + + The `/api/readyz` endpoint checks the license's health to determine if the application is ready for operation. It validates the license and returns a response indicating whether the license is valid (`200`) or invalid (`400`). :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.readyz_with_http_info(**kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._readyz_serialize( + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - def readyz_with_http_info(self, **kwargs): # noqa: E501 - """License healthcheck # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - The `/api/readyz` endpoint checks the license's health to determine if the application is ready for operation. It validates the license and returns a response indicating whether the license is valid (`200`) or invalid (`400`). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.readyz_with_http_info(async_req=True) - >>> result = thread.get() + @validate_call + def readyz_without_preload_content( + self, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """License healthcheck + + The `/api/readyz` endpoint checks the license's health to determine if the application is ready for operation. It validates the license and returns a response indicating whether the license is valid (`200`) or invalid (`400`). :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._readyz_serialize( + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _readyz_serialize( + self, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - local_var_params = locals() + _host = None - all_params = [ - 'x_request_id', + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/readyz', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method readyz" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/readyz', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) + diff --git a/regula/facesdk/webclient/gen/api/liveness20_api.py b/regula/facesdk/webclient/gen/api/liveness20_api.py new file mode 100644 index 0000000..88af04f --- /dev/null +++ b/regula/facesdk/webclient/gen/api/liveness20_api.py @@ -0,0 +1,565 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from uuid import UUID +from regula.facesdk.webclient.gen.models.transaction_info import TransactionInfo + +from regula.facesdk.webclient.gen.api_client import ApiClient, RequestSerialized +from regula.facesdk.webclient.gen.api_response import ApiResponse +from regula.facesdk.webclient.gen.rest import RESTResponseType + + +class Liveness20Api: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def delete_liveness_transaction( + self, + transaction_id: Annotated[UUID, Field(description="ID of the current liveness transaction.")], + tag: Annotated[StrictStr, Field(description="A unique tag associated with a liveness transaction session. Used to identify and delete the corresponding transaction.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete liveness transaction + + This endpoint deletes a liveness transaction based on either the specified `tag` or `transactionId`. At least one of the parameters must be provided for the operation to be valid. + + :param transaction_id: ID of the current liveness transaction. (required) + :type transaction_id: str + :param tag: A unique tag associated with a liveness transaction session. Used to identify and delete the corresponding transaction. (required) + :type tag: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_liveness_transaction_serialize( + transaction_id=transaction_id, + tag=tag, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_liveness_transaction_with_http_info( + self, + transaction_id: Annotated[UUID, Field(description="ID of the current liveness transaction.")], + tag: Annotated[StrictStr, Field(description="A unique tag associated with a liveness transaction session. Used to identify and delete the corresponding transaction.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete liveness transaction + + This endpoint deletes a liveness transaction based on either the specified `tag` or `transactionId`. At least one of the parameters must be provided for the operation to be valid. + + :param transaction_id: ID of the current liveness transaction. (required) + :type transaction_id: str + :param tag: A unique tag associated with a liveness transaction session. Used to identify and delete the corresponding transaction. (required) + :type tag: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_liveness_transaction_serialize( + transaction_id=transaction_id, + tag=tag, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_liveness_transaction_without_preload_content( + self, + transaction_id: Annotated[UUID, Field(description="ID of the current liveness transaction.")], + tag: Annotated[StrictStr, Field(description="A unique tag associated with a liveness transaction session. Used to identify and delete the corresponding transaction.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete liveness transaction + + This endpoint deletes a liveness transaction based on either the specified `tag` or `transactionId`. At least one of the parameters must be provided for the operation to be valid. + + :param transaction_id: ID of the current liveness transaction. (required) + :type transaction_id: str + :param tag: A unique tag associated with a liveness transaction session. Used to identify and delete the corresponding transaction. (required) + :type tag: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_liveness_transaction_serialize( + transaction_id=transaction_id, + tag=tag, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_liveness_transaction_serialize( + self, + transaction_id, + tag, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if transaction_id is not None: + + _query_params.append(('transactionId', transaction_id)) + + if tag is not None: + + _query_params.append(('tag', tag)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v2/liveness', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_liveness_transaction_info( + self, + transaction_id: Annotated[UUID, Field(description="ID of the current liveness transaction.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TransactionInfo: + """liveness check + + To verify the presence of a real person in front of a camera, use the GET `/api/v2/liveness` endpoint. When starting, you can specify `tag` which all attempts to read liveness will be bound to. If left unspecified, the application automatically generates one. The calling application returns `tag` and `transactionId`. One session may include many transactions, and from a transaction ID it is clear which session it belongs to. When specifying `tag`, note that only Latin uppercase and lowercase letters, digits, and symbols `-` and `_` are allowed. The maximum supported number of characters is 127. The metadata (device model, screen data, frame size, app ID and version, OS version, platform, SDK version, etc.), a person's selfie and video of the liveness detection session are stored on the backend at: `faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId` By default, liveness checks operate with eventual consistency. This means that when you submit a request and receive a response, the associated data (like the selfie and session video) may be saved after the response is sent. If this doesn't meet your requirements, you can switch to strong consistency; refer to the [Architecture page](https://docs.regulaforensics.com/develop/face-sdk/overview/architecture/#consistency-models) for details. To access the liveness transaction data, use GET `/api/v2/liveness?transactionId={transactionId}`. + + :param transaction_id: ID of the current liveness transaction. (required) + :type transaction_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_liveness_transaction_info_serialize( + transaction_id=transaction_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransactionInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_liveness_transaction_info_with_http_info( + self, + transaction_id: Annotated[UUID, Field(description="ID of the current liveness transaction.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TransactionInfo]: + """liveness check + + To verify the presence of a real person in front of a camera, use the GET `/api/v2/liveness` endpoint. When starting, you can specify `tag` which all attempts to read liveness will be bound to. If left unspecified, the application automatically generates one. The calling application returns `tag` and `transactionId`. One session may include many transactions, and from a transaction ID it is clear which session it belongs to. When specifying `tag`, note that only Latin uppercase and lowercase letters, digits, and symbols `-` and `_` are allowed. The maximum supported number of characters is 127. The metadata (device model, screen data, frame size, app ID and version, OS version, platform, SDK version, etc.), a person's selfie and video of the liveness detection session are stored on the backend at: `faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId` By default, liveness checks operate with eventual consistency. This means that when you submit a request and receive a response, the associated data (like the selfie and session video) may be saved after the response is sent. If this doesn't meet your requirements, you can switch to strong consistency; refer to the [Architecture page](https://docs.regulaforensics.com/develop/face-sdk/overview/architecture/#consistency-models) for details. To access the liveness transaction data, use GET `/api/v2/liveness?transactionId={transactionId}`. + + :param transaction_id: ID of the current liveness transaction. (required) + :type transaction_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_liveness_transaction_info_serialize( + transaction_id=transaction_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransactionInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_liveness_transaction_info_without_preload_content( + self, + transaction_id: Annotated[UUID, Field(description="ID of the current liveness transaction.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """liveness check + + To verify the presence of a real person in front of a camera, use the GET `/api/v2/liveness` endpoint. When starting, you can specify `tag` which all attempts to read liveness will be bound to. If left unspecified, the application automatically generates one. The calling application returns `tag` and `transactionId`. One session may include many transactions, and from a transaction ID it is clear which session it belongs to. When specifying `tag`, note that only Latin uppercase and lowercase letters, digits, and symbols `-` and `_` are allowed. The maximum supported number of characters is 127. The metadata (device model, screen data, frame size, app ID and version, OS version, platform, SDK version, etc.), a person's selfie and video of the liveness detection session are stored on the backend at: `faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId` By default, liveness checks operate with eventual consistency. This means that when you submit a request and receive a response, the associated data (like the selfie and session video) may be saved after the response is sent. If this doesn't meet your requirements, you can switch to strong consistency; refer to the [Architecture page](https://docs.regulaforensics.com/develop/face-sdk/overview/architecture/#consistency-models) for details. To access the liveness transaction data, use GET `/api/v2/liveness?transactionId={transactionId}`. + + :param transaction_id: ID of the current liveness transaction. (required) + :type transaction_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_liveness_transaction_info_serialize( + transaction_id=transaction_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransactionInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_liveness_transaction_info_serialize( + self, + transaction_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if transaction_id is not None: + + _query_params.append(('transactionId', transaction_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v2/liveness', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/regula/facesdk/webclient/gen/api/liveness_2_0_api.py b/regula/facesdk/webclient/gen/api/liveness_2_0_api.py deleted file mode 100644 index b053074..0000000 --- a/regula/facesdk/webclient/gen/api/liveness_2_0_api.py +++ /dev/null @@ -1,306 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from regula.facesdk.webclient.gen.api_client import ApiClient -from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class Liveness20Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_liveness_transaction(self, transaction_id, tag, **kwargs): # noqa: E501 - """delete liveness transaction # noqa: E501 - - This endpoint deletes a liveness transaction based on either the specified `tag` or `transactionId`. At least one of the parameters must be provided for the operation to be valid. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_liveness_transaction(transaction_id, tag, async_req=True) - >>> result = thread.get() - - :param transaction_id: ID of the current liveness transaction. (required) - :type transaction_id: str - :param tag: A unique tag associated with a liveness transaction session. Used to identify and delete the corresponding transaction. (required) - :type tag: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_liveness_transaction_with_http_info(transaction_id, tag, **kwargs) # noqa: E501 - - def delete_liveness_transaction_with_http_info(self, transaction_id, tag, **kwargs): # noqa: E501 - """delete liveness transaction # noqa: E501 - - This endpoint deletes a liveness transaction based on either the specified `tag` or `transactionId`. At least one of the parameters must be provided for the operation to be valid. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_liveness_transaction_with_http_info(transaction_id, tag, async_req=True) - >>> result = thread.get() - - :param transaction_id: ID of the current liveness transaction. (required) - :type transaction_id: str - :param tag: A unique tag associated with a liveness transaction session. Used to identify and delete the corresponding transaction. (required) - :type tag: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() - - all_params = [ - 'transaction_id', - 'tag', - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_liveness_transaction" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'transaction_id' is set - if self.api_client.client_side_validation and ('transaction_id' not in local_var_params or # noqa: E501 - local_var_params['transaction_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `transaction_id` when calling `delete_liveness_transaction`") # noqa: E501 - # verify the required parameter 'tag' is set - if self.api_client.client_side_validation and ('tag' not in local_var_params or # noqa: E501 - local_var_params['tag'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `tag` when calling `delete_liveness_transaction`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'transaction_id' in local_var_params and local_var_params['transaction_id'] is not None: # noqa: E501 - query_params.append(('transactionId', local_var_params['transaction_id'])) # noqa: E501 - if 'tag' in local_var_params and local_var_params['tag'] is not None: # noqa: E501 - query_params.append(('tag', local_var_params['tag'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/v2/liveness', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_liveness_transaction_info(self, transaction_id, **kwargs): # noqa: E501 - """liveness check # noqa: E501 - - To verify the presence of a real person in front of a camera, use the GET `/api/v2/liveness` endpoint. When starting, you can specify `tag` which all attempts to read liveness will be bound to. If left unspecified, the application automatically generates one. The calling application returns `tag` and `transactionId`. One session may include many transactions, and from a transaction ID it is clear which session it belongs to. When specifying `tag`, note that only Latin uppercase and lowercase letters, digits, and symbols `-` and `_` are allowed. The maximum supported number of characters is 127. The metadata (device model, screen data, frame size, app ID and version, OS version, platform, SDK version, etc.), a person's selfie and video of the liveness detection session are stored on the backend at: `faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId` By default, liveness checks operate with eventual consistency. This means that when you submit a request and receive a response, the associated data (like the selfie and session video) may be saved after the response is sent. If this doesn't meet your requirements, you can switch to strong consistency; refer to the [Architecture page](https://docs.regulaforensics.com/develop/face-sdk/overview/architecture/#consistency-models) for details. To access the liveness transaction data, use GET `/api/v2/liveness?transactionId={transactionId}`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_liveness_transaction_info(transaction_id, async_req=True) - >>> result = thread.get() - - :param transaction_id: ID of the current liveness transaction. (required) - :type transaction_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: TransactionInfo - """ - kwargs['_return_http_data_only'] = True - return self.get_liveness_transaction_info_with_http_info(transaction_id, **kwargs) # noqa: E501 - - def get_liveness_transaction_info_with_http_info(self, transaction_id, **kwargs): # noqa: E501 - """liveness check # noqa: E501 - - To verify the presence of a real person in front of a camera, use the GET `/api/v2/liveness` endpoint. When starting, you can specify `tag` which all attempts to read liveness will be bound to. If left unspecified, the application automatically generates one. The calling application returns `tag` and `transactionId`. One session may include many transactions, and from a transaction ID it is clear which session it belongs to. When specifying `tag`, note that only Latin uppercase and lowercase letters, digits, and symbols `-` and `_` are allowed. The maximum supported number of characters is 127. The metadata (device model, screen data, frame size, app ID and version, OS version, platform, SDK version, etc.), a person's selfie and video of the liveness detection session are stored on the backend at: `faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId` By default, liveness checks operate with eventual consistency. This means that when you submit a request and receive a response, the associated data (like the selfie and session video) may be saved after the response is sent. If this doesn't meet your requirements, you can switch to strong consistency; refer to the [Architecture page](https://docs.regulaforensics.com/develop/face-sdk/overview/architecture/#consistency-models) for details. To access the liveness transaction data, use GET `/api/v2/liveness?transactionId={transactionId}`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_liveness_transaction_info_with_http_info(transaction_id, async_req=True) - >>> result = thread.get() - - :param transaction_id: ID of the current liveness transaction. (required) - :type transaction_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(TransactionInfo, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'transaction_id', - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_liveness_transaction_info" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'transaction_id' is set - if self.api_client.client_side_validation and ('transaction_id' not in local_var_params or # noqa: E501 - local_var_params['transaction_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `transaction_id` when calling `get_liveness_transaction_info`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'transaction_id' in local_var_params and local_var_params['transaction_id'] is not None: # noqa: E501 - query_params.append(('transactionId', local_var_params['transaction_id'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/v2/liveness', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TransactionInfo', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/regula/facesdk/webclient/gen/api/liveness_api.py b/regula/facesdk/webclient/gen/api/liveness_api.py deleted file mode 100644 index 601f6f1..0000000 --- a/regula/facesdk/webclient/gen/api/liveness_api.py +++ /dev/null @@ -1,424 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - Regula FaceSDK Web API # Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 4.1.3 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from regula.facesdk.webclient.gen.api_client import ApiClient -from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class LivenessApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def liveness_metadata(self, error_unknown, **kwargs): # noqa: E501 - """Liveness 2.0 metadata # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.liveness_metadata(error_unknown, async_req=True) - >>> result = thread.get() - - :param error_unknown: ID of the current liveness transaction. (required) - :type error_unknown: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - kwargs['_return_http_data_only'] = True - return self.liveness_metadata_with_http_info(error_unknown, **kwargs) # noqa: E501 - - def liveness_metadata_with_http_info(self, error_unknown, **kwargs): # noqa: E501 - """Liveness 2.0 metadata # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.liveness_metadata_with_http_info(error_unknown, async_req=True) - >>> result = thread.get() - - :param error_unknown: ID of the current liveness transaction. (required) - :type error_unknown: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'error_unknown' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method liveness_metadata" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'error_unknown' is set - if self.api_client.client_side_validation and ('error_unknown' not in local_var_params or # noqa: E501 - local_var_params['error_unknown'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `error_unknown` when calling `liveness_metadata`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'error_unknown' in local_var_params and local_var_params['error_unknown'] is not None: # noqa: E501 - query_params.append(('', local_var_params['error_unknown'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json''application/octet-stream']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/v2/liveness/metadata', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def liveness_portrait(self, error_unknown, **kwargs): # noqa: E501 - """Liveness 2.0 portrait # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.liveness_portrait(error_unknown, async_req=True) - >>> result = thread.get() - - :param error_unknown: ID of the current liveness transaction. (required) - :type error_unknown: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: file_type - """ - kwargs['_return_http_data_only'] = True - return self.liveness_portrait_with_http_info(error_unknown, **kwargs) # noqa: E501 - - def liveness_portrait_with_http_info(self, error_unknown, **kwargs): # noqa: E501 - """Liveness 2.0 portrait # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.liveness_portrait_with_http_info(error_unknown, async_req=True) - >>> result = thread.get() - - :param error_unknown: ID of the current liveness transaction. (required) - :type error_unknown: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(file_type, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'error_unknown' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method liveness_portrait" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'error_unknown' is set - if self.api_client.client_side_validation and ('error_unknown' not in local_var_params or # noqa: E501 - local_var_params['error_unknown'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `error_unknown` when calling `liveness_portrait`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'error_unknown' in local_var_params and local_var_params['error_unknown'] is not None: # noqa: E501 - query_params.append(('', local_var_params['error_unknown'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/v2/liveness/portrait', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='file_type', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def liveness_video(self, error_unknown, **kwargs): # noqa: E501 - """Liveness 2.0 video # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.liveness_video(error_unknown, async_req=True) - >>> result = thread.get() - - :param error_unknown: ID of the current liveness transaction. (required) - :type error_unknown: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: file_type - """ - kwargs['_return_http_data_only'] = True - return self.liveness_video_with_http_info(error_unknown, **kwargs) # noqa: E501 - - def liveness_video_with_http_info(self, error_unknown, **kwargs): # noqa: E501 - """Liveness 2.0 video # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.liveness_video_with_http_info(error_unknown, async_req=True) - >>> result = thread.get() - - :param error_unknown: ID of the current liveness transaction. (required) - :type error_unknown: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(file_type, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'error_unknown' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method liveness_video" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'error_unknown' is set - if self.api_client.client_side_validation and ('error_unknown' not in local_var_params or # noqa: E501 - local_var_params['error_unknown'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `error_unknown` when calling `liveness_video`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'error_unknown' in local_var_params and local_var_params['error_unknown'] is not None: # noqa: E501 - query_params.append(('', local_var_params['error_unknown'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/v2/liveness/video', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='file_type', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) diff --git a/regula/facesdk/webclient/gen/api/match_api.py b/regula/facesdk/webclient/gen/api/match_api.py index 46617d4..d6ec826 100644 --- a/regula/facesdk/webclient/gen/api/match_api.py +++ b/regula/facesdk/webclient/gen/api/match_api.py @@ -1,463 +1,909 @@ # coding: utf-8 """ - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 Generated by: https://openapi-generator.tech """ - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from regula.facesdk.webclient.gen.api_client import ApiClient -from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class MatchApi(object): +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from regula.facesdk.webclient.gen.models.detect_request import DetectRequest +from regula.facesdk.webclient.gen.models.detect_response import DetectResponse +from regula.facesdk.webclient.gen.models.match_and_search_request import MatchAndSearchRequest +from regula.facesdk.webclient.gen.models.match_and_search_response import MatchAndSearchResponse +from regula.facesdk.webclient.gen.models.match_request import MatchRequest +from regula.facesdk.webclient.gen.models.match_response import MatchResponse + +from regula.facesdk.webclient.gen.api_client import ApiClient, RequestSerialized +from regula.facesdk.webclient.gen.api_response import ApiResponse +from regula.facesdk.webclient.gen.rest import RESTResponseType + + +class MatchApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - def detect(self, detect_request, **kwargs): # noqa: E501 - """detect and check quality # noqa: E501 - Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you additionally: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. For the list of assessed characteristics, see the [Face Image Quality Characteristics page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. For the list of assessed attributes, see the [Attributes List page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and you will need to add all the necessary parameters to each request. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones. For detailed information about scenarios, refer to the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def detect( + self, + detect_request: DetectRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DetectResponse: + """detect and check quality + + Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you additionally: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. For the list of assessed characteristics, see the [Face Image Quality Characteristics page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. For the list of assessed attributes, see the [Attributes List page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and you will need to add all the necessary parameters to each request. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones. For detailed information about scenarios, refer to the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/). + + :param detect_request: (required) + :type detect_request: DetectRequest + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._detect_serialize( + detect_request=detect_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DetectResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def detect_with_http_info( + self, + detect_request: DetectRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DetectResponse]: + """detect and check quality - >>> thread = api.detect(detect_request, async_req=True) - >>> result = thread.get() + Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you additionally: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. For the list of assessed characteristics, see the [Face Image Quality Characteristics page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. For the list of assessed attributes, see the [Attributes List page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and you will need to add all the necessary parameters to each request. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones. For detailed information about scenarios, refer to the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/). :param detect_request: (required) :type detect_request: DetectRequest :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: DetectResponse - """ - kwargs['_return_http_data_only'] = True - return self.detect_with_http_info(detect_request, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._detect_serialize( + detect_request=detect_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DetectResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def detect_with_http_info(self, detect_request, **kwargs): # noqa: E501 - """detect and check quality # noqa: E501 - Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you additionally: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. For the list of assessed characteristics, see the [Face Image Quality Characteristics page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. For the list of assessed attributes, see the [Attributes List page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and you will need to add all the necessary parameters to each request. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones. For detailed information about scenarios, refer to the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def detect_without_preload_content( + self, + detect_request: DetectRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """detect and check quality - >>> thread = api.detect_with_http_info(detect_request, async_req=True) - >>> result = thread.get() + Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you additionally: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. For the list of assessed characteristics, see the [Face Image Quality Characteristics page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. For the list of assessed attributes, see the [Attributes List page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and you will need to add all the necessary parameters to each request. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones. For detailed information about scenarios, refer to the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/). :param detect_request: (required) :type detect_request: DetectRequest :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(DetectResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._detect_serialize( + detect_request=detect_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "DetectResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _detect_serialize( + self, + detect_request, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if detect_request is not None: + _body_params = detect_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'detect_request', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/detect', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def match( + self, + match_request: MatchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MatchResponse: + """compare faces (1:1) + + To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter.

The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1` + + :param match_request: (required) + :type match_request: MatchRequest + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._match_serialize( + match_request=match_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method detect" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'detect_request' is set - if self.api_client.client_side_validation and ('detect_request' not in local_var_params or # noqa: E501 - local_var_params['detect_request'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `detect_request` when calling `detect`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'detect_request' in local_var_params: - body_params = local_var_params['detect_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/detect', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='DetectResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def match(self, match_request, **kwargs): # noqa: E501 - """compare faces (1:1) # noqa: E501 - - To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter.

The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.match(match_request, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '200': "MatchResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def match_with_http_info( + self, + match_request: MatchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MatchResponse]: + """compare faces (1:1) + + To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter.

The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1` :param match_request: (required) :type match_request: MatchRequest :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MatchResponse - """ - kwargs['_return_http_data_only'] = True - return self.match_with_http_info(match_request, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._match_serialize( + match_request=match_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - def match_with_http_info(self, match_request, **kwargs): # noqa: E501 - """compare faces (1:1) # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '200': "MatchResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter.

The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.match_with_http_info(match_request, async_req=True) - >>> result = thread.get() + @validate_call + def match_without_preload_content( + self, + match_request: MatchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """compare faces (1:1) + + To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter.

The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1` :param match_request: (required) :type match_request: MatchRequest :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MatchResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._match_serialize( + match_request=match_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "MatchResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _match_serialize( + self, + match_request, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if match_request is not None: + _body_params = match_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'match_request', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/match', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def match_and_search( + self, + match_and_search_request: MatchAndSearchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MatchAndSearchResponse: + """match and search (1:1 + 1:N) + + To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. At least two photos are required. If, after processing two or more photos, only one face is detected across them, the match step is skipped, and only the search is carried out. + + :param match_and_search_request: (required) + :type match_and_search_request: MatchAndSearchRequest + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._match_and_search_serialize( + match_and_search_request=match_and_search_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method match" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'match_request' is set - if self.api_client.client_side_validation and ('match_request' not in local_var_params or # noqa: E501 - local_var_params['match_request'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `match_request` when calling `match`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'match_request' in local_var_params: - body_params = local_var_params['match_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/match', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MatchResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def match_and_search(self, match_and_search_request, **kwargs): # noqa: E501 - """match and search (1:1 + 1:N) # noqa: E501 - - To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. At least two photos are required. If, after processing two or more photos, only one face is detected across them, the match step is skipped, and only the search is carried out. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.match_and_search(match_and_search_request, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '200': "MatchAndSearchResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def match_and_search_with_http_info( + self, + match_and_search_request: MatchAndSearchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MatchAndSearchResponse]: + """match and search (1:1 + 1:N) + + To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. At least two photos are required. If, after processing two or more photos, only one face is detected across them, the match step is skipped, and only the search is carried out. :param match_and_search_request: (required) :type match_and_search_request: MatchAndSearchRequest :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MatchAndSearchResponse - """ - kwargs['_return_http_data_only'] = True - return self.match_and_search_with_http_info(match_and_search_request, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._match_and_search_serialize( + match_and_search_request=match_and_search_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - def match_and_search_with_http_info(self, match_and_search_request, **kwargs): # noqa: E501 - """match and search (1:1 + 1:N) # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '200': "MatchAndSearchResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. At least two photos are required. If, after processing two or more photos, only one face is detected across them, the match step is skipped, and only the search is carried out. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.match_and_search_with_http_info(match_and_search_request, async_req=True) - >>> result = thread.get() + @validate_call + def match_and_search_without_preload_content( + self, + match_and_search_request: MatchAndSearchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """match and search (1:1 + 1:N) + + To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. At least two photos are required. If, after processing two or more photos, only one face is detected across them, the match step is skipped, and only the search is carried out. :param match_and_search_request: (required) :type match_and_search_request: MatchAndSearchRequest :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MatchAndSearchResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._match_and_search_serialize( + match_and_search_request=match_and_search_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "MatchAndSearchResponse", + '403': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _match_and_search_serialize( + self, + match_and_search_request, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if match_and_search_request is not None: + _body_params = match_and_search_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'match_and_search_request', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/match_and_search', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method match_and_search" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'match_and_search_request' is set - if self.api_client.client_side_validation and ('match_and_search_request' not in local_var_params or # noqa: E501 - local_var_params['match_and_search_request'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `match_and_search_request` when calling `match_and_search`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'match_and_search_request' in local_var_params: - body_params = local_var_params['match_and_search_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/match_and_search', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MatchAndSearchResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) + diff --git a/regula/facesdk/webclient/gen/api/person_api.py b/regula/facesdk/webclient/gen/api/person_api.py index 119e582..94d08ae 100644 --- a/regula/facesdk/webclient/gen/api/person_api.py +++ b/regula/facesdk/webclient/gen/api/person_api.py @@ -1,49 +1,140 @@ # coding: utf-8 """ - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 Generated by: https://openapi-generator.tech """ - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from regula.facesdk.webclient.gen.api_client import ApiClient -from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class PersonApi(object): +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictInt, StrictStr +from typing import Optional, Tuple, Union +from typing_extensions import Annotated +from uuid import UUID +from regula.facesdk.webclient.gen.models.add_image_to_person_request import AddImageToPersonRequest +from regula.facesdk.webclient.gen.models.add_image_to_person_response import AddImageToPersonResponse +from regula.facesdk.webclient.gen.models.group_page import GroupPage +from regula.facesdk.webclient.gen.models.image_page import ImagePage +from regula.facesdk.webclient.gen.models.person import Person +from regula.facesdk.webclient.gen.models.person_fields import PersonFields +from regula.facesdk.webclient.gen.models.person_to_update_fields import PersonToUpdateFields + +from regula.facesdk.webclient.gen.api_client import ApiClient, RequestSerialized +from regula.facesdk.webclient.gen.api_response import ApiResponse +from regula.facesdk.webclient.gen.rest import RESTResponseType + + +class PersonApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - def add_image_to_person(self, person_id, add_image_to_person_request, **kwargs): # noqa: E501 - """Add person image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_image_to_person( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + add_image_to_person_request: Annotated[AddImageToPersonRequest, Field(description="Image to add.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddImageToPersonResponse: + """Add person image + + + :param person_id: Person ID. (required) + :type person_id: str + :param add_image_to_person_request: Image to add. (required) + :type add_image_to_person_request: AddImageToPersonRequest + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_image_to_person_serialize( + person_id=person_id, + add_image_to_person_request=add_image_to_person_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddImageToPersonResponse", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_image_to_person_with_http_info( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + add_image_to_person_request: Annotated[AddImageToPersonRequest, Field(description="Image to add.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddImageToPersonResponse]: + """Add person image - >>> thread = api.add_image_to_person(person_id, add_image_to_person_request, async_req=True) - >>> result = thread.get() :param person_id: Person ID. (required) :type person_id: str @@ -51,32 +142,75 @@ def add_image_to_person(self, person_id, add_image_to_person_request, **kwargs): :type add_image_to_person_request: AddImageToPersonRequest :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AddImageToPersonResponse - """ - kwargs['_return_http_data_only'] = True - return self.add_image_to_person_with_http_info(person_id, add_image_to_person_request, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._add_image_to_person_serialize( + person_id=person_id, + add_image_to_person_request=add_image_to_person_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddImageToPersonResponse", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def add_image_to_person_with_http_info(self, person_id, add_image_to_person_request, **kwargs): # noqa: E501 - """Add person image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_image_to_person_without_preload_content( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + add_image_to_person_request: Annotated[AddImageToPersonRequest, Field(description="Image to add.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add person image - >>> thread = api.add_image_to_person_with_http_info(person_id, add_image_to_person_request, async_req=True) - >>> result = thread.get() :param person_id: Person ID. (required) :type person_id: str @@ -84,1123 +218,2284 @@ def add_image_to_person_with_http_info(self, person_id, add_image_to_person_requ :type add_image_to_person_request: AddImageToPersonRequest :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AddImageToPersonResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._add_image_to_person_serialize( + person_id=person_id, + add_image_to_person_request=add_image_to_person_request, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddImageToPersonResponse", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_image_to_person_serialize( + self, + person_id, + add_image_to_person_request, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if person_id is not None: + _path_params['personId'] = person_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if add_image_to_person_request is not None: + _body_params = add_image_to_person_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'person_id', - 'add_image_to_person_request', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/persons/{personId}/images', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_person( + self, + person_fields: PersonFields, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Person: + """Create person + + + :param person_fields: (required) + :type person_fields: PersonFields + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_person_serialize( + person_fields=person_fields, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_image_to_person" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'person_id' is set - if self.api_client.client_side_validation and ('person_id' not in local_var_params or # noqa: E501 - local_var_params['person_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_id` when calling `add_image_to_person`") # noqa: E501 - # verify the required parameter 'add_image_to_person_request' is set - if self.api_client.client_side_validation and ('add_image_to_person_request' not in local_var_params or # noqa: E501 - local_var_params['add_image_to_person_request'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `add_image_to_person_request` when calling `add_image_to_person`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'person_id' in local_var_params: - path_params['personId'] = local_var_params['person_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'add_image_to_person_request' in local_var_params: - body_params = local_var_params['add_image_to_person_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons/{personId}/images', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AddImageToPersonResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def create_person(self, person_fields, **kwargs): # noqa: E501 - """Create person # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_person(person_fields, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Person", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_person_with_http_info( + self, + person_fields: PersonFields, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Person]: + """Create person + :param person_fields: (required) :type person_fields: PersonFields :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Person - """ - kwargs['_return_http_data_only'] = True - return self.create_person_with_http_info(person_fields, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._create_person_serialize( + person_fields=person_fields, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Person", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def create_person_with_http_info(self, person_fields, **kwargs): # noqa: E501 - """Create person # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_person_without_preload_content( + self, + person_fields: PersonFields, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create person - >>> thread = api.create_person_with_http_info(person_fields, async_req=True) - >>> result = thread.get() :param person_fields: (required) :type person_fields: PersonFields :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Person, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_person_serialize( + person_fields=person_fields, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Person", + '400': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_person_serialize( + self, + person_fields, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if person_fields is not None: + _body_params = person_fields + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'person_fields', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/persons', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_person" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'person_fields' is set - if self.api_client.client_side_validation and ('person_fields' not in local_var_params or # noqa: E501 - local_var_params['person_fields'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_fields` when calling `create_person`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'person_fields' in local_var_params: - body_params = local_var_params['person_fields'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Person', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_image_of_person(self, image_id, person_id, **kwargs): # noqa: E501 - """Delete image of person # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_image_of_person(image_id, person_id, async_req=True) - >>> result = thread.get() + + + @validate_call + def delete_image_of_person( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + image_id: Annotated[StrictStr, Field(description="Image ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete image of person + + + :param person_id: Person ID. (required) + :type person_id: str :param image_id: Image ID. (required) :type image_id: str + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_image_of_person_serialize( + person_id=person_id, + image_id=image_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_image_of_person_with_http_info( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + image_id: Annotated[StrictStr, Field(description="Image ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete image of person + + :param person_id: Person ID. (required) :type person_id: str + :param image_id: Image ID. (required) + :type image_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_image_of_person_with_http_info(image_id, person_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._delete_image_of_person_serialize( + person_id=person_id, + image_id=image_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - def delete_image_of_person_with_http_info(self, image_id, person_id, **kwargs): # noqa: E501 - """Delete image of person # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_image_of_person_with_http_info(image_id, person_id, async_req=True) - >>> result = thread.get() + @validate_call + def delete_image_of_person_without_preload_content( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + image_id: Annotated[StrictStr, Field(description="Image ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete image of person + - :param image_id: Image ID. (required) - :type image_id: str :param person_id: Person ID. (required) :type person_id: str + :param image_id: Image ID. (required) + :type image_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() + """ # noqa: E501 + + _param = self._delete_image_of_person_serialize( + person_id=person_id, + image_id=image_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - all_params = [ - 'image_id', - 'person_id', - 'x_request_id', + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_image_of_person_serialize( + self, + person_id, + image_id, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if person_id is not None: + _path_params['personId'] = person_id + if image_id is not None: + _path_params['imageId'] = image_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/persons/{personId}/images/{imageId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_person( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete person + + + :param person_id: Person ID. (required) + :type person_id: str + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_person_serialize( + person_id=person_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_image_of_person" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'image_id' is set - if self.api_client.client_side_validation and ('image_id' not in local_var_params or # noqa: E501 - local_var_params['image_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `image_id` when calling `delete_image_of_person`") # noqa: E501 - # verify the required parameter 'person_id' is set - if self.api_client.client_side_validation and ('person_id' not in local_var_params or # noqa: E501 - local_var_params['person_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_id` when calling `delete_image_of_person`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'image_id' in local_var_params: - path_params['imageId'] = local_var_params['image_id'] # noqa: E501 - if 'person_id' in local_var_params: - path_params['personId'] = local_var_params['person_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons/{personId}/images/{imageId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def delete_person(self, person_id, **kwargs): # noqa: E501 - """Delete person # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_person(person_id, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_person_with_http_info( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete person + :param person_id: Person ID. (required) :type person_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.delete_person_with_http_info(person_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._delete_person_serialize( + person_id=person_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def delete_person_with_http_info(self, person_id, **kwargs): # noqa: E501 - """Delete person # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def delete_person_without_preload_content( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete person - >>> thread = api.delete_person_with_http_info(person_id, async_req=True) - >>> result = thread.get() :param person_id: Person ID. (required) :type person_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - local_var_params = locals() + """ # noqa: E501 + + _param = self._delete_person_serialize( + person_id=person_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - all_params = [ - 'person_id', - 'x_request_id', + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_person_serialize( + self, + person_id, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if person_id is not None: + _path_params['personId'] = person_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/persons/{personId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_person" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'person_id' is set - if self.api_client.client_side_validation and ('person_id' not in local_var_params or # noqa: E501 - local_var_params['person_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_id` when calling `delete_person`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'person_id' in local_var_params: - path_params['personId'] = local_var_params['person_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons/{personId}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_all_groups_by_person_id(self, person_id, **kwargs): # noqa: E501 - """Get person groups # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_all_groups_by_person_id(person_id, async_req=True) - >>> result = thread.get() + + + + @validate_call + def get_all_groups_by_person_id( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupPage: + """Get person groups + :param person_id: Person ID. (required) :type person_id: str + :param x_request_id: Request header label. + :type x_request_id: str :param page: The page number to get a list of persons or groups. :type page: int :param size: The page size with a list of persons or groups, items. :type size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_all_groups_by_person_id_serialize( + person_id=person_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupPage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_all_groups_by_person_id_with_http_info( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupPage]: + """Get person groups + + + :param person_id: Person ID. (required) + :type person_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional + :param page: The page number to get a list of persons or groups. + :type page: int + :param size: The page size with a list of persons or groups, items. + :type size: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GroupPage - """ - kwargs['_return_http_data_only'] = True - return self.get_all_groups_by_person_id_with_http_info(person_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_all_groups_by_person_id_serialize( + person_id=person_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupPage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def get_all_groups_by_person_id_with_http_info(self, person_id, **kwargs): # noqa: E501 - """Get person groups # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_all_groups_by_person_id_without_preload_content( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get person groups - >>> thread = api.get_all_groups_by_person_id_with_http_info(person_id, async_req=True) - >>> result = thread.get() :param person_id: Person ID. (required) :type person_id: str + :param x_request_id: Request header label. + :type x_request_id: str :param page: The page number to get a list of persons or groups. :type page: int :param size: The page size with a list of persons or groups, items. :type size: int - :param x_request_id: Request header label. - :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GroupPage, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'person_id', - 'page', - 'size', - 'x_request_id', + """ # noqa: E501 + + _param = self._get_all_groups_by_person_id_serialize( + person_id=person_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupPage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_all_groups_by_person_id_serialize( + self, + person_id, + x_request_id, + page, + size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if person_id is not None: + _path_params['personId'] = person_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/persons/{personId}/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_groups_by_person_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'person_id' is set - if self.api_client.client_side_validation and ('person_id' not in local_var_params or # noqa: E501 - local_var_params['person_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_id` when calling `get_all_groups_by_person_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'person_id' in local_var_params: - path_params['personId'] = local_var_params['person_id'] # noqa: E501 - - query_params = [] - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'size' in local_var_params and local_var_params['size'] is not None: # noqa: E501 - query_params.append(('size', local_var_params['size'])) # noqa: E501 - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons/{personId}/groups', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GroupPage', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_all_images_by_person_id(self, person_id, **kwargs): # noqa: E501 - """Get person images # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_all_images_by_person_id(person_id, async_req=True) - >>> result = thread.get() + + + + @validate_call + def get_all_images_by_person_id( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImagePage: + """Get person images + :param person_id: Person ID. (required) :type person_id: str + :param x_request_id: Request header label. + :type x_request_id: str :param page: The page number to get a list of persons or groups. :type page: int :param size: The page size with a list of persons or groups, items. :type size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_all_images_by_person_id_serialize( + person_id=person_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_all_images_by_person_id_with_http_info( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImagePage]: + """Get person images + + + :param person_id: Person ID. (required) + :type person_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional + :param page: The page number to get a list of persons or groups. + :type page: int + :param size: The page size with a list of persons or groups, items. + :type size: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImagePage - """ - kwargs['_return_http_data_only'] = True - return self.get_all_images_by_person_id_with_http_info(person_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_all_images_by_person_id_serialize( + person_id=person_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def get_all_images_by_person_id_with_http_info(self, person_id, **kwargs): # noqa: E501 - """Get person images # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_all_images_by_person_id_without_preload_content( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + page: Annotated[Optional[StrictInt], Field(description="The page number to get a list of persons or groups.")] = None, + size: Annotated[Optional[StrictInt], Field(description="The page size with a list of persons or groups, items.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get person images - >>> thread = api.get_all_images_by_person_id_with_http_info(person_id, async_req=True) - >>> result = thread.get() :param person_id: Person ID. (required) :type person_id: str + :param x_request_id: Request header label. + :type x_request_id: str :param page: The page number to get a list of persons or groups. :type page: int :param size: The page size with a list of persons or groups, items. :type size: int - :param x_request_id: Request header label. - :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImagePage, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() - - all_params = [ - 'person_id', - 'page', - 'size', - 'x_request_id', + """ # noqa: E501 + + _param = self._get_all_images_by_person_id_serialize( + person_id=person_id, + x_request_id=x_request_id, + page=page, + size=size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImagePage", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_all_images_by_person_id_serialize( + self, + person_id, + x_request_id, + page, + size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if person_id is not None: + _path_params['personId'] = person_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/persons/{personId}/images', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_all_images_by_person_id" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'person_id' is set - if self.api_client.client_side_validation and ('person_id' not in local_var_params or # noqa: E501 - local_var_params['person_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_id` when calling `get_all_images_by_person_id`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'person_id' in local_var_params: - path_params['personId'] = local_var_params['person_id'] # noqa: E501 - - query_params = [] - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'size' in local_var_params and local_var_params['size'] is not None: # noqa: E501 - query_params.append(('size', local_var_params['size'])) # noqa: E501 - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons/{personId}/images', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ImagePage', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_image_of_person(self, image_id, person_id, **kwargs): # noqa: E501 - """Get person image by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_image_of_person(image_id, person_id, async_req=True) - >>> result = thread.get() + + + @validate_call + def get_image_of_person( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + image_id: Annotated[StrictStr, Field(description="Image ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """Get person image by id + + + :param person_id: Person ID. (required) + :type person_id: str :param image_id: Image ID. (required) :type image_id: str + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_image_of_person_serialize( + person_id=person_id, + image_id=image_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '404': "OperationLog", + '400': "OperationLog", + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_image_of_person_with_http_info( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + image_id: Annotated[StrictStr, Field(description="Image ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """Get person image by id + + :param person_id: Person ID. (required) :type person_id: str + :param image_id: Image ID. (required) + :type image_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: file_type - """ - kwargs['_return_http_data_only'] = True - return self.get_image_of_person_with_http_info(image_id, person_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_image_of_person_serialize( + person_id=person_id, + image_id=image_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - def get_image_of_person_with_http_info(self, image_id, person_id, **kwargs): # noqa: E501 - """Get person image by id # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '404': "OperationLog", + '400': "OperationLog", + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_image_of_person_with_http_info(image_id, person_id, async_req=True) - >>> result = thread.get() + @validate_call + def get_image_of_person_without_preload_content( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + image_id: Annotated[StrictStr, Field(description="Image ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get person image by id + - :param image_id: Image ID. (required) - :type image_id: str :param person_id: Person ID. (required) :type person_id: str + :param image_id: Image ID. (required) + :type image_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(file_type, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() + """ # noqa: E501 + + _param = self._get_image_of_person_serialize( + person_id=person_id, + image_id=image_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - all_params = [ - 'image_id', - 'person_id', - 'x_request_id', + _response_types_map: Dict[str, Optional[str]] = { + '404': "OperationLog", + '400': "OperationLog", + '200': "bytearray", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_image_of_person_serialize( + self, + person_id, + image_id, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if person_id is not None: + _path_params['personId'] = person_id + if image_id is not None: + _path_params['imageId'] = image_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'image/*' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/persons/{personId}/images/{imageId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_person( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Person: + """Get person + + + :param person_id: Person ID. (required) + :type person_id: str + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_person_serialize( + person_id=person_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_image_of_person" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'image_id' is set - if self.api_client.client_side_validation and ('image_id' not in local_var_params or # noqa: E501 - local_var_params['image_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `image_id` when calling `get_image_of_person`") # noqa: E501 - # verify the required parameter 'person_id' is set - if self.api_client.client_side_validation and ('person_id' not in local_var_params or # noqa: E501 - local_var_params['person_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_id` when calling `get_image_of_person`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'image_id' in local_var_params: - path_params['imageId'] = local_var_params['image_id'] # noqa: E501 - if 'person_id' in local_var_params: - path_params['personId'] = local_var_params['person_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json''image/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons/{personId}/images/{imageId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='file_type', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def get_person(self, person_id, **kwargs): # noqa: E501 - """Get person # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_person(person_id, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Person", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_person_with_http_info( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Person]: + """Get person + :param person_id: Person ID. (required) :type person_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Person - """ - kwargs['_return_http_data_only'] = True - return self.get_person_with_http_info(person_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_person_serialize( + person_id=person_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Person", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def get_person_with_http_info(self, person_id, **kwargs): # noqa: E501 - """Get person # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_person_without_preload_content( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get person - >>> thread = api.get_person_with_http_info(person_id, async_req=True) - >>> result = thread.get() :param person_id: Person ID. (required) :type person_id: str :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Person, status_code(int), headers(HTTPHeaderDict)) - """ - - local_var_params = locals() + """ # noqa: E501 + + _param = self._get_person_serialize( + person_id=person_id, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - all_params = [ - 'person_id', - 'x_request_id', + _response_types_map: Dict[str, Optional[str]] = { + '200': "Person", + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_person_serialize( + self, + person_id, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if person_id is not None: + _path_params['personId'] = person_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/persons/{personId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_person( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + person_to_update_fields: Annotated[PersonToUpdateFields, Field(description="Request body for the Person to update.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update person + + + :param person_id: Person ID. (required) + :type person_id: str + :param person_to_update_fields: Request body for the Person to update. (required) + :type person_to_update_fields: PersonToUpdateFields + :param x_request_id: Request header label. + :type x_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_person_serialize( + person_id=person_id, + person_to_update_fields=person_to_update_fields, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_person" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'person_id' is set - if self.api_client.client_side_validation and ('person_id' not in local_var_params or # noqa: E501 - local_var_params['person_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_id` when calling `get_person`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'person_id' in local_var_params: - path_params['personId'] = local_var_params['person_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons/{personId}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Person', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) - - def update_person(self, person_id, person_to_update_fields, **kwargs): # noqa: E501 - """Update person # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_person(person_id, person_to_update_fields, async_req=True) - >>> result = thread.get() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_person_with_http_info( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + person_to_update_fields: Annotated[PersonToUpdateFields, Field(description="Request body for the Person to update.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update person + :param person_id: Person ID. (required) :type person_id: str @@ -1208,32 +2503,75 @@ def update_person(self, person_id, person_to_update_fields, **kwargs): # noqa: :type person_to_update_fields: PersonToUpdateFields :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - return self.update_person_with_http_info(person_id, person_to_update_fields, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._update_person_serialize( + person_id=person_id, + person_to_update_fields=person_to_update_fields, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - def update_person_with_http_info(self, person_id, person_to_update_fields, **kwargs): # noqa: E501 - """Update person # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_person_without_preload_content( + self, + person_id: Annotated[UUID, Field(description="Person ID.")], + person_to_update_fields: Annotated[PersonToUpdateFields, Field(description="Request body for the Person to update.")], + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update person - >>> thread = api.update_person_with_http_info(person_id, person_to_update_fields, async_req=True) - >>> result = thread.get() :param person_id: Person ID. (required) :type person_id: str @@ -1241,105 +2579,127 @@ def update_person_with_http_info(self, person_id, person_to_update_fields, **kwa :type person_to_update_fields: PersonToUpdateFields :param x_request_id: Request header label. :type x_request_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_person_serialize( + person_id=person_id, + person_to_update_fields=person_to_update_fields, + x_request_id=x_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - local_var_params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "OperationLog", + '404': "OperationLog", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_person_serialize( + self, + person_id, + person_to_update_fields, + x_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if person_id is not None: + _path_params['personId'] = person_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if person_to_update_fields is not None: + _body_params = person_to_update_fields + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - all_params = [ - 'person_id', - 'person_to_update_fields', - 'x_request_id', + # authentication setting + _auth_settings: List[str] = [ ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' - ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/api/persons/{personId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_person" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'person_id' is set - if self.api_client.client_side_validation and ('person_id' not in local_var_params or # noqa: E501 - local_var_params['person_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_id` when calling `update_person`") # noqa: E501 - # verify the required parameter 'person_to_update_fields' is set - if self.api_client.client_side_validation and ('person_to_update_fields' not in local_var_params or # noqa: E501 - local_var_params['person_to_update_fields'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `person_to_update_fields` when calling `update_person`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'person_id' in local_var_params: - path_params['personId'] = local_var_params['person_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'person_to_update_fields' in local_var_params: - body_params = local_var_params['person_to_update_fields'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/persons/{personId}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) + diff --git a/regula/facesdk/webclient/gen/api/search_api.py b/regula/facesdk/webclient/gen/api/search_api.py index a490a5b..8494bde 100644 --- a/regula/facesdk/webclient/gen/api/search_api.py +++ b/regula/facesdk/webclient/gen/api/search_api.py @@ -1,49 +1,58 @@ # coding: utf-8 """ - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 Generated by: https://openapi-generator.tech """ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field, StrictBool, StrictStr +from typing import Optional +from typing_extensions import Annotated +from regula.facesdk.webclient.gen.models.search_request import SearchRequest +from regula.facesdk.webclient.gen.models.search_result import SearchResult -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from regula.facesdk.webclient.gen.api_client import ApiClient -from regula.facesdk.webclient.gen.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from regula.facesdk.webclient.gen.api_client import ApiClient, RequestSerialized +from regula.facesdk.webclient.gen.api_response import ApiResponse +from regula.facesdk.webclient.gen.rest import RESTResponseType -class SearchApi(object): +class SearchApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - def search(self, search_request, **kwargs): # noqa: E501 - """Find person by image in groups # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def search( + self, + search_request: SearchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + with_images: Annotated[Optional[StrictBool], Field(description="When enabled, the response includes Base64-encoded images of matched persons. Each entry in the `persons` array contains an `images` field with image IDs and content. If omitted or set to false, images are excluded.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SearchResult: + """Find person by image in groups - >>> thread = api.search(search_request, async_req=True) - >>> result = thread.get() :param search_request: (required) :type search_request: SearchRequest @@ -51,32 +60,75 @@ def search(self, search_request, **kwargs): # noqa: E501 :type x_request_id: str :param with_images: When enabled, the response includes Base64-encoded images of matched persons. Each entry in the `persons` array contains an `images` field with image IDs and content. If omitted or set to false, images are excluded. :type with_images: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SearchResult - """ - kwargs['_return_http_data_only'] = True - return self.search_with_http_info(search_request, **kwargs) # noqa: E501 - - def search_with_http_info(self, search_request, **kwargs): # noqa: E501 - """Find person by image in groups # noqa: E501 + """ # noqa: E501 + + _param = self._search_serialize( + search_request=search_request, + x_request_id=x_request_id, + with_images=with_images, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchResult", + '201': "SearchPerson", + '400': "SearchBadParams", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_with_http_info( + self, + search_request: SearchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + with_images: Annotated[Optional[StrictBool], Field(description="When enabled, the response includes Base64-encoded images of matched persons. Each entry in the `persons` array contains an `images` field with image IDs and content. If omitted or set to false, images are excluded.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SearchResult]: + """Find person by image in groups - >>> thread = api.search_with_http_info(search_request, async_req=True) - >>> result = thread.get() :param search_request: (required) :type search_request: SearchRequest @@ -84,101 +136,205 @@ def search_with_http_info(self, search_request, **kwargs): # noqa: E501 :type x_request_id: str :param with_images: When enabled, the response includes Base64-encoded images of matched persons. Each entry in the `persons` array contains an `images` field with image IDs and content. If omitted or set to false, images are excluded. :type with_images: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SearchResult, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._search_serialize( + search_request=search_request, + x_request_id=x_request_id, + with_images=with_images, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchResult", + '201': "SearchPerson", + '400': "SearchBadParams", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - local_var_params = locals() - all_params = [ - 'search_request', - 'x_request_id', - 'with_images', - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth' + @validate_call + def search_without_preload_content( + self, + search_request: SearchRequest, + x_request_id: Annotated[Optional[StrictStr], Field(description="Request header label.")] = None, + with_images: Annotated[Optional[StrictBool], Field(description="When enabled, the response includes Base64-encoded images of matched persons. Each entry in the `persons` array contains an `images` field with image IDs and content. If omitted or set to false, images are excluded.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Find person by image in groups + + + :param search_request: (required) + :type search_request: SearchRequest + :param x_request_id: Request header label. + :type x_request_id: str + :param with_images: When enabled, the response includes Base64-encoded images of matched persons. Each entry in the `persons` array contains an `images` field with image IDs and content. If omitted or set to false, images are excluded. + :type with_images: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_serialize( + search_request=search_request, + x_request_id=x_request_id, + with_images=with_images, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method search" % key + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchResult", + '201': "SearchPerson", + '400': "SearchBadParams", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_serialize( + self, + search_request, + x_request_id, + with_images, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if with_images is not None: + + _query_params.append(('withImages', with_images)) + + # process the header parameters + if x_request_id is not None: + _header_params['X-RequestID'] = x_request_id + # process the form parameters + # process the body parameter + if search_request is not None: + _body_params = search_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'search_request' is set - if self.api_client.client_side_validation and ('search_request' not in local_var_params or # noqa: E501 - local_var_params['search_request'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `search_request` when calling `search`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'with_images' in local_var_params and local_var_params['with_images'] is not None: # noqa: E501 - query_params.append(('withImages', local_var_params['with_images'])) # noqa: E501 - - header_params = {} - if 'x_request_id' in local_var_params: - header_params['X-RequestID'] = local_var_params['x_request_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'search_request' in local_var_params: - body_params = local_var_params['search_request'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/search', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SearchResult', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - _request_auth=local_var_params.get('_request_auth')) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/search', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/regula/facesdk/webclient/gen/api_client.py b/regula/facesdk/webclient/gen/api_client.py index 93f9618..c3d1765 100644 --- a/regula/facesdk/webclient/gen/api_client.py +++ b/regula/facesdk/webclient/gen/api_client.py @@ -1,223 +1,41 @@ # coding: utf-8 -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - The version of the OpenAPI document: 7.2.0 +""" Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import - -import atexit import datetime from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile +import uuid -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr from regula.facesdk.webclient.gen.configuration import Configuration -import regula.facesdk.webclient.gen.model +from regula.facesdk.webclient.gen.api_response import ApiResponse, T as ApiResponseT +import regula.facesdk.webclient.gen.models from regula.facesdk.webclient.gen import rest -from regula.facesdk.webclient.gen.exceptions import ApiValueError, ApiException - - -class ModelSerDe: - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize_raw(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('['): - sub_kls = re.match(r'\[(.*)\]', klass).group(1) - return [self.deserialize_raw(sub_data, sub_kls) - for sub_data in data] - - if klass == '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}': - return data - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(regula.facesdk.webclient.gen.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - else: - return self.__deserialize_model(data, klass) - - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - has_discriminator = False - if (hasattr(klass, 'get_real_child_model') - and klass.discriminator_value_class_map): - has_discriminator = True - - if not klass.openapi_types and has_discriminator is False: - return data - - kwargs = {} - if (data is not None and - klass.openapi_types is not None and - isinstance(data, (list, dict))): - for attr, attr_type in six.iteritems(klass.openapi_types): - if klass.attribute_map[attr] in data: - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.deserialize_raw(value, attr_type) - - instance = klass(**kwargs) - - if has_discriminator: - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.deserialize_raw(data, klass_name) - return instance - - - -class ApiClient(ModelSerDe, object): +from regula.facesdk.webclient.gen.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -225,28 +43,39 @@ class ApiClient(ModelSerDe, object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -257,51 +86,11 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.user_agent = 'OpenAPI-Generator/1.0.0/python' self.client_side_validation = configuration.client_side_validation - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.deserialize_raw(data, response_type) - def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -315,13 +104,69 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -332,14 +177,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -347,203 +195,276 @@ def __call_api( quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( - header_params, query_params, auth_settings, - request_auth=_request_auth) + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead url = _host + resource_path + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body raise e - content_type = response_data.getheader('content-type') + return response_data - self.last_response = response_data - - return_data = response_data + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ - if not _preload_content: - return return_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg - if six.PY3 and response_type not in ["file", "bytes"]: - match = None - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - if _return_http_data_only: - return (return_data) + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, uuid.UUID): + return str(obj) + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj else: - return (return_data, response_data.status, - response_data.getheaders()) + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) - To make an async_req request, set the async_req parameter. + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) ) + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(regula.facesdk.webclient.gen.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -551,10 +472,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -574,45 +495,94 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def files_parameters(self, files=None): + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. @@ -621,22 +591,33 @@ def select_header_content_type(self, content_types): :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] + return None - def update_params_for_auth(self, headers, querys, auth_settings, - request_auth=None): + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. + :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). :param request_auth: if set, the provided settings will override the token in the configuration. """ @@ -644,27 +625,53 @@ def update_params_for_auth(self, headers, querys, auth_settings, return if request_auth: - self._apply_auth_params(headers, querys, request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, querys, auth_setting) - - def _apply_auth_params(self, headers, querys, auth_setting): + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: """Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). :param auth_setting: auth settings for the endpoint """ if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) + queries.append((auth_setting['key'], auth_setting['value'])) else: raise ApiValueError( 'Authentication token must be in `query` or `header`' @@ -676,6 +683,9 @@ def __deserialize_file(self, response): Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -685,11 +695,102 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: f.write(response.data) return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/regula/facesdk/webclient/gen/api_response.py b/regula/facesdk/webclient/gen/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/regula/facesdk/webclient/gen/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/regula/facesdk/webclient/gen/apis/__init__.py b/regula/facesdk/webclient/gen/apis/__init__.py deleted file mode 100644 index ba872f2..0000000 --- a/regula/facesdk/webclient/gen/apis/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ - -# flake8: noqa - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from .api.group_api import GroupApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from regula.facesdk.webclient.gen.api.group_api import GroupApi -from regula.facesdk.webclient.gen.api.healthcheck_api import HealthcheckApi -from regula.facesdk.webclient.gen.api.liveness_2_0_api import Liveness20Api -from regula.facesdk.webclient.gen.api.match_api import MatchApi -from regula.facesdk.webclient.gen.api.person_api import PersonApi -from regula.facesdk.webclient.gen.api.search_api import SearchApi diff --git a/regula/facesdk/webclient/gen/configuration.py b/regula/facesdk/webclient/gen/configuration.py index 4d82d68..0f943a8 100644 --- a/regula/facesdk/webclient/gen/configuration.py +++ b/regula/facesdk/webclient/gen/configuration.py @@ -1,21 +1,19 @@ -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 +# coding: utf-8 - The version of the OpenAPI document: 7.2.0 +""" Generated by: https://openapi-generator.tech """ - import copy +import http.client as httplib import logging +from logging import FileHandler import multiprocessing import sys -import urllib3 +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing_extensions import NotRequired, Self -from http import client as http_client -from regula.facesdk.webclient.gen.exceptions import ApiValueError +import urllib3 JSON_SCHEMA_VALIDATION_KEYWORDS = { @@ -24,46 +22,123 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. :param server_index: Index to servers configuration. :param server_variables: Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for @@ -72,27 +147,40 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format + in PEM format. + :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. """ - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - access_token=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + *, + debug: Optional[bool] = None, + ) -> None: """Constructor """ - self._base_path = "http://localhost:41101" if host is None else host + self._base_path = "https://faceapi.regulaforensics.com" if host is None else host """Default Base url """ self.server_index = 0 if server_index is None and host is None else server_index @@ -103,11 +191,13 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} if api_key: self.api_key = api_key @@ -127,8 +217,9 @@ def __init__(self, host=None, self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ self.logger = {} """Logging Settings """ @@ -140,13 +231,16 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -158,6 +252,10 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ self.cert_file = None """client certificate file """ @@ -167,6 +265,10 @@ def __init__(self, host=None, self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -176,28 +278,34 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ - def __deepcopy__(self, memo): + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -211,18 +319,11 @@ def __deepcopy__(self, memo): result.debug = self.debug return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -230,24 +331,34 @@ def set_default(cls, default): :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default @classmethod - def get_default_copy(cls): - """Return new instance of configuration. + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = cls() + return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -259,7 +370,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -278,7 +389,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -287,7 +398,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -298,18 +409,18 @@ def debug(self, value): # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -320,7 +431,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -331,7 +442,7 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -348,7 +459,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -363,15 +476,15 @@ def get_basic_auth_token(self): basic_auth=username + ':' + password ).get('authorization') - def auth_settings(self): + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -383,19 +496,32 @@ def to_debug_report(self): "SDK Package Version: 1.0.0".\ format(env=sys.platform, pyversion=sys.version) - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings """ return [ + { + 'url': "https://faceapi.regulaforensics.com", + 'description': "Latest stable Regula face demo endpoint", + }, + { + 'url': "https://nightly-faceapi.regulaforensics.com", + 'description': "Nightly Regula face demo endpoint", + }, { 'url': "http://localhost:41101", 'description': "Local on-premise installation", } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -435,12 +561,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/regula/facesdk/webclient/gen/exceptions.py b/regula/facesdk/webclient/gen/exceptions.py index 8eb3cf7..03a9f77 100644 --- a/regula/facesdk/webclient/gen/exceptions.py +++ b/regula/facesdk/webclient/gen/exceptions.py @@ -1,13 +1,10 @@ -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 +# coding: utf-8 - The version of the OpenAPI document: 7.2.0 +""" Generated by: https://openapi-generator.tech """ - - +from typing import Any, Optional +from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -15,7 +12,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -43,7 +40,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -61,7 +58,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -80,7 +77,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -98,17 +95,63 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -118,34 +161,40 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message -class NotFoundException(ApiException): +class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) +class NotFoundException(ApiException): + pass -class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) +class UnauthorizedException(ApiException): + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass def render_path(path_to_item): diff --git a/regula/facesdk/webclient/gen/model/__init__.py b/regula/facesdk/webclient/gen/model/__init__.py deleted file mode 100644 index cfe32b7..0000000 --- a/regula/facesdk/webclient/gen/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB diff --git a/regula/facesdk/webclient/gen/model/add_image_to_person_request.py b/regula/facesdk/webclient/gen/model/add_image_to_person_request.py deleted file mode 100644 index 3e42fca..0000000 --- a/regula/facesdk/webclient/gen/model/add_image_to_person_request.py +++ /dev/null @@ -1,261 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class AddImageToPersonRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tag': 'str', - 'image': 'AddImageToPersonRequestImage', - 'threshold': 'float', - 'limit': 'int', - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'tag': 'tag', - 'image': 'image', - 'threshold': 'threshold', - 'limit': 'limit', - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, tag=None, image=None, threshold=None, limit=None, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """AddImageToPersonRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tag = None - self._image = None - self._threshold = None - self._limit = None - self._tenant = None - self._env = None - self.discriminator = None - - if tag is not None: - self.tag = tag - self.image = image - if threshold is not None: - self.threshold = threshold - if limit is not None: - self.limit = limit - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def tag(self): - """Gets the tag of this AddImageToPersonRequest. # noqa: E501 - - Session identificator. # noqa: E501 - - :return: The tag of this AddImageToPersonRequest. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this AddImageToPersonRequest. - - Session identificator. # noqa: E501 - - :param tag: The tag of this AddImageToPersonRequest. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def image(self): - """Gets the image of this AddImageToPersonRequest. # noqa: E501 - - - :return: The image of this AddImageToPersonRequest. # noqa: E501 - :rtype: AddImageToPersonRequestImage - """ - return self._image - - @image.setter - def image(self, image): - """Sets the image of this AddImageToPersonRequest. - - - :param image: The image of this AddImageToPersonRequest. # noqa: E501 - :type image: AddImageToPersonRequestImage - """ - if self.local_vars_configuration.client_side_validation and image is None: # noqa: E501 - raise ValueError("Invalid value for `image`, must not be `None`") # noqa: E501 - - self._image = image - - @property - def threshold(self): - """Gets the threshold of this AddImageToPersonRequest. # noqa: E501 - - The similarity threshold. # noqa: E501 - - :return: The threshold of this AddImageToPersonRequest. # noqa: E501 - :rtype: float - """ - return self._threshold - - @threshold.setter - def threshold(self, threshold): - """Sets the threshold of this AddImageToPersonRequest. - - The similarity threshold. # noqa: E501 - - :param threshold: The threshold of this AddImageToPersonRequest. # noqa: E501 - :type threshold: float - """ - - self._threshold = threshold - - @property - def limit(self): - """Gets the limit of this AddImageToPersonRequest. # noqa: E501 - - The maximum number of results to be returned. # noqa: E501 - - :return: The limit of this AddImageToPersonRequest. # noqa: E501 - :rtype: int - """ - return self._limit - - @limit.setter - def limit(self, limit): - """Sets the limit of this AddImageToPersonRequest. - - The maximum number of results to be returned. # noqa: E501 - - :param limit: The limit of this AddImageToPersonRequest. # noqa: E501 - :type limit: int - """ - - self._limit = limit - - @property - def tenant(self): - """Gets the tenant of this AddImageToPersonRequest. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this AddImageToPersonRequest. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this AddImageToPersonRequest. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this AddImageToPersonRequest. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this AddImageToPersonRequest. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this AddImageToPersonRequest. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this AddImageToPersonRequest. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this AddImageToPersonRequest. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AddImageToPersonRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AddImageToPersonRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/add_image_to_person_request_image.py b/regula/facesdk/webclient/gen/model/add_image_to_person_request_image.py deleted file mode 100644 index 1bc8358..0000000 --- a/regula/facesdk/webclient/gen/model/add_image_to_person_request_image.py +++ /dev/null @@ -1,204 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class AddImageToPersonRequestImage(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'content_type': 'str', - 'content': 'str', - 'image_url': 'str', - 'resize_options': 'ResizeOptions', - } - - attribute_map = { - 'content_type': 'contentType', - 'content': 'content', - 'image_url': 'imageUrl', - 'resize_options': 'resizeOptions', - } - - def __init__(self, content_type=None, content=None, image_url=None, resize_options=None, local_vars_configuration=None): # noqa: E501 - """AddImageToPersonRequestImage - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._content_type = None - self._content = None - self._image_url = None - self._resize_options = None - self.discriminator = None - - if content_type is not None: - self.content_type = content_type - if content is not None: - self.content = content - if image_url is not None: - self.image_url = image_url - if resize_options is not None: - self.resize_options = resize_options - - @property - def content_type(self): - """Gets the content_type of this AddImageToPersonRequestImage. # noqa: E501 - - Original media type of the uploaded image. # noqa: E501 - - :return: The content_type of this AddImageToPersonRequestImage. # noqa: E501 - :rtype: str - """ - return self._content_type - - @content_type.setter - def content_type(self, content_type): - """Sets the content_type of this AddImageToPersonRequestImage. - - Original media type of the uploaded image. # noqa: E501 - - :param content_type: The content_type of this AddImageToPersonRequestImage. # noqa: E501 - :type content_type: str - """ - - self._content_type = content_type - - @property - def content(self): - """Gets the content of this AddImageToPersonRequestImage. # noqa: E501 - - Base64-encoded image. # noqa: E501 - - :return: The content of this AddImageToPersonRequestImage. # noqa: E501 - :rtype: str - """ - return self._content - - @content.setter - def content(self, content): - """Sets the content of this AddImageToPersonRequestImage. - - Base64-encoded image. # noqa: E501 - - :param content: The content of this AddImageToPersonRequestImage. # noqa: E501 - :type content: str - """ - - self._content = content - - @property - def image_url(self): - """Gets the image_url of this AddImageToPersonRequestImage. # noqa: E501 - - Image URL. # noqa: E501 - - :return: The image_url of this AddImageToPersonRequestImage. # noqa: E501 - :rtype: str - """ - return self._image_url - - @image_url.setter - def image_url(self, image_url): - """Sets the image_url of this AddImageToPersonRequestImage. - - Image URL. # noqa: E501 - - :param image_url: The image_url of this AddImageToPersonRequestImage. # noqa: E501 - :type image_url: str - """ - - self._image_url = image_url - - @property - def resize_options(self): - """Gets the resize_options of this AddImageToPersonRequestImage. # noqa: E501 - - - :return: The resize_options of this AddImageToPersonRequestImage. # noqa: E501 - :rtype: ResizeOptions - """ - return self._resize_options - - @resize_options.setter - def resize_options(self, resize_options): - """Sets the resize_options of this AddImageToPersonRequestImage. - - - :param resize_options: The resize_options of this AddImageToPersonRequestImage. # noqa: E501 - :type resize_options: ResizeOptions - """ - - self._resize_options = resize_options - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AddImageToPersonRequestImage): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AddImageToPersonRequestImage): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/add_image_to_person_response.py b/regula/facesdk/webclient/gen/model/add_image_to_person_response.py deleted file mode 100644 index 612af81..0000000 --- a/regula/facesdk/webclient/gen/model/add_image_to_person_response.py +++ /dev/null @@ -1,262 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class AddImageToPersonResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'content_type': 'str', - 'created_at': 'str', - 'path': 'str', - 'url': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'id': 'id', - 'content_type': 'contentType', - 'created_at': 'createdAt', - 'path': 'path', - 'url': 'url', - 'metadata': 'metadata', - } - - def __init__(self, id=None, content_type=None, created_at=None, path=None, url=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """AddImageToPersonResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._content_type = None - self._created_at = None - self._path = None - self._url = None - self._metadata = None - self.discriminator = None - - if id is not None: - self.id = id - if content_type is not None: - self.content_type = content_type - if created_at is not None: - self.created_at = created_at - if path is not None: - self.path = path - if url is not None: - self.url = url - if metadata is not None: - self.metadata = metadata - - @property - def id(self): - """Gets the id of this AddImageToPersonResponse. # noqa: E501 - - Response image ID. The list is sorted by decreasing ID value. # noqa: E501 - - :return: The id of this AddImageToPersonResponse. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this AddImageToPersonResponse. - - Response image ID. The list is sorted by decreasing ID value. # noqa: E501 - - :param id: The id of this AddImageToPersonResponse. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def content_type(self): - """Gets the content_type of this AddImageToPersonResponse. # noqa: E501 - - Original media type of the returned image. # noqa: E501 - - :return: The content_type of this AddImageToPersonResponse. # noqa: E501 - :rtype: str - """ - return self._content_type - - @content_type.setter - def content_type(self, content_type): - """Sets the content_type of this AddImageToPersonResponse. - - Original media type of the returned image. # noqa: E501 - - :param content_type: The content_type of this AddImageToPersonResponse. # noqa: E501 - :type content_type: str - """ - - self._content_type = content_type - - @property - def created_at(self): - """Gets the created_at of this AddImageToPersonResponse. # noqa: E501 - - Returned image creation date. # noqa: E501 - - :return: The created_at of this AddImageToPersonResponse. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this AddImageToPersonResponse. - - Returned image creation date. # noqa: E501 - - :param created_at: The created_at of this AddImageToPersonResponse. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - @property - def path(self): - """Gets the path of this AddImageToPersonResponse. # noqa: E501 - - Returned image path. # noqa: E501 - - :return: The path of this AddImageToPersonResponse. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this AddImageToPersonResponse. - - Returned image path. # noqa: E501 - - :param path: The path of this AddImageToPersonResponse. # noqa: E501 - :type path: str - """ - - self._path = path - - @property - def url(self): - """Gets the url of this AddImageToPersonResponse. # noqa: E501 - - Returned image URL. # noqa: E501 - - :return: The url of this AddImageToPersonResponse. # noqa: E501 - :rtype: str - """ - return self._url - - @url.setter - def url(self, url): - """Sets the url of this AddImageToPersonResponse. - - Returned image URL. # noqa: E501 - - :param url: The url of this AddImageToPersonResponse. # noqa: E501 - :type url: str - """ - - self._url = url - - @property - def metadata(self): - """Gets the metadata of this AddImageToPersonResponse. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this AddImageToPersonResponse. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this AddImageToPersonResponse. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this AddImageToPersonResponse. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AddImageToPersonResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AddImageToPersonResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/attribute_config.py b/regula/facesdk/webclient/gen/model/attribute_config.py deleted file mode 100644 index 65f89df..0000000 --- a/regula/facesdk/webclient/gen/model/attribute_config.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class AttributeConfig(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'FaceAttribute', - } - - attribute_map = { - 'name': 'name', - } - - def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 - """AttributeConfig - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this AttributeConfig. # noqa: E501 - - - :return: The name of this AttributeConfig. # noqa: E501 - :rtype: FaceAttribute - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this AttributeConfig. - - - :param name: The name of this AttributeConfig. # noqa: E501 - :type name: FaceAttribute - """ - - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AttributeConfig): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AttributeConfig): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/attribute_config_list.py b/regula/facesdk/webclient/gen/model/attribute_config_list.py deleted file mode 100644 index 1f7e5ef..0000000 --- a/regula/facesdk/webclient/gen/model/attribute_config_list.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class AttributeConfigList(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """AttributeConfigList - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AttributeConfigList): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, AttributeConfigList): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/crop.py b/regula/facesdk/webclient/gen/model/crop.py deleted file mode 100644 index 47412d9..0000000 --- a/regula/facesdk/webclient/gen/model/crop.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class Crop(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'type': 'FaceImageQualityAlignType', - 'pad_color': 'RGB', - 'size': '[int]', - } - - attribute_map = { - 'type': 'type', - 'pad_color': 'padColor', - 'size': 'size', - } - - def __init__(self, type=None, pad_color=None, size=None, local_vars_configuration=None): # noqa: E501 - """Crop - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._type = None - self._pad_color = None - self._size = None - self.discriminator = None - - if type is not None: - self.type = type - if pad_color is not None: - self.pad_color = pad_color - if size is not None: - self.size = size - - @property - def type(self): - """Gets the type of this Crop. # noqa: E501 - - - :return: The type of this Crop. # noqa: E501 - :rtype: FaceImageQualityAlignType - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this Crop. - - - :param type: The type of this Crop. # noqa: E501 - :type type: FaceImageQualityAlignType - """ - - self._type = type - - @property - def pad_color(self): - """Gets the pad_color of this Crop. # noqa: E501 - - - :return: The pad_color of this Crop. # noqa: E501 - :rtype: RGB - """ - return self._pad_color - - @pad_color.setter - def pad_color(self, pad_color): - """Sets the pad_color of this Crop. - - - :param pad_color: The pad_color of this Crop. # noqa: E501 - :type pad_color: RGB - """ - - self._pad_color = pad_color - - @property - def size(self): - """Gets the size of this Crop. # noqa: E501 - - The resize value in case `type` matches this value. If it doesn't, no resize is performed. # noqa: E501 - - :return: The size of this Crop. # noqa: E501 - :rtype: [int] - """ - return self._size - - @size.setter - def size(self, size): - """Sets the size of this Crop. - - The resize value in case `type` matches this value. If it doesn't, no resize is performed. # noqa: E501 - - :param size: The size of this Crop. # noqa: E501 - :type size: [int] - """ - if (self.local_vars_configuration.client_side_validation and - size is not None and len(size) > 2): - raise ValueError("Invalid value for `size`, number of items must be less than or equal to `2`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - size is not None and len(size) < 2): - raise ValueError("Invalid value for `size`, number of items must be greater than or equal to `2`") # noqa: E501 - - self._size = size - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Crop): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Crop): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detect_attributes_details.py b/regula/facesdk/webclient/gen/model/detect_attributes_details.py deleted file mode 100644 index cc8f757..0000000 --- a/regula/facesdk/webclient/gen/model/detect_attributes_details.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectAttributesDetails(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'value': '[int]', - } - - attribute_map = { - 'name': 'name', - 'value': 'value', - } - - def __init__(self, name=None, value=None, local_vars_configuration=None): # noqa: E501 - """DetectAttributesDetails - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._value = None - self.discriminator = None - - if name is not None: - self.name = name - if value is not None: - self.value = value - - @property - def name(self): - """Gets the name of this DetectAttributesDetails. # noqa: E501 - - The name of the attribute. # noqa: E501 - - :return: The name of this DetectAttributesDetails. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this DetectAttributesDetails. - - The name of the attribute. # noqa: E501 - - :param name: The name of this DetectAttributesDetails. # noqa: E501 - :type name: str - """ - - self._name = name - - @property - def value(self): - """Gets the value of this DetectAttributesDetails. # noqa: E501 - - The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). # noqa: E501 - - :return: The value of this DetectAttributesDetails. # noqa: E501 - :rtype: [int] - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this DetectAttributesDetails. - - The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). # noqa: E501 - - :param value: The value of this DetectAttributesDetails. # noqa: E501 - :type value: [int] - """ - - self._value = value - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectAttributesDetails): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectAttributesDetails): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detect_details_meta.py b/regula/facesdk/webclient/gen/model/detect_details_meta.py deleted file mode 100644 index 1d22f62..0000000 --- a/regula/facesdk/webclient/gen/model/detect_details_meta.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectDetailsMeta(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'confidence': 'float', - 'value': 'str', - 'name': 'str', - } - - attribute_map = { - 'confidence': 'confidence', - 'value': 'value', - 'name': 'name', - } - - def __init__(self, confidence=None, value=None, name=None, local_vars_configuration=None): # noqa: E501 - """DetectDetailsMeta - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._confidence = None - self._value = None - self._name = None - self.discriminator = None - - if confidence is not None: - self.confidence = confidence - if value is not None: - self.value = value - if name is not None: - self.name = name - - @property - def confidence(self): - """Gets the confidence of this DetectDetailsMeta. # noqa: E501 - - The confidence in the estimated value, `1.0` is for 100% confidence. # noqa: E501 - - :return: The confidence of this DetectDetailsMeta. # noqa: E501 - :rtype: float - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence): - """Sets the confidence of this DetectDetailsMeta. - - The confidence in the estimated value, `1.0` is for 100% confidence. # noqa: E501 - - :param confidence: The confidence of this DetectDetailsMeta. # noqa: E501 - :type confidence: float - """ - - self._confidence = confidence - - @property - def value(self): - """Gets the value of this DetectDetailsMeta. # noqa: E501 - - The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). # noqa: E501 - - :return: The value of this DetectDetailsMeta. # noqa: E501 - :rtype: str - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this DetectDetailsMeta. - - The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/). # noqa: E501 - - :param value: The value of this DetectDetailsMeta. # noqa: E501 - :type value: str - """ - - self._value = value - - @property - def name(self): - """Gets the name of this DetectDetailsMeta. # noqa: E501 - - The name of the attribute. # noqa: E501 - - :return: The name of this DetectDetailsMeta. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this DetectDetailsMeta. - - The name of the attribute. # noqa: E501 - - :param name: The name of this DetectDetailsMeta. # noqa: E501 - :type name: str - """ - - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectDetailsMeta): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectDetailsMeta): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detect_request.py b/regula/facesdk/webclient/gen/model/detect_request.py deleted file mode 100644 index 7409684..0000000 --- a/regula/facesdk/webclient/gen/model/detect_request.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tag': 'str', - 'process_param': 'ProcessParam', - 'image': 'str', - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'tag': 'tag', - 'process_param': 'processParam', - 'image': 'image', - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, tag=None, process_param=None, image=None, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """DetectRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tag = None - self._process_param = None - self._image = None - self._tenant = None - self._env = None - self.discriminator = None - - if tag is not None: - self.tag = tag - if process_param is not None: - self.process_param = process_param - if image is not None: - self.image = image - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def tag(self): - """Gets the tag of this DetectRequest. # noqa: E501 - - Session identificator, should be unique for each session. # noqa: E501 - - :return: The tag of this DetectRequest. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this DetectRequest. - - Session identificator, should be unique for each session. # noqa: E501 - - :param tag: The tag of this DetectRequest. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def process_param(self): - """Gets the process_param of this DetectRequest. # noqa: E501 - - - :return: The process_param of this DetectRequest. # noqa: E501 - :rtype: ProcessParam - """ - return self._process_param - - @process_param.setter - def process_param(self, process_param): - """Sets the process_param of this DetectRequest. - - - :param process_param: The process_param of this DetectRequest. # noqa: E501 - :type process_param: ProcessParam - """ - - self._process_param = process_param - - @property - def image(self): - """Gets the image of this DetectRequest. # noqa: E501 - - Base64-encoded image. # noqa: E501 - - :return: The image of this DetectRequest. # noqa: E501 - :rtype: str - """ - return self._image - - @image.setter - def image(self, image): - """Sets the image of this DetectRequest. - - Base64-encoded image. # noqa: E501 - - :param image: The image of this DetectRequest. # noqa: E501 - :type image: str - """ - - self._image = image - - @property - def tenant(self): - """Gets the tenant of this DetectRequest. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this DetectRequest. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this DetectRequest. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this DetectRequest. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this DetectRequest. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this DetectRequest. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this DetectRequest. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this DetectRequest. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detect_request_attributes.py b/regula/facesdk/webclient/gen/model/detect_request_attributes.py deleted file mode 100644 index c2b9f06..0000000 --- a/regula/facesdk/webclient/gen/model/detect_request_attributes.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - Regula FaceSDK Web API # Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 5.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectRequestAttributes(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'config': 'QualityConfigList', - } - - attribute_map = { - 'config': 'config', - } - - def __init__(self, config=None, local_vars_configuration=None): # noqa: E501 - """DetectRequestAttributes - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._config = None - self.discriminator = None - - if config is not None: - self.config = config - - @property - def config(self): - """Gets the config of this DetectRequestAttributes. # noqa: E501 - - - :return: The config of this DetectRequestAttributes. # noqa: E501 - :rtype: QualityConfigList - """ - return self._config - - @config.setter - def config(self, config): - """Sets the config of this DetectRequestAttributes. - - - :param config: The config of this DetectRequestAttributes. # noqa: E501 - :type config: QualityConfigList - """ - - self._config = config - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectRequestAttributes): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectRequestAttributes): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detect_response.py b/regula/facesdk/webclient/gen/model/detect_response.py deleted file mode 100644 index 0d6fa03..0000000 --- a/regula/facesdk/webclient/gen/model/detect_response.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'FaceSDKResultCode', - 'results': 'DetectResult', - } - - attribute_map = { - 'code': 'code', - 'results': 'results', - } - - def __init__(self, code=None, results=None, local_vars_configuration=None): # noqa: E501 - """DetectResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._results = None - self.discriminator = None - - self.code = code - if results is not None: - self.results = results - - @property - def code(self): - """Gets the code of this DetectResponse. # noqa: E501 - - - :return: The code of this DetectResponse. # noqa: E501 - :rtype: FaceSDKResultCode - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this DetectResponse. - - - :param code: The code of this DetectResponse. # noqa: E501 - :type code: FaceSDKResultCode - """ - if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - - self._code = code - - @property - def results(self): - """Gets the results of this DetectResponse. # noqa: E501 - - - :return: The results of this DetectResponse. # noqa: E501 - :rtype: DetectResult - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this DetectResponse. - - - :param results: The results of this DetectResponse. # noqa: E501 - :type results: DetectResult - """ - - self._results = results - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detect_response_all_of.py b/regula/facesdk/webclient/gen/model/detect_response_all_of.py deleted file mode 100644 index 5024966..0000000 --- a/regula/facesdk/webclient/gen/model/detect_response_all_of.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectResponseAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'results': 'DetectResult', - } - - attribute_map = { - 'results': 'results', - } - - def __init__(self, results=None, local_vars_configuration=None): # noqa: E501 - """DetectResponseAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._results = None - self.discriminator = None - - if results is not None: - self.results = results - - @property - def results(self): - """Gets the results of this DetectResponseAllOf. # noqa: E501 - - - :return: The results of this DetectResponseAllOf. # noqa: E501 - :rtype: DetectResult - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this DetectResponseAllOf. - - - :param results: The results of this DetectResponseAllOf. # noqa: E501 - :type results: DetectResult - """ - - self._results = results - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectResponseAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectResponseAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detect_result.py b/regula/facesdk/webclient/gen/model/detect_result.py deleted file mode 100644 index 88ca53c..0000000 --- a/regula/facesdk/webclient/gen/model/detect_result.py +++ /dev/null @@ -1,235 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectResult(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'detections': '[Detection]', - 'detector_type': 'int', - 'landmarks_type': 'int', - 'scenario': 'str', - 'elapsed_time': 'float', - } - - attribute_map = { - 'detections': 'detections', - 'detector_type': 'detectorType', - 'landmarks_type': 'landmarksType', - 'scenario': 'scenario', - 'elapsed_time': 'elapsedTime', - } - - def __init__(self, detections=None, detector_type=None, landmarks_type=None, scenario=None, elapsed_time=None, local_vars_configuration=None): # noqa: E501 - """DetectResult - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._detections = None - self._detector_type = None - self._landmarks_type = None - self._scenario = None - self._elapsed_time = None - self.discriminator = None - - self.detections = detections - if detector_type is not None: - self.detector_type = detector_type - if landmarks_type is not None: - self.landmarks_type = landmarks_type - if scenario is not None: - self.scenario = scenario - if elapsed_time is not None: - self.elapsed_time = elapsed_time - - @property - def detections(self): - """Gets the detections of this DetectResult. # noqa: E501 - - The array of performed checks. # noqa: E501 - - :return: The detections of this DetectResult. # noqa: E501 - :rtype: [Detection] - """ - return self._detections - - @detections.setter - def detections(self, detections): - """Sets the detections of this DetectResult. - - The array of performed checks. # noqa: E501 - - :param detections: The detections of this DetectResult. # noqa: E501 - :type detections: [Detection] - """ - if self.local_vars_configuration.client_side_validation and detections is None: # noqa: E501 - raise ValueError("Invalid value for `detections`, must not be `None`") # noqa: E501 - - self._detections = detections - - @property - def detector_type(self): - """Gets the detector_type of this DetectResult. # noqa: E501 - - Internal. # noqa: E501 - - :return: The detector_type of this DetectResult. # noqa: E501 - :rtype: int - """ - return self._detector_type - - @detector_type.setter - def detector_type(self, detector_type): - """Sets the detector_type of this DetectResult. - - Internal. # noqa: E501 - - :param detector_type: The detector_type of this DetectResult. # noqa: E501 - :type detector_type: int - """ - - self._detector_type = detector_type - - @property - def landmarks_type(self): - """Gets the landmarks_type of this DetectResult. # noqa: E501 - - Internal. # noqa: E501 - - :return: The landmarks_type of this DetectResult. # noqa: E501 - :rtype: int - """ - return self._landmarks_type - - @landmarks_type.setter - def landmarks_type(self, landmarks_type): - """Sets the landmarks_type of this DetectResult. - - Internal. # noqa: E501 - - :param landmarks_type: The landmarks_type of this DetectResult. # noqa: E501 - :type landmarks_type: int - """ - - self._landmarks_type = landmarks_type - - @property - def scenario(self): - """Gets the scenario of this DetectResult. # noqa: E501 - - The face detection scenario that was set in the `processParam.scenario` field of the request. # noqa: E501 - - :return: The scenario of this DetectResult. # noqa: E501 - :rtype: str - """ - return self._scenario - - @scenario.setter - def scenario(self, scenario): - """Sets the scenario of this DetectResult. - - The face detection scenario that was set in the `processParam.scenario` field of the request. # noqa: E501 - - :param scenario: The scenario of this DetectResult. # noqa: E501 - :type scenario: str - """ - - self._scenario = scenario - - @property - def elapsed_time(self): - """Gets the elapsed_time of this DetectResult. # noqa: E501 - - Server processing time, ms. Does not include the time taken to receive the request or deliver the response. # noqa: E501 - - :return: The elapsed_time of this DetectResult. # noqa: E501 - :rtype: float - """ - return self._elapsed_time - - @elapsed_time.setter - def elapsed_time(self, elapsed_time): - """Sets the elapsed_time of this DetectResult. - - Server processing time, ms. Does not include the time taken to receive the request or deliver the response. # noqa: E501 - - :param elapsed_time: The elapsed_time of this DetectResult. # noqa: E501 - :type elapsed_time: float - """ - - self._elapsed_time = elapsed_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectResult): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectResult): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detection.py b/regula/facesdk/webclient/gen/model/detection.py deleted file mode 100644 index e8e9f92..0000000 --- a/regula/facesdk/webclient/gen/model/detection.py +++ /dev/null @@ -1,230 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class Detection(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'crop': 'str', - 'attributes': 'DetectionAttributes', - 'landmarks': '[[int]]', - 'quality': 'DetectionQuality', - 'roi': 'FaceRectangular', - } - - attribute_map = { - 'crop': 'crop', - 'attributes': 'attributes', - 'landmarks': 'landmarks', - 'quality': 'quality', - 'roi': 'roi', - } - - def __init__(self, crop=None, attributes=None, landmarks=None, quality=None, roi=None, local_vars_configuration=None): # noqa: E501 - """Detection - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._crop = None - self._attributes = None - self._landmarks = None - self._quality = None - self._roi = None - self.discriminator = None - - if crop is not None: - self.crop = crop - if attributes is not None: - self.attributes = attributes - self.landmarks = landmarks - if quality is not None: - self.quality = quality - self.roi = roi - - @property - def crop(self): - """Gets the crop of this Detection. # noqa: E501 - - Base64-encoded image. # noqa: E501 - - :return: The crop of this Detection. # noqa: E501 - :rtype: str - """ - return self._crop - - @crop.setter - def crop(self, crop): - """Sets the crop of this Detection. - - Base64-encoded image. # noqa: E501 - - :param crop: The crop of this Detection. # noqa: E501 - :type crop: str - """ - - self._crop = crop - - @property - def attributes(self): - """Gets the attributes of this Detection. # noqa: E501 - - - :return: The attributes of this Detection. # noqa: E501 - :rtype: DetectionAttributes - """ - return self._attributes - - @attributes.setter - def attributes(self, attributes): - """Sets the attributes of this Detection. - - - :param attributes: The attributes of this Detection. # noqa: E501 - :type attributes: DetectionAttributes - """ - - self._attributes = attributes - - @property - def landmarks(self): - """Gets the landmarks of this Detection. # noqa: E501 - - Absolute coordinates (X,Y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips. # noqa: E501 - - :return: The landmarks of this Detection. # noqa: E501 - :rtype: [[int]] - """ - return self._landmarks - - @landmarks.setter - def landmarks(self, landmarks): - """Sets the landmarks of this Detection. - - Absolute coordinates (X,Y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips. # noqa: E501 - - :param landmarks: The landmarks of this Detection. # noqa: E501 - :type landmarks: [[int]] - """ - if self.local_vars_configuration.client_side_validation and landmarks is None: # noqa: E501 - raise ValueError("Invalid value for `landmarks`, must not be `None`") # noqa: E501 - - self._landmarks = landmarks - - @property - def quality(self): - """Gets the quality of this Detection. # noqa: E501 - - - :return: The quality of this Detection. # noqa: E501 - :rtype: DetectionQuality - """ - return self._quality - - @quality.setter - def quality(self, quality): - """Sets the quality of this Detection. - - - :param quality: The quality of this Detection. # noqa: E501 - :type quality: DetectionQuality - """ - - self._quality = quality - - @property - def roi(self): - """Gets the roi of this Detection. # noqa: E501 - - - :return: The roi of this Detection. # noqa: E501 - :rtype: FaceRectangular - """ - return self._roi - - @roi.setter - def roi(self, roi): - """Sets the roi of this Detection. - - - :param roi: The roi of this Detection. # noqa: E501 - :type roi: FaceRectangular - """ - if self.local_vars_configuration.client_side_validation and roi is None: # noqa: E501 - raise ValueError("Invalid value for `roi`, must not be `None`") # noqa: E501 - - self._roi = roi - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Detection): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Detection): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detection_attributes.py b/regula/facesdk/webclient/gen/model/detection_attributes.py deleted file mode 100644 index c0226fa..0000000 --- a/regula/facesdk/webclient/gen/model/detection_attributes.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectionAttributes(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'details': '[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]', - 'elapsed_time': 'float', - } - - attribute_map = { - 'details': 'details', - 'elapsed_time': 'elapsedTime', - } - - def __init__(self, details=None, elapsed_time=None, local_vars_configuration=None): # noqa: E501 - """DetectionAttributes - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._details = None - self._elapsed_time = None - self.discriminator = None - - if details is not None: - self.details = details - if elapsed_time is not None: - self.elapsed_time = elapsed_time - - @property - def details(self): - """Gets the details of this DetectionAttributes. # noqa: E501 - - Attributes assessment details. Returns `DetectDetailsMeta` or `DetectAttributesDetails`. # noqa: E501 - - :return: The details of this DetectionAttributes. # noqa: E501 - :rtype: [bool, date, datetime, dict, float, int, list, str, none_type] - """ - return self._details - - @details.setter - def details(self, details): - """Sets the details of this DetectionAttributes. - - Attributes assessment details. Returns `DetectDetailsMeta` or `DetectAttributesDetails`. # noqa: E501 - - :param details: The details of this DetectionAttributes. # noqa: E501 - :type details: [bool, date, datetime, dict, float, int, list, str, none_type] - """ - - self._details = details - - @property - def elapsed_time(self): - """Gets the elapsed_time of this DetectionAttributes. # noqa: E501 - - Server processing time for attribute detection, ms. # noqa: E501 - - :return: The elapsed_time of this DetectionAttributes. # noqa: E501 - :rtype: float - """ - return self._elapsed_time - - @elapsed_time.setter - def elapsed_time(self, elapsed_time): - """Sets the elapsed_time of this DetectionAttributes. - - Server processing time for attribute detection, ms. # noqa: E501 - - :param elapsed_time: The elapsed_time of this DetectionAttributes. # noqa: E501 - :type elapsed_time: float - """ - - self._elapsed_time = elapsed_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectionAttributes): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectionAttributes): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detection_face.py b/regula/facesdk/webclient/gen/model/detection_face.py deleted file mode 100644 index 3667449..0000000 --- a/regula/facesdk/webclient/gen/model/detection_face.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectionFace(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'face_index': 'float', - 'landmarks': '[[float]]', - 'rotation_angle': 'float', - 'roi': 'FaceRectangular', - 'crop': 'str', - } - - attribute_map = { - 'face_index': 'faceIndex', - 'landmarks': 'landmarks', - 'rotation_angle': 'rotationAngle', - 'roi': 'roi', - 'crop': 'crop', - } - - def __init__(self, face_index=None, landmarks=None, rotation_angle=None, roi=None, crop=None, local_vars_configuration=None): # noqa: E501 - """DetectionFace - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._face_index = None - self._landmarks = None - self._rotation_angle = None - self._roi = None - self._crop = None - self.discriminator = None - - if face_index is not None: - self.face_index = face_index - if landmarks is not None: - self.landmarks = landmarks - if rotation_angle is not None: - self.rotation_angle = rotation_angle - if roi is not None: - self.roi = roi - if crop is not None: - self.crop = crop - - @property - def face_index(self): - """Gets the face_index of this DetectionFace. # noqa: E501 - - The detected face index number. # noqa: E501 - - :return: The face_index of this DetectionFace. # noqa: E501 - :rtype: float - """ - return self._face_index - - @face_index.setter - def face_index(self, face_index): - """Sets the face_index of this DetectionFace. - - The detected face index number. # noqa: E501 - - :param face_index: The face_index of this DetectionFace. # noqa: E501 - :type face_index: float - """ - - self._face_index = face_index - - @property - def landmarks(self): - """Gets the landmarks of this DetectionFace. # noqa: E501 - - Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips. # noqa: E501 - - :return: The landmarks of this DetectionFace. # noqa: E501 - :rtype: [[float]] - """ - return self._landmarks - - @landmarks.setter - def landmarks(self, landmarks): - """Sets the landmarks of this DetectionFace. - - Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips. # noqa: E501 - - :param landmarks: The landmarks of this DetectionFace. # noqa: E501 - :type landmarks: [[float]] - """ - - self._landmarks = landmarks - - @property - def rotation_angle(self): - """Gets the rotation_angle of this DetectionFace. # noqa: E501 - - Angle of rotation of the face from the vertical axis, degrees. # noqa: E501 - - :return: The rotation_angle of this DetectionFace. # noqa: E501 - :rtype: float - """ - return self._rotation_angle - - @rotation_angle.setter - def rotation_angle(self, rotation_angle): - """Sets the rotation_angle of this DetectionFace. - - Angle of rotation of the face from the vertical axis, degrees. # noqa: E501 - - :param rotation_angle: The rotation_angle of this DetectionFace. # noqa: E501 - :type rotation_angle: float - """ - - self._rotation_angle = rotation_angle - - @property - def roi(self): - """Gets the roi of this DetectionFace. # noqa: E501 - - - :return: The roi of this DetectionFace. # noqa: E501 - :rtype: FaceRectangular - """ - return self._roi - - @roi.setter - def roi(self, roi): - """Sets the roi of this DetectionFace. - - - :param roi: The roi of this DetectionFace. # noqa: E501 - :type roi: FaceRectangular - """ - - self._roi = roi - - @property - def crop(self): - """Gets the crop of this DetectionFace. # noqa: E501 - - Base64-encoded aligned and cropped portrait. # noqa: E501 - - :return: The crop of this DetectionFace. # noqa: E501 - :rtype: str - """ - return self._crop - - @crop.setter - def crop(self, crop): - """Sets the crop of this DetectionFace. - - Base64-encoded aligned and cropped portrait. # noqa: E501 - - :param crop: The crop of this DetectionFace. # noqa: E501 - :type crop: str - """ - - self._crop = crop - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectionFace): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectionFace): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/detection_quality.py b/regula/facesdk/webclient/gen/model/detection_quality.py deleted file mode 100644 index 5c588e9..0000000 --- a/regula/facesdk/webclient/gen/model/detection_quality.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DetectionQuality(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'non_compliant': '[FaceQualityConfigName]', - 'details_groups': '[QualityDetailsGroups]', - 'details': '[QualityDetail]', - 'score': 'float', - 'elapsed_time': 'float', - } - - attribute_map = { - 'non_compliant': 'nonCompliant', - 'details_groups': 'detailsGroups', - 'details': 'details', - 'score': 'score', - 'elapsed_time': 'elapsedTime', - } - - def __init__(self, non_compliant=None, details_groups=None, details=None, score=None, elapsed_time=None, local_vars_configuration=None): # noqa: E501 - """DetectionQuality - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._non_compliant = None - self._details_groups = None - self._details = None - self._score = None - self._elapsed_time = None - self.discriminator = None - - if non_compliant is not None: - self.non_compliant = non_compliant - if details_groups is not None: - self.details_groups = details_groups - if details is not None: - self.details = details - if score is not None: - self.score = score - if elapsed_time is not None: - self.elapsed_time = elapsed_time - - @property - def non_compliant(self): - """Gets the non_compliant of this DetectionQuality. # noqa: E501 - - Non-compliant assessment characteristics. # noqa: E501 - - :return: The non_compliant of this DetectionQuality. # noqa: E501 - :rtype: [FaceQualityConfigName] - """ - return self._non_compliant - - @non_compliant.setter - def non_compliant(self, non_compliant): - """Sets the non_compliant of this DetectionQuality. - - Non-compliant assessment characteristics. # noqa: E501 - - :param non_compliant: The non_compliant of this DetectionQuality. # noqa: E501 - :type non_compliant: [FaceQualityConfigName] - """ - - self._non_compliant = non_compliant - - @property - def details_groups(self): - """Gets the details_groups of this DetectionQuality. # noqa: E501 - - Assessment results for each [group of characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/). # noqa: E501 - - :return: The details_groups of this DetectionQuality. # noqa: E501 - :rtype: [QualityDetailsGroups] - """ - return self._details_groups - - @details_groups.setter - def details_groups(self, details_groups): - """Sets the details_groups of this DetectionQuality. - - Assessment results for each [group of characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/). # noqa: E501 - - :param details_groups: The details_groups of this DetectionQuality. # noqa: E501 - :type details_groups: [QualityDetailsGroups] - """ - - self._details_groups = details_groups - - @property - def details(self): - """Gets the details of this DetectionQuality. # noqa: E501 - - Assessment characteristics that were set in the request. # noqa: E501 - - :return: The details of this DetectionQuality. # noqa: E501 - :rtype: [QualityDetail] - """ - return self._details - - @details.setter - def details(self, details): - """Sets the details of this DetectionQuality. - - Assessment characteristics that were set in the request. # noqa: E501 - - :param details: The details of this DetectionQuality. # noqa: E501 - :type details: [QualityDetail] - """ - - self._details = details - - @property - def score(self): - """Gets the score of this DetectionQuality. # noqa: E501 - - Returns the estimated portrait quality assessment result, a number from `0` to `1`, where `1` is for absolute compliance. # noqa: E501 - - :return: The score of this DetectionQuality. # noqa: E501 - :rtype: float - """ - return self._score - - @score.setter - def score(self, score): - """Sets the score of this DetectionQuality. - - Returns the estimated portrait quality assessment result, a number from `0` to `1`, where `1` is for absolute compliance. # noqa: E501 - - :param score: The score of this DetectionQuality. # noqa: E501 - :type score: float - """ - - self._score = score - - @property - def elapsed_time(self): - """Gets the elapsed_time of this DetectionQuality. # noqa: E501 - - Server processing time for quality assessment, ms. # noqa: E501 - - :return: The elapsed_time of this DetectionQuality. # noqa: E501 - :rtype: float - """ - return self._elapsed_time - - @elapsed_time.setter - def elapsed_time(self, elapsed_time): - """Sets the elapsed_time of this DetectionQuality. - - Server processing time for quality assessment, ms. # noqa: E501 - - :param elapsed_time: The elapsed_time of this DetectionQuality. # noqa: E501 - :type elapsed_time: float - """ - - self._elapsed_time = elapsed_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DetectionQuality): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DetectionQuality): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/device_info.py b/regula/facesdk/webclient/gen/model/device_info.py deleted file mode 100644 index 16b09a5..0000000 --- a/regula/facesdk/webclient/gen/model/device_info.py +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class DeviceInfo(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'app': 'str', - 'license_id': 'str, none_type', - 'license_serial': 'str, none_type', - 'license_valid_until': 'datetime, none_type', - 'version': 'str, none_type', - } - - attribute_map = { - 'app': 'app', - 'license_id': 'licenseId', - 'license_serial': 'licenseSerial', - 'license_valid_until': 'licenseValidUntil', - 'version': 'version', - } - - def __init__(self, app=None, license_id=None, license_serial=None, license_valid_until=None, version=None, local_vars_configuration=None): # noqa: E501 - """DeviceInfo - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._app = None - self._license_id = None - self._license_serial = None - self._license_valid_until = None - self._version = None - self.discriminator = None - - self.app = app - self.license_id = license_id - self.license_serial = license_serial - self.license_valid_until = license_valid_until - self.version = version - - @property - def app(self): - """Gets the app of this DeviceInfo. # noqa: E501 - - Application name. # noqa: E501 - - :return: The app of this DeviceInfo. # noqa: E501 - :rtype: str - """ - return self._app - - @app.setter - def app(self, app): - """Sets the app of this DeviceInfo. - - Application name. # noqa: E501 - - :param app: The app of this DeviceInfo. # noqa: E501 - :type app: str - """ - if self.local_vars_configuration.client_side_validation and app is None: # noqa: E501 - raise ValueError("Invalid value for `app`, must not be `None`") # noqa: E501 - - self._app = app - - @property - def license_id(self): - """Gets the license_id of this DeviceInfo. # noqa: E501 - - Unique license identifier. # noqa: E501 - - :return: The license_id of this DeviceInfo. # noqa: E501 - :rtype: str, none_type - """ - return self._license_id - - @license_id.setter - def license_id(self, license_id): - """Sets the license_id of this DeviceInfo. - - Unique license identifier. # noqa: E501 - - :param license_id: The license_id of this DeviceInfo. # noqa: E501 - :type license_id: str, none_type - """ - - self._license_id = license_id - - @property - def license_serial(self): - """Gets the license_serial of this DeviceInfo. # noqa: E501 - - License serial number. # noqa: E501 - - :return: The license_serial of this DeviceInfo. # noqa: E501 - :rtype: str, none_type - """ - return self._license_serial - - @license_serial.setter - def license_serial(self, license_serial): - """Sets the license_serial of this DeviceInfo. - - License serial number. # noqa: E501 - - :param license_serial: The license_serial of this DeviceInfo. # noqa: E501 - :type license_serial: str, none_type - """ - - self._license_serial = license_serial - - @property - def license_valid_until(self): - """Gets the license_valid_until of this DeviceInfo. # noqa: E501 - - License validity date. # noqa: E501 - - :return: The license_valid_until of this DeviceInfo. # noqa: E501 - :rtype: datetime, none_type - """ - return self._license_valid_until - - @license_valid_until.setter - def license_valid_until(self, license_valid_until): - """Sets the license_valid_until of this DeviceInfo. - - License validity date. # noqa: E501 - - :param license_valid_until: The license_valid_until of this DeviceInfo. # noqa: E501 - :type license_valid_until: datetime, none_type - """ - - self._license_valid_until = license_valid_until - - @property - def version(self): - """Gets the version of this DeviceInfo. # noqa: E501 - - Product version. # noqa: E501 - - :return: The version of this DeviceInfo. # noqa: E501 - :rtype: str, none_type - """ - return self._version - - @version.setter - def version(self, version): - """Sets the version of this DeviceInfo. - - Product version. # noqa: E501 - - :param version: The version of this DeviceInfo. # noqa: E501 - :type version: str, none_type - """ - - self._version = version - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DeviceInfo): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, DeviceInfo): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_align_type_quality.py b/regula/facesdk/webclient/gen/model/face_align_type_quality.py deleted file mode 100644 index 1023543..0000000 --- a/regula/facesdk/webclient/gen/model/face_align_type_quality.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - Regula FaceSDK Web API # Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 4.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceAlignTypeQuality(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - ALIGN_3x4 = int(0) - - "" - ALIGN_4x5 = int(1) - - "" - ALIGN_2x3 = int(2) - - "" - ALIGN_1x1 = int(3) - - "" - ALIGN_7x9 = int(4) - - allowable_values = [ALIGN_3x4, ALIGN_4x5, ALIGN_2x3, ALIGN_1x1, ALIGN_7x9] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceAlignTypeQuality - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceAlignTypeQuality): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceAlignTypeQuality): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_attribute.py b/regula/facesdk/webclient/gen/model/face_attribute.py deleted file mode 100644 index 82b9e5b..0000000 --- a/regula/facesdk/webclient/gen/model/face_attribute.py +++ /dev/null @@ -1,133 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceAttribute(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - AGE = "Age" - - "" - EMOTION = "Emotion" - - "" - EYE_LEFT = "EyeLeft" - - "" - EYE_RIGHT = "EyeRight" - - "" - SMILE = "Smile" - - "" - GLASSES = "Glasses" - - "" - HEAD_COVERING = "HeadCovering" - - "" - FOREHEAD_COVERING = "ForeheadCovering" - - "" - MOUTH = "Mouth" - - "" - MEDICAL_MASK = "MedicalMask" - - "" - OCCLUSION = "Occlusion" - - "" - STRONG_MAKEUP = "StrongMakeup" - - "" - HEADPHONES = "Headphones" - - allowable_values = [AGE, EMOTION, EYE_LEFT, EYE_RIGHT, SMILE, GLASSES, HEAD_COVERING, FOREHEAD_COVERING, MOUTH, MEDICAL_MASK, OCCLUSION, STRONG_MAKEUP, HEADPHONES] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceAttribute - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceAttribute): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceAttribute): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_image_quality_align_type.py b/regula/facesdk/webclient/gen/model/face_image_quality_align_type.py deleted file mode 100644 index 3edfa81..0000000 --- a/regula/facesdk/webclient/gen/model/face_image_quality_align_type.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceImageQualityAlignType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - ALIGN_3x4 = int(0) - - "" - ALIGN_4x5 = int(1) - - "" - ALIGN_2x3 = int(2) - - "" - ALIGN_1x1 = int(3) - - "" - ALIGN_7x9 = int(4) - - allowable_values = [ALIGN_3x4, ALIGN_4x5, ALIGN_2x3, ALIGN_1x1, ALIGN_7x9] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceImageQualityAlignType - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceImageQualityAlignType): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceImageQualityAlignType): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_image_quality_groups.py b/regula/facesdk/webclient/gen/model/face_image_quality_groups.py deleted file mode 100644 index a3606c7..0000000 --- a/regula/facesdk/webclient/gen/model/face_image_quality_groups.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceImageQualityGroups(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - IMAGE_CHARACTERISTICS = int(1) - - "" - HEAD_SIZE_AND_POSITIONS = int(2) - - "" - FACE_QUALITY = int(3) - - "" - EYES_CHARACTERISTICS = int(4) - - "" - SHADOWS_AND_LIGHTNING = int(5) - - "" - POSE_AND_EXPRESSION = int(6) - - "" - HEAD_OCCLUSION = int(7) - - "" - BACKGROUND = int(8) - - allowable_values = [IMAGE_CHARACTERISTICS, HEAD_SIZE_AND_POSITIONS, FACE_QUALITY, EYES_CHARACTERISTICS, SHADOWS_AND_LIGHTNING, POSE_AND_EXPRESSION, HEAD_OCCLUSION, BACKGROUND] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceImageQualityGroups - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceImageQualityGroups): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceImageQualityGroups): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_image_quality_groups_strings.py b/regula/facesdk/webclient/gen/model/face_image_quality_groups_strings.py deleted file mode 100644 index ba6b484..0000000 --- a/regula/facesdk/webclient/gen/model/face_image_quality_groups_strings.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceImageQualityGroupsStrings(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - IMAGE_CHARACTERISTICS = "ImageCharacteristics" - - "" - HEAD_SIZE_AND_POSITIONS = "HeadSizeAndPosition" - - "" - FACE_QUALITY = "FaceQuality" - - "" - EYES_CHARACTERISTICS = "EyesCharacteristics" - - "" - SHADOWS_AND_LIGHTNING = "ShadowsAndLightning" - - "" - POSE_AND_EXPRESSION = "PoseAndExpression" - - "" - HEAD_OCCLUSION = "HeadOcclusion" - - "" - BACKGROUND = "Background" - - allowable_values = [IMAGE_CHARACTERISTICS, HEAD_SIZE_AND_POSITIONS, FACE_QUALITY, EYES_CHARACTERISTICS, SHADOWS_AND_LIGHTNING, POSE_AND_EXPRESSION, HEAD_OCCLUSION, BACKGROUND] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceImageQualityGroupsStrings - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceImageQualityGroupsStrings): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceImageQualityGroupsStrings): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_image_quality_status.py b/regula/facesdk/webclient/gen/model/face_image_quality_status.py deleted file mode 100644 index c16cfd6..0000000 --- a/regula/facesdk/webclient/gen/model/face_image_quality_status.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceImageQualityStatus(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - QUALITY_STATUS_FALSE = int(0) - - "" - QUALITY_STATUS_TRUE = int(1) - - "" - QUALITY_STATUS_UNDETERMINED = int(2) - - allowable_values = [QUALITY_STATUS_FALSE, QUALITY_STATUS_TRUE, QUALITY_STATUS_UNDETERMINED] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceImageQualityStatus - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceImageQualityStatus): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceImageQualityStatus): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_quality_config_name.py b/regula/facesdk/webclient/gen/model/face_quality_config_name.py deleted file mode 100644 index ac9a111..0000000 --- a/regula/facesdk/webclient/gen/model/face_quality_config_name.py +++ /dev/null @@ -1,238 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceQualityConfigName(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - IMAGE_WIDTH = "ImageWidth" - - "" - IMAGE_HEIGHT = "ImageHeight" - - "" - IMAGE_WIDTH_TO_HEIGHT = "ImageWidthToHeight" - - "" - IMAGE_CHANNELS_NUMBER = "ImageChannelsNumber" - - "" - PADDING_RATIO = "PaddingRatio" - - "" - FACE_MID_POINT_HORIZONTAL_POSITION = "FaceMidPointHorizontalPosition" - - "" - FACE_MID_POINT_VERTICAL_POSITION = "FaceMidPointVerticalPosition" - - "" - HEAD_WIDTH_RATIO = "HeadWidthRatio" - - "" - HEAD_HEIGHT_RATIO = "HeadHeightRatio" - - "" - EYES_DISTANCE = "EyesDistance" - - "" - YAW = "Yaw" - - "" - PITCH = "Pitch" - - "" - ROLL = "Roll" - - "" - BLUR_LEVEL = "BlurLevel" - - "" - NOISE_LEVEL = "NoiseLevel" - - "" - EYE_RIGHT_CLOSED = "EyeRightClosed" - - "" - EYE_LEFT_CLOSED = "EyeLeftClosed" - - "" - EYE_RIGHT_OCCLUDED = "EyeRightOccluded" - - "" - EYE_LEFT_OCCLUDED = "EyeLeftOccluded" - - "" - EYES_RED = "EyesRed" - - "" - EYE_RIGHT_COVERED_WITH_HAIR = "EyeRightCoveredWithHair" - - "" - EYE_LEFT_COVERED_WITH_HAIR = "EyeLeftCoveredWithHair" - - "" - OFF_GAZE = "OffGaze" - - "" - FACE_DYNAMIC_RANGE = "FaceDynamicRange" - - "" - UNNATURAL_SKIN_TONE = "UnnaturalSkinTone" - - "" - TOO_DARK = "TooDark" - - "" - TOO_LIGHT = "TooLight" - - "" - FACE_GLARE = "FaceGlare" - - "" - SHADOWS_ON_FACE = "ShadowsOnFace" - - "" - DARK_GLASSES = "DarkGlasses" - - "" - REFLECTION_ON_GLASSES = "ReflectionOnGlasses" - - "" - FRAMES_TOO_HEAVY = "FramesTooHeavy" - - "" - FACE_OCCLUDED = "FaceOccluded" - - "" - HEAD_COVERING = "HeadCovering" - - "" - BACKGROUND_UNIFORMITY = "BackgroundUniformity" - - "" - SHADOWS_ON_BACKGROUND = "ShadowsOnBackground" - - "" - OTHER_FACES = "OtherFaces" - - "" - SHOULDERS_POSE = "ShouldersPose" - - "" - EXPRESSION_LEVEL = "ExpressionLevel" - - "" - MOUTH_OPEN = "MouthOpen" - - "" - FOREHEAD_COVERING = "ForeheadCovering" - - "" - SMILE = "Smile" - - "" - STRONG_MAKEUP = "StrongMakeup" - - "" - HEADPHONES = "Headphones" - - "" - MEDICAL_MASK = "MedicalMask" - - "" - BACKGROUND_COLOR_MATCH = "BackgroundColorMatch" - - "" - ART_FACE = "ArtFace" - - "" - CONTACT_LENSES = "ContactLenses" - - allowable_values = [IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_WIDTH_TO_HEIGHT, IMAGE_CHANNELS_NUMBER, PADDING_RATIO, FACE_MID_POINT_HORIZONTAL_POSITION, FACE_MID_POINT_VERTICAL_POSITION, HEAD_WIDTH_RATIO, HEAD_HEIGHT_RATIO, EYES_DISTANCE, YAW, PITCH, ROLL, BLUR_LEVEL, NOISE_LEVEL, EYE_RIGHT_CLOSED, EYE_LEFT_CLOSED, EYE_RIGHT_OCCLUDED, EYE_LEFT_OCCLUDED, EYES_RED, EYE_RIGHT_COVERED_WITH_HAIR, EYE_LEFT_COVERED_WITH_HAIR, OFF_GAZE, FACE_DYNAMIC_RANGE, UNNATURAL_SKIN_TONE, TOO_DARK, TOO_LIGHT, FACE_GLARE, SHADOWS_ON_FACE, DARK_GLASSES, REFLECTION_ON_GLASSES, FRAMES_TOO_HEAVY, FACE_OCCLUDED, HEAD_COVERING, BACKGROUND_UNIFORMITY, SHADOWS_ON_BACKGROUND, OTHER_FACES, SHOULDERS_POSE, EXPRESSION_LEVEL, MOUTH_OPEN, FOREHEAD_COVERING, SMILE, STRONG_MAKEUP, HEADPHONES, MEDICAL_MASK, BACKGROUND_COLOR_MATCH, ART_FACE, CONTACT_LENSES] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceQualityConfigName - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceQualityConfigName): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceQualityConfigName): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_quality_scenarios.py b/regula/facesdk/webclient/gen/model/face_quality_scenarios.py deleted file mode 100644 index db5f38a..0000000 --- a/regula/facesdk/webclient/gen/model/face_quality_scenarios.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceQualityScenarios(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - OLD_MODE = "OldMode" - - "" - QUALITY_FULL = "QualityFull" - - "" - QUALITY_ICAO = "QualityICAO" - - "" - QUALITY_VISA_SCHENGEN = "QualityVisaSchengen" - - "" - QUALITY_VISA_USA = "QualityVisaUSA" - - "" - CROP_CENTRAL_FACE = "CropCentralFace" - - "" - CROP_ALL_FACES = "CropAllFaces" - - "" - THUMBNAIL = "Thumbnail" - - "" - ATTRIBUTES_ALL = "AttributesAll" - - "" - EMPTY = "" - - allowable_values = [OLD_MODE, QUALITY_FULL, QUALITY_ICAO, QUALITY_VISA_SCHENGEN, QUALITY_VISA_USA, CROP_CENTRAL_FACE, CROP_ALL_FACES, THUMBNAIL, ATTRIBUTES_ALL, EMPTY] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceQualityScenarios - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceQualityScenarios): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceQualityScenarios): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_quality_status.py b/regula/facesdk/webclient/gen/model/face_quality_status.py deleted file mode 100644 index 9fd5183..0000000 --- a/regula/facesdk/webclient/gen/model/face_quality_status.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - Regula FaceSDK Web API # Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 4.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceQualityStatus(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - QUALITY_STATUS_FALSE = int(0) - - "" - QUALITY_STATUS_TRUE = int(1) - - "" - QUALITY_STATUS_UNDETERMINED = int(2) - - allowable_values = [QUALITY_STATUS_FALSE, QUALITY_STATUS_TRUE, QUALITY_STATUS_UNDETERMINED] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceQualityStatus - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceQualityStatus): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceQualityStatus): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_rectangular.py b/regula/facesdk/webclient/gen/model/face_rectangular.py deleted file mode 100644 index c981816..0000000 --- a/regula/facesdk/webclient/gen/model/face_rectangular.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceRectangular(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceRectangular - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceRectangular): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceRectangular): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_sdk_result.py b/regula/facesdk/webclient/gen/model/face_sdk_result.py deleted file mode 100644 index d80d76e..0000000 --- a/regula/facesdk/webclient/gen/model/face_sdk_result.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceSDKResult(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'FaceSDKResultCode', - } - - attribute_map = { - 'code': 'code', - } - - def __init__(self, code=None, local_vars_configuration=None): # noqa: E501 - """FaceSDKResult - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self.discriminator = None - - self.code = code - - @property - def code(self): - """Gets the code of this FaceSDKResult. # noqa: E501 - - - :return: The code of this FaceSDKResult. # noqa: E501 - :rtype: FaceSDKResultCode - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this FaceSDKResult. - - - :param code: The code of this FaceSDKResult. # noqa: E501 - :type code: FaceSDKResultCode - """ - if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - - self._code = code - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceSDKResult): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceSDKResult): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/face_sdk_result_code.py b/regula/facesdk/webclient/gen/model/face_sdk_result_code.py deleted file mode 100644 index 6cde3bc..0000000 --- a/regula/facesdk/webclient/gen/model/face_sdk_result_code.py +++ /dev/null @@ -1,217 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FaceSDKResultCode(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - FACER_OK = int(0) - - "" - FR_IMAGE_EMPTY = int(1) - - "" - FR_FACE_NOT_DETECTED = int(2) - - "" - FR_LANDMARKS_NOT_DETECTED = int(3) - - "" - FR_FACE_ALIGHNER_FAILED = int(4) - - "" - FR_DESCRIPTOR_EXTRACTOR_ERROR = int(5) - - "" - FR_IMAGE_DECODE_ERROR = int(6) - - "" - FR_INTERNAL_ERROR = int(7) - - "" - FACER_CONFIG_ERROR = int(199) - - "" - FACER_NO_LICENSE = int(200) - - "" - FACER_IS_NOT_INITIALIZED = int(201) - - "" - FACER_COMMAND_IS_NOT_SUPPORTED = int(202) - - "" - FACER_COMMAND_PARAMS_READ_ERROR = int(203) - - "" - FACER_LESS_THAN_TWO_IMAGES_IN_REQUEST = int(224) - - "" - FACER_VIDEO_DECODE_ERROR = int(227) - - "" - FACER_NOT_ENOUGH_FRAMES = int(228) - - "" - FACER_OUTPUT_IS_NOT_DEFINED = int(229) - - "" - FACER_CLOSED_EYES_DETECTED = int(230) - - "" - FACER_LOW_QUALITY = int(231) - - "" - FACER_HIGH_ASYMMETRY = int(232) - - "" - FACER_FACE_OVER_EMOTIONAL = int(233) - - "" - FACER_SUNGLASSES_DETECTED = int(234) - - "" - FACER_SMALL_AGE = int(235) - - "" - FACER_HEADDRESS_DETECTED = int(236) - - "" - FACER_FACES_NOT_MATCHED = int(237) - - "" - FACER_IMAGES_COUNT_LIMIT_EXCEEDED = int(238) - - "" - FACER_MEDICINE_MASK_DETECTED = int(239) - - "" - FACER_OCCLUSION_DETECTED = int(240) - - "" - FACER_FOREHEAD_GLASSES_DETECTED = int(242) - - "" - FACER_MOUTH_OPENED = int(243) - - "" - FACER_ART_MASK_DETECTED = int(244) - - "" - FACER_ELECTRONIC_DEVICE_DETECTED = int(245) - - "" - FACER_TRACK_BREAK = int(246) - - "" - FACER_WRONG_GEO = int(247) - - "" - FACER_WRONG_OF = int(248) - - "" - FACER_WRONG_VIEW = int(249) - - "" - FACER_TIMEOUT_LIVENESS_TRANSACTION = int(250) - - "" - FACER_FAILED_LIVENESS_TRANSACTION = int(251) - - "" - FACER_ABORTED_LIVENESS_TRANSACTION = int(252) - - "" - FACER_GENERAL_ERROR = int(253) - - "" - FACER_PASSIVE_LIVENESS_FAIL = int(254) - - allowable_values = [FACER_OK, FR_IMAGE_EMPTY, FR_FACE_NOT_DETECTED, FR_LANDMARKS_NOT_DETECTED, FR_FACE_ALIGHNER_FAILED, FR_DESCRIPTOR_EXTRACTOR_ERROR, FR_IMAGE_DECODE_ERROR, FR_INTERNAL_ERROR, FACER_CONFIG_ERROR, FACER_NO_LICENSE, FACER_IS_NOT_INITIALIZED, FACER_COMMAND_IS_NOT_SUPPORTED, FACER_COMMAND_PARAMS_READ_ERROR, FACER_LESS_THAN_TWO_IMAGES_IN_REQUEST, FACER_VIDEO_DECODE_ERROR, FACER_NOT_ENOUGH_FRAMES, FACER_OUTPUT_IS_NOT_DEFINED, FACER_CLOSED_EYES_DETECTED, FACER_LOW_QUALITY, FACER_HIGH_ASYMMETRY, FACER_FACE_OVER_EMOTIONAL, FACER_SUNGLASSES_DETECTED, FACER_SMALL_AGE, FACER_HEADDRESS_DETECTED, FACER_FACES_NOT_MATCHED, FACER_IMAGES_COUNT_LIMIT_EXCEEDED, FACER_MEDICINE_MASK_DETECTED, FACER_OCCLUSION_DETECTED, FACER_FOREHEAD_GLASSES_DETECTED, FACER_MOUTH_OPENED, FACER_ART_MASK_DETECTED, FACER_ELECTRONIC_DEVICE_DETECTED, FACER_TRACK_BREAK, FACER_WRONG_GEO, FACER_WRONG_OF, FACER_WRONG_VIEW, FACER_TIMEOUT_LIVENESS_TRANSACTION, FACER_FAILED_LIVENESS_TRANSACTION, FACER_ABORTED_LIVENESS_TRANSACTION, FACER_GENERAL_ERROR, FACER_PASSIVE_LIVENESS_FAIL] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FaceSDKResultCode - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FaceSDKResultCode): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FaceSDKResultCode): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/faces_response.py b/regula/facesdk/webclient/gen/model/faces_response.py deleted file mode 100644 index 5f9065b..0000000 --- a/regula/facesdk/webclient/gen/model/faces_response.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FacesResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'face_index': 'float', - 'landmarks': '[[float]]', - 'rotation_angle': 'float', - 'roi': 'FaceRectangular', - 'crop': 'str', - 'persons': '[PersonWithImages]', - } - - attribute_map = { - 'face_index': 'faceIndex', - 'landmarks': 'landmarks', - 'rotation_angle': 'rotationAngle', - 'roi': 'roi', - 'crop': 'crop', - 'persons': 'persons', - } - - def __init__(self, face_index=None, landmarks=None, rotation_angle=None, roi=None, crop=None, persons=None, local_vars_configuration=None): # noqa: E501 - """FacesResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._face_index = None - self._landmarks = None - self._rotation_angle = None - self._roi = None - self._crop = None - self._persons = None - self.discriminator = None - - if face_index is not None: - self.face_index = face_index - if landmarks is not None: - self.landmarks = landmarks - if rotation_angle is not None: - self.rotation_angle = rotation_angle - if roi is not None: - self.roi = roi - if crop is not None: - self.crop = crop - if persons is not None: - self.persons = persons - - @property - def face_index(self): - """Gets the face_index of this FacesResponse. # noqa: E501 - - The detected face index number. # noqa: E501 - - :return: The face_index of this FacesResponse. # noqa: E501 - :rtype: float - """ - return self._face_index - - @face_index.setter - def face_index(self, face_index): - """Sets the face_index of this FacesResponse. - - The detected face index number. # noqa: E501 - - :param face_index: The face_index of this FacesResponse. # noqa: E501 - :type face_index: float - """ - - self._face_index = face_index - - @property - def landmarks(self): - """Gets the landmarks of this FacesResponse. # noqa: E501 - - Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips. # noqa: E501 - - :return: The landmarks of this FacesResponse. # noqa: E501 - :rtype: [[float]] - """ - return self._landmarks - - @landmarks.setter - def landmarks(self, landmarks): - """Sets the landmarks of this FacesResponse. - - Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips. # noqa: E501 - - :param landmarks: The landmarks of this FacesResponse. # noqa: E501 - :type landmarks: [[float]] - """ - - self._landmarks = landmarks - - @property - def rotation_angle(self): - """Gets the rotation_angle of this FacesResponse. # noqa: E501 - - - :return: The rotation_angle of this FacesResponse. # noqa: E501 - :rtype: float - """ - return self._rotation_angle - - @rotation_angle.setter - def rotation_angle(self, rotation_angle): - """Sets the rotation_angle of this FacesResponse. - - - :param rotation_angle: The rotation_angle of this FacesResponse. # noqa: E501 - :type rotation_angle: float - """ - - self._rotation_angle = rotation_angle - - @property - def roi(self): - """Gets the roi of this FacesResponse. # noqa: E501 - - - :return: The roi of this FacesResponse. # noqa: E501 - :rtype: FaceRectangular - """ - return self._roi - - @roi.setter - def roi(self, roi): - """Sets the roi of this FacesResponse. - - - :param roi: The roi of this FacesResponse. # noqa: E501 - :type roi: FaceRectangular - """ - - self._roi = roi - - @property - def crop(self): - """Gets the crop of this FacesResponse. # noqa: E501 - - Base64-encoded aligned and cropped portrait. # noqa: E501 - - :return: The crop of this FacesResponse. # noqa: E501 - :rtype: str - """ - return self._crop - - @crop.setter - def crop(self, crop): - """Sets the crop of this FacesResponse. - - Base64-encoded aligned and cropped portrait. # noqa: E501 - - :param crop: The crop of this FacesResponse. # noqa: E501 - :type crop: str - """ - - self._crop = crop - - @property - def persons(self): - """Gets the persons of this FacesResponse. # noqa: E501 - - Detected Persons. # noqa: E501 - - :return: The persons of this FacesResponse. # noqa: E501 - :rtype: [PersonWithImages] - """ - return self._persons - - @persons.setter - def persons(self, persons): - """Sets the persons of this FacesResponse. - - Detected Persons. # noqa: E501 - - :param persons: The persons of this FacesResponse. # noqa: E501 - :type persons: [PersonWithImages] - """ - - self._persons = persons - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FacesResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FacesResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/faces_response_all_of.py b/regula/facesdk/webclient/gen/model/faces_response_all_of.py deleted file mode 100644 index 22b8477..0000000 --- a/regula/facesdk/webclient/gen/model/faces_response_all_of.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FacesResponseAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'persons': '[PersonWithImages]', - 'rotation_angle': 'float', - } - - attribute_map = { - 'persons': 'persons', - 'rotation_angle': 'rotationAngle', - } - - def __init__(self, persons=None, rotation_angle=None, local_vars_configuration=None): # noqa: E501 - """FacesResponseAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._persons = None - self._rotation_angle = None - self.discriminator = None - - if persons is not None: - self.persons = persons - if rotation_angle is not None: - self.rotation_angle = rotation_angle - - @property - def persons(self): - """Gets the persons of this FacesResponseAllOf. # noqa: E501 - - Detected Persons. # noqa: E501 - - :return: The persons of this FacesResponseAllOf. # noqa: E501 - :rtype: [PersonWithImages] - """ - return self._persons - - @persons.setter - def persons(self, persons): - """Sets the persons of this FacesResponseAllOf. - - Detected Persons. # noqa: E501 - - :param persons: The persons of this FacesResponseAllOf. # noqa: E501 - :type persons: [PersonWithImages] - """ - - self._persons = persons - - @property - def rotation_angle(self): - """Gets the rotation_angle of this FacesResponseAllOf. # noqa: E501 - - - :return: The rotation_angle of this FacesResponseAllOf. # noqa: E501 - :rtype: float - """ - return self._rotation_angle - - @rotation_angle.setter - def rotation_angle(self, rotation_angle): - """Sets the rotation_angle of this FacesResponseAllOf. - - - :param rotation_angle: The rotation_angle of this FacesResponseAllOf. # noqa: E501 - :type rotation_angle: float - """ - - self._rotation_angle = rotation_angle - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FacesResponseAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FacesResponseAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/filter_op.py b/regula/facesdk/webclient/gen/model/filter_op.py deleted file mode 100644 index 6a6ca4c..0000000 --- a/regula/facesdk/webclient/gen/model/filter_op.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FilterOp(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - IN = "in" - - "" - NOT_IN = "nin" - - allowable_values = [IN, NOT_IN] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """FilterOp - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FilterOp): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FilterOp): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/filter_search_request.py b/regula/facesdk/webclient/gen/model/filter_search_request.py deleted file mode 100644 index 301fe78..0000000 --- a/regula/facesdk/webclient/gen/model/filter_search_request.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class FilterSearchRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'op': 'FilterOp', - 'field': 'str', - 'value': '[str]', - } - - attribute_map = { - 'op': 'op', - 'field': 'field', - 'value': 'value', - } - - def __init__(self, op=None, field=None, value=None, local_vars_configuration=None): # noqa: E501 - """FilterSearchRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._op = None - self._field = None - self._value = None - self.discriminator = None - - if op is not None: - self.op = op - if field is not None: - self.field = field - if value is not None: - self.value = value - - @property - def op(self): - """Gets the op of this FilterSearchRequest. # noqa: E501 - - - :return: The op of this FilterSearchRequest. # noqa: E501 - :rtype: FilterOp - """ - return self._op - - @op.setter - def op(self, op): - """Sets the op of this FilterSearchRequest. - - - :param op: The op of this FilterSearchRequest. # noqa: E501 - :type op: FilterOp - """ - - self._op = op - - @property - def field(self): - """Gets the field of this FilterSearchRequest. # noqa: E501 - - `name` of the Person. # noqa: E501 - - :return: The field of this FilterSearchRequest. # noqa: E501 - :rtype: str - """ - return self._field - - @field.setter - def field(self, field): - """Sets the field of this FilterSearchRequest. - - `name` of the Person. # noqa: E501 - - :param field: The field of this FilterSearchRequest. # noqa: E501 - :type field: str - """ - - self._field = field - - @property - def value(self): - """Gets the value of this FilterSearchRequest. # noqa: E501 - - The list of `name` values against which the `field` is compared. # noqa: E501 - - :return: The value of this FilterSearchRequest. # noqa: E501 - :rtype: [str] - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this FilterSearchRequest. - - The list of `name` values against which the `field` is compared. # noqa: E501 - - :param value: The value of this FilterSearchRequest. # noqa: E501 - :type value: [str] - """ - - self._value = value - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FilterSearchRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FilterSearchRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/group.py b/regula/facesdk/webclient/gen/model/group.py deleted file mode 100644 index e66973c..0000000 --- a/regula/facesdk/webclient/gen/model/group.py +++ /dev/null @@ -1,206 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class Group(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'id': 'str', - 'created_at': 'str', - } - - attribute_map = { - 'name': 'name', - 'metadata': 'metadata', - 'id': 'id', - 'created_at': 'createdAt', - } - - def __init__(self, name=None, metadata=None, id=None, created_at=None, local_vars_configuration=None): # noqa: E501 - """Group - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._metadata = None - self._id = None - self._created_at = None - self.discriminator = None - - if name is not None: - self.name = name - if metadata is not None: - self.metadata = metadata - if id is not None: - self.id = id - if created_at is not None: - self.created_at = created_at - - @property - def name(self): - """Gets the name of this Group. # noqa: E501 - - Group to create name. # noqa: E501 - - :return: The name of this Group. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Group. - - Group to create name. # noqa: E501 - - :param name: The name of this Group. # noqa: E501 - :type name: str - """ - - self._name = name - - @property - def metadata(self): - """Gets the metadata of this Group. # noqa: E501 - - A free-form object containing group's extended attributes. # noqa: E501 - - :return: The metadata of this Group. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this Group. - - A free-form object containing group's extended attributes. # noqa: E501 - - :param metadata: The metadata of this Group. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def id(self): - """Gets the id of this Group. # noqa: E501 - - Group ID. # noqa: E501 - - :return: The id of this Group. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Group. - - Group ID. # noqa: E501 - - :param id: The id of this Group. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def created_at(self): - """Gets the created_at of this Group. # noqa: E501 - - Group creation date. # noqa: E501 - - :return: The created_at of this Group. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this Group. - - Group creation date. # noqa: E501 - - :param created_at: The created_at of this Group. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Group): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Group): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/group_all_of.py b/regula/facesdk/webclient/gen/model/group_all_of.py deleted file mode 100644 index c927ceb..0000000 --- a/regula/facesdk/webclient/gen/model/group_all_of.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class GroupAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'created_at': 'str', - } - - attribute_map = { - 'id': 'id', - 'created_at': 'createdAt', - } - - def __init__(self, id=None, created_at=None, local_vars_configuration=None): # noqa: E501 - """GroupAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._created_at = None - self.discriminator = None - - if id is not None: - self.id = id - if created_at is not None: - self.created_at = created_at - - @property - def id(self): - """Gets the id of this GroupAllOf. # noqa: E501 - - Group ID. # noqa: E501 - - :return: The id of this GroupAllOf. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this GroupAllOf. - - Group ID. # noqa: E501 - - :param id: The id of this GroupAllOf. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def created_at(self): - """Gets the created_at of this GroupAllOf. # noqa: E501 - - Group creation date. # noqa: E501 - - :return: The created_at of this GroupAllOf. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this GroupAllOf. - - Group creation date. # noqa: E501 - - :param created_at: The created_at of this GroupAllOf. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, GroupAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, GroupAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/group_page.py b/regula/facesdk/webclient/gen/model/group_page.py deleted file mode 100644 index 6fdc600..0000000 --- a/regula/facesdk/webclient/gen/model/group_page.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class GroupPage(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'items': '[Group]', - 'page': 'int', - 'total_pages': 'int', - } - - attribute_map = { - 'items': 'items', - 'page': 'page', - 'total_pages': 'totalPages', - } - - def __init__(self, items=None, page=None, total_pages=None, local_vars_configuration=None): # noqa: E501 - """GroupPage - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._items = None - self._page = None - self._total_pages = None - self.discriminator = None - - if items is not None: - self.items = items - if page is not None: - self.page = page - if total_pages is not None: - self.total_pages = total_pages - - @property - def items(self): - """Gets the items of this GroupPage. # noqa: E501 - - Array of Groups that are found during the search. # noqa: E501 - - :return: The items of this GroupPage. # noqa: E501 - :rtype: [Group] - """ - return self._items - - @items.setter - def items(self, items): - """Sets the items of this GroupPage. - - Array of Groups that are found during the search. # noqa: E501 - - :param items: The items of this GroupPage. # noqa: E501 - :type items: [Group] - """ - - self._items = items - - @property - def page(self): - """Gets the page of this GroupPage. # noqa: E501 - - Current page number. # noqa: E501 - - :return: The page of this GroupPage. # noqa: E501 - :rtype: int - """ - return self._page - - @page.setter - def page(self, page): - """Sets the page of this GroupPage. - - Current page number. # noqa: E501 - - :param page: The page of this GroupPage. # noqa: E501 - :type page: int - """ - - self._page = page - - @property - def total_pages(self): - """Gets the total_pages of this GroupPage. # noqa: E501 - - Total number of pages. # noqa: E501 - - :return: The total_pages of this GroupPage. # noqa: E501 - :rtype: int - """ - return self._total_pages - - @total_pages.setter - def total_pages(self, total_pages): - """Sets the total_pages of this GroupPage. - - Total number of pages. # noqa: E501 - - :param total_pages: The total_pages of this GroupPage. # noqa: E501 - :type total_pages: int - """ - - self._total_pages = total_pages - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, GroupPage): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, GroupPage): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/group_page_all_of.py b/regula/facesdk/webclient/gen/model/group_page_all_of.py deleted file mode 100644 index 3a53d85..0000000 --- a/regula/facesdk/webclient/gen/model/group_page_all_of.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class GroupPageAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'items': '[Group]', - } - - attribute_map = { - 'items': 'items', - } - - def __init__(self, items=None, local_vars_configuration=None): # noqa: E501 - """GroupPageAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._items = None - self.discriminator = None - - if items is not None: - self.items = items - - @property - def items(self): - """Gets the items of this GroupPageAllOf. # noqa: E501 - - Array of Groups that are found during the search. # noqa: E501 - - :return: The items of this GroupPageAllOf. # noqa: E501 - :rtype: [Group] - """ - return self._items - - @items.setter - def items(self, items): - """Sets the items of this GroupPageAllOf. - - Array of Groups that are found during the search. # noqa: E501 - - :param items: The items of this GroupPageAllOf. # noqa: E501 - :type items: [Group] - """ - - self._items = items - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, GroupPageAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, GroupPageAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/group_response.py b/regula/facesdk/webclient/gen/model/group_response.py deleted file mode 100644 index e540ce9..0000000 --- a/regula/facesdk/webclient/gen/model/group_response.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class GroupResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'name': 'name', - 'metadata': 'metadata', - } - - def __init__(self, name=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """GroupResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._metadata = None - self.discriminator = None - - if name is not None: - self.name = name - if metadata is not None: - self.metadata = metadata - - @property - def name(self): - """Gets the name of this GroupResponse. # noqa: E501 - - Group to create name. # noqa: E501 - - :return: The name of this GroupResponse. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this GroupResponse. - - Group to create name. # noqa: E501 - - :param name: The name of this GroupResponse. # noqa: E501 - :type name: str - """ - - self._name = name - - @property - def metadata(self): - """Gets the metadata of this GroupResponse. # noqa: E501 - - A free-form object containing group's extended attributes. # noqa: E501 - - :return: The metadata of this GroupResponse. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this GroupResponse. - - A free-form object containing group's extended attributes. # noqa: E501 - - :param metadata: The metadata of this GroupResponse. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, GroupResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, GroupResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/group_to_create.py b/regula/facesdk/webclient/gen/model/group_to_create.py deleted file mode 100644 index e40ac1d..0000000 --- a/regula/facesdk/webclient/gen/model/group_to_create.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class GroupToCreate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tag': 'str', - 'name': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'tag': 'tag', - 'name': 'name', - 'metadata': 'metadata', - } - - def __init__(self, tag=None, name=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """GroupToCreate - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tag = None - self._name = None - self._metadata = None - self.discriminator = None - - if tag is not None: - self.tag = tag - self.name = name - self.metadata = metadata - - @property - def tag(self): - """Gets the tag of this GroupToCreate. # noqa: E501 - - Session identificator. # noqa: E501 - - :return: The tag of this GroupToCreate. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this GroupToCreate. - - Session identificator. # noqa: E501 - - :param tag: The tag of this GroupToCreate. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def name(self): - """Gets the name of this GroupToCreate. # noqa: E501 - - Group to create name. # noqa: E501 - - :return: The name of this GroupToCreate. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this GroupToCreate. - - Group to create name. # noqa: E501 - - :param name: The name of this GroupToCreate. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def metadata(self): - """Gets the metadata of this GroupToCreate. # noqa: E501 - - A free-form object containing group's extended attributes. # noqa: E501 - - :return: The metadata of this GroupToCreate. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this GroupToCreate. - - A free-form object containing group's extended attributes. # noqa: E501 - - :param metadata: The metadata of this GroupToCreate. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - if self.local_vars_configuration.client_side_validation and metadata is None: # noqa: E501 - raise ValueError("Invalid value for `metadata`, must not be `None`") # noqa: E501 - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, GroupToCreate): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, GroupToCreate): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/image.py b/regula/facesdk/webclient/gen/model/image.py deleted file mode 100644 index 8b24471..0000000 --- a/regula/facesdk/webclient/gen/model/image.py +++ /dev/null @@ -1,318 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class Image(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'content': 'str', - 'content_type': 'str', - 'created_at': 'str', - 'updated_at': 'str', - 'path': 'str', - 'url': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'id': 'id', - 'content': 'content', - 'content_type': 'contentType', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'path': 'path', - 'url': 'url', - 'metadata': 'metadata', - } - - def __init__(self, id=None, content=None, content_type=None, created_at=None, updated_at=None, path=None, url=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """Image - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._content = None - self._content_type = None - self._created_at = None - self._updated_at = None - self._path = None - self._url = None - self._metadata = None - self.discriminator = None - - if id is not None: - self.id = id - if content is not None: - self.content = content - if content_type is not None: - self.content_type = content_type - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - if path is not None: - self.path = path - if url is not None: - self.url = url - if metadata is not None: - self.metadata = metadata - - @property - def id(self): - """Gets the id of this Image. # noqa: E501 - - Response image ID. The list is sorted by decreasing ID value. # noqa: E501 - - :return: The id of this Image. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Image. - - Response image ID. The list is sorted by decreasing ID value. # noqa: E501 - - :param id: The id of this Image. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def content(self): - """Gets the content of this Image. # noqa: E501 - - Base64-encoded image. Returned only if `withImages` is set to true in the request. # noqa: E501 - - :return: The content of this Image. # noqa: E501 - :rtype: str - """ - return self._content - - @content.setter - def content(self, content): - """Sets the content of this Image. - - Base64-encoded image. Returned only if `withImages` is set to true in the request. # noqa: E501 - - :param content: The content of this Image. # noqa: E501 - :type content: str - """ - - self._content = content - - @property - def content_type(self): - """Gets the content_type of this Image. # noqa: E501 - - Original media type of the returned image. # noqa: E501 - - :return: The content_type of this Image. # noqa: E501 - :rtype: str - """ - return self._content_type - - @content_type.setter - def content_type(self, content_type): - """Sets the content_type of this Image. - - Original media type of the returned image. # noqa: E501 - - :param content_type: The content_type of this Image. # noqa: E501 - :type content_type: str - """ - - self._content_type = content_type - - @property - def created_at(self): - """Gets the created_at of this Image. # noqa: E501 - - Returned image creation date. # noqa: E501 - - :return: The created_at of this Image. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this Image. - - Returned image creation date. # noqa: E501 - - :param created_at: The created_at of this Image. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - @property - def updated_at(self): - """Gets the updated_at of this Image. # noqa: E501 - - Returned image update date. # noqa: E501 - - :return: The updated_at of this Image. # noqa: E501 - :rtype: str - """ - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Sets the updated_at of this Image. - - Returned image update date. # noqa: E501 - - :param updated_at: The updated_at of this Image. # noqa: E501 - :type updated_at: str - """ - - self._updated_at = updated_at - - @property - def path(self): - """Gets the path of this Image. # noqa: E501 - - Returned image path. # noqa: E501 - - :return: The path of this Image. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this Image. - - Returned image path. # noqa: E501 - - :param path: The path of this Image. # noqa: E501 - :type path: str - """ - - self._path = path - - @property - def url(self): - """Gets the url of this Image. # noqa: E501 - - Returned image URL. # noqa: E501 - - :return: The url of this Image. # noqa: E501 - :rtype: str - """ - return self._url - - @url.setter - def url(self, url): - """Sets the url of this Image. - - Returned image URL. # noqa: E501 - - :param url: The url of this Image. # noqa: E501 - :type url: str - """ - - self._url = url - - @property - def metadata(self): - """Gets the metadata of this Image. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this Image. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this Image. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this Image. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Image): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Image): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/image_fields.py b/regula/facesdk/webclient/gen/model/image_fields.py deleted file mode 100644 index 0a52472..0000000 --- a/regula/facesdk/webclient/gen/model/image_fields.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class ImageFields(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tag': 'str', - 'image': 'AddImageToPersonRequestImage', - 'output_image_params': 'OutputImageParams', - 'detect_all': 'bool', - 'threshold': 'float', - 'limit': 'int', - } - - attribute_map = { - 'tag': 'tag', - 'image': 'image', - 'output_image_params': 'outputImageParams', - 'detect_all': 'detectAll', - 'threshold': 'threshold', - 'limit': 'limit', - } - - def __init__(self, tag=None, image=None, output_image_params=None, detect_all=False, threshold=None, limit=None, local_vars_configuration=None): # noqa: E501 - """ImageFields - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tag = None - self._image = None - self._output_image_params = None - self._detect_all = None - self._threshold = None - self._limit = None - self.discriminator = None - - if tag is not None: - self.tag = tag - if image is not None: - self.image = image - if output_image_params is not None: - self.output_image_params = output_image_params - if detect_all is not None: - self.detect_all = detect_all - if threshold is not None: - self.threshold = threshold - if limit is not None: - self.limit = limit - - @property - def tag(self): - """Gets the tag of this ImageFields. # noqa: E501 - - Session identificator, should be unique for each session. # noqa: E501 - - :return: The tag of this ImageFields. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this ImageFields. - - Session identificator, should be unique for each session. # noqa: E501 - - :param tag: The tag of this ImageFields. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def image(self): - """Gets the image of this ImageFields. # noqa: E501 - - - :return: The image of this ImageFields. # noqa: E501 - :rtype: AddImageToPersonRequestImage - """ - return self._image - - @image.setter - def image(self, image): - """Sets the image of this ImageFields. - - - :param image: The image of this ImageFields. # noqa: E501 - :type image: AddImageToPersonRequestImage - """ - - self._image = image - - @property - def output_image_params(self): - """Gets the output_image_params of this ImageFields. # noqa: E501 - - - :return: The output_image_params of this ImageFields. # noqa: E501 - :rtype: OutputImageParams - """ - return self._output_image_params - - @output_image_params.setter - def output_image_params(self, output_image_params): - """Sets the output_image_params of this ImageFields. - - - :param output_image_params: The output_image_params of this ImageFields. # noqa: E501 - :type output_image_params: OutputImageParams - """ - - self._output_image_params = output_image_params - - @property - def detect_all(self): - """Gets the detect_all of this ImageFields. # noqa: E501 - - Whether to detect all faces in the image. If set to `false`, only the most central face is detected. # noqa: E501 - - :return: The detect_all of this ImageFields. # noqa: E501 - :rtype: bool - """ - return self._detect_all - - @detect_all.setter - def detect_all(self, detect_all): - """Sets the detect_all of this ImageFields. - - Whether to detect all faces in the image. If set to `false`, only the most central face is detected. # noqa: E501 - - :param detect_all: The detect_all of this ImageFields. # noqa: E501 - :type detect_all: bool - """ - - self._detect_all = detect_all - - @property - def threshold(self): - """Gets the threshold of this ImageFields. # noqa: E501 - - The similarity threshold. # noqa: E501 - - :return: The threshold of this ImageFields. # noqa: E501 - :rtype: float - """ - return self._threshold - - @threshold.setter - def threshold(self, threshold): - """Sets the threshold of this ImageFields. - - The similarity threshold. # noqa: E501 - - :param threshold: The threshold of this ImageFields. # noqa: E501 - :type threshold: float - """ - - self._threshold = threshold - - @property - def limit(self): - """Gets the limit of this ImageFields. # noqa: E501 - - The maximum number of results to be returned. # noqa: E501 - - :return: The limit of this ImageFields. # noqa: E501 - :rtype: int - """ - return self._limit - - @limit.setter - def limit(self, limit): - """Sets the limit of this ImageFields. - - The maximum number of results to be returned. # noqa: E501 - - :param limit: The limit of this ImageFields. # noqa: E501 - :type limit: int - """ - - self._limit = limit - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ImageFields): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ImageFields): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/image_fields_image.py b/regula/facesdk/webclient/gen/model/image_fields_image.py deleted file mode 100644 index dcd9812..0000000 --- a/regula/facesdk/webclient/gen/model/image_fields_image.py +++ /dev/null @@ -1,204 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - [Download OpenAPI specification](https://github.com/regulaforensics/FaceSDK-web-openapi) ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 6.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class ImageFieldsImage(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'content_type': 'str', - 'content': 'str', - 'image_url': 'str', - 'resize_options': 'ResizeOptions', - } - - attribute_map = { - 'content_type': 'contentType', - 'content': 'content', - 'image_url': 'imageUrl', - 'resize_options': 'resizeOptions', - } - - def __init__(self, content_type=None, content=None, image_url=None, resize_options=None, local_vars_configuration=None): # noqa: E501 - """ImageFieldsImage - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._content_type = None - self._content = None - self._image_url = None - self._resize_options = None - self.discriminator = None - - if content_type is not None: - self.content_type = content_type - if content is not None: - self.content = content - if image_url is not None: - self.image_url = image_url - if resize_options is not None: - self.resize_options = resize_options - - @property - def content_type(self): - """Gets the content_type of this ImageFieldsImage. # noqa: E501 - - Original media type of the uploaded image. # noqa: E501 - - :return: The content_type of this ImageFieldsImage. # noqa: E501 - :rtype: str - """ - return self._content_type - - @content_type.setter - def content_type(self, content_type): - """Sets the content_type of this ImageFieldsImage. - - Original media type of the uploaded image. # noqa: E501 - - :param content_type: The content_type of this ImageFieldsImage. # noqa: E501 - :type content_type: str - """ - - self._content_type = content_type - - @property - def content(self): - """Gets the content of this ImageFieldsImage. # noqa: E501 - - Base64 encoded image. # noqa: E501 - - :return: The content of this ImageFieldsImage. # noqa: E501 - :rtype: str - """ - return self._content - - @content.setter - def content(self, content): - """Sets the content of this ImageFieldsImage. - - Base64 encoded image. # noqa: E501 - - :param content: The content of this ImageFieldsImage. # noqa: E501 - :type content: str - """ - - self._content = content - - @property - def image_url(self): - """Gets the image_url of this ImageFieldsImage. # noqa: E501 - - Image URL. # noqa: E501 - - :return: The image_url of this ImageFieldsImage. # noqa: E501 - :rtype: str - """ - return self._image_url - - @image_url.setter - def image_url(self, image_url): - """Sets the image_url of this ImageFieldsImage. - - Image URL. # noqa: E501 - - :param image_url: The image_url of this ImageFieldsImage. # noqa: E501 - :type image_url: str - """ - - self._image_url = image_url - - @property - def resize_options(self): - """Gets the resize_options of this ImageFieldsImage. # noqa: E501 - - - :return: The resize_options of this ImageFieldsImage. # noqa: E501 - :rtype: ResizeOptions - """ - return self._resize_options - - @resize_options.setter - def resize_options(self, resize_options): - """Sets the resize_options of this ImageFieldsImage. - - - :param resize_options: The resize_options of this ImageFieldsImage. # noqa: E501 - :type resize_options: ResizeOptions - """ - - self._resize_options = resize_options - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ImageFieldsImage): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ImageFieldsImage): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/image_page.py b/regula/facesdk/webclient/gen/model/image_page.py deleted file mode 100644 index ebdde46..0000000 --- a/regula/facesdk/webclient/gen/model/image_page.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class ImagePage(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'page': 'int', - 'total_pages': 'int', - 'items': '[Image]', - } - - attribute_map = { - 'page': 'page', - 'total_pages': 'totalPages', - 'items': 'items', - } - - def __init__(self, page=None, total_pages=None, items=None, local_vars_configuration=None): # noqa: E501 - """ImagePage - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._page = None - self._total_pages = None - self._items = None - self.discriminator = None - - if page is not None: - self.page = page - if total_pages is not None: - self.total_pages = total_pages - if items is not None: - self.items = items - - @property - def page(self): - """Gets the page of this ImagePage. # noqa: E501 - - Current page number. # noqa: E501 - - :return: The page of this ImagePage. # noqa: E501 - :rtype: int - """ - return self._page - - @page.setter - def page(self, page): - """Sets the page of this ImagePage. - - Current page number. # noqa: E501 - - :param page: The page of this ImagePage. # noqa: E501 - :type page: int - """ - - self._page = page - - @property - def total_pages(self): - """Gets the total_pages of this ImagePage. # noqa: E501 - - Total number of pages. # noqa: E501 - - :return: The total_pages of this ImagePage. # noqa: E501 - :rtype: int - """ - return self._total_pages - - @total_pages.setter - def total_pages(self, total_pages): - """Sets the total_pages of this ImagePage. - - Total number of pages. # noqa: E501 - - :param total_pages: The total_pages of this ImagePage. # noqa: E501 - :type total_pages: int - """ - - self._total_pages = total_pages - - @property - def items(self): - """Gets the items of this ImagePage. # noqa: E501 - - - :return: The items of this ImagePage. # noqa: E501 - :rtype: [Image] - """ - return self._items - - @items.setter - def items(self, items): - """Sets the items of this ImagePage. - - - :param items: The items of this ImagePage. # noqa: E501 - :type items: [Image] - """ - - self._items = items - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ImagePage): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ImagePage): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/image_page_all_of.py b/regula/facesdk/webclient/gen/model/image_page_all_of.py deleted file mode 100644 index bc56aac..0000000 --- a/regula/facesdk/webclient/gen/model/image_page_all_of.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class ImagePageAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'items': '[Image]', - } - - attribute_map = { - 'items': 'items', - } - - def __init__(self, items=None, local_vars_configuration=None): # noqa: E501 - """ImagePageAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._items = None - self.discriminator = None - - if items is not None: - self.items = items - - @property - def items(self): - """Gets the items of this ImagePageAllOf. # noqa: E501 - - - :return: The items of this ImagePageAllOf. # noqa: E501 - :rtype: [Image] - """ - return self._items - - @items.setter - def items(self, items): - """Sets the items of this ImagePageAllOf. - - - :param items: The items of this ImagePageAllOf. # noqa: E501 - :type items: [Image] - """ - - self._items = items - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ImagePageAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ImagePageAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/image_source.py b/regula/facesdk/webclient/gen/model/image_source.py deleted file mode 100644 index edc8422..0000000 --- a/regula/facesdk/webclient/gen/model/image_source.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class ImageSource(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - DOCUMENT_PRINTED = int(1) - - "" - DOCUMENT_RFID = int(2) - - "" - LIVE = int(3) - - "" - DOCUMENT_WITH_LIVE = int(4) - - "" - EXTERNAL = int(5) - - "" - GHOST = int(6) - - "" - BARCODE = int(7) - - allowable_values = [DOCUMENT_PRINTED, DOCUMENT_RFID, LIVE, DOCUMENT_WITH_LIVE, EXTERNAL, GHOST, BARCODE] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """ImageSource - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ImageSource): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ImageSource): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/liveness_transaction.py b/regula/facesdk/webclient/gen/model/liveness_transaction.py deleted file mode 100644 index 8514721..0000000 --- a/regula/facesdk/webclient/gen/model/liveness_transaction.py +++ /dev/null @@ -1,334 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - Regula FaceSDK Web API # Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 4.1.3 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class LivenessTransaction(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'config': 'TransactionConfig', - 'elapsed': 'int', - 'portrait': 'str', - 'session_id': 'str', - 'status': 'int', - 'transaction_id': 'str', - 'video': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'code': 'code', - 'config': 'config', - 'elapsed': 'elapsed', - 'portrait': 'portrait', - 'session_id': 'sessionId', - 'status': 'status', - 'transaction_id': 'transactionId', - 'video': 'video', - 'metadata': 'metadata', - } - - def __init__(self, code=None, config=None, elapsed=None, portrait=None, session_id=None, status=None, transaction_id=None, video=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """LivenessTransaction - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._config = None - self._elapsed = None - self._portrait = None - self._session_id = None - self._status = None - self._transaction_id = None - self._video = None - self._metadata = None - self.discriminator = None - - if code is not None: - self.code = code - if config is not None: - self.config = config - if elapsed is not None: - self.elapsed = elapsed - if portrait is not None: - self.portrait = portrait - if session_id is not None: - self.session_id = session_id - if status is not None: - self.status = status - if transaction_id is not None: - self.transaction_id = transaction_id - if video is not None: - self.video = video - if metadata is not None: - self.metadata = metadata - - @property - def code(self): - """Gets the code of this LivenessTransaction. # noqa: E501 - - - :return: The code of this LivenessTransaction. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this LivenessTransaction. - - - :param code: The code of this LivenessTransaction. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def config(self): - """Gets the config of this LivenessTransaction. # noqa: E501 - - - :return: The config of this LivenessTransaction. # noqa: E501 - :rtype: TransactionConfig - """ - return self._config - - @config.setter - def config(self, config): - """Sets the config of this LivenessTransaction. - - - :param config: The config of this LivenessTransaction. # noqa: E501 - :type config: TransactionConfig - """ - - self._config = config - - @property - def elapsed(self): - """Gets the elapsed of this LivenessTransaction. # noqa: E501 - - - :return: The elapsed of this LivenessTransaction. # noqa: E501 - :rtype: int - """ - return self._elapsed - - @elapsed.setter - def elapsed(self, elapsed): - """Sets the elapsed of this LivenessTransaction. - - - :param elapsed: The elapsed of this LivenessTransaction. # noqa: E501 - :type elapsed: int - """ - - self._elapsed = elapsed - - @property - def portrait(self): - """Gets the portrait of this LivenessTransaction. # noqa: E501 - - URL for portrait image # noqa: E501 - - :return: The portrait of this LivenessTransaction. # noqa: E501 - :rtype: str - """ - return self._portrait - - @portrait.setter - def portrait(self, portrait): - """Sets the portrait of this LivenessTransaction. - - URL for portrait image # noqa: E501 - - :param portrait: The portrait of this LivenessTransaction. # noqa: E501 - :type portrait: str - """ - - self._portrait = portrait - - @property - def session_id(self): - """Gets the session_id of this LivenessTransaction. # noqa: E501 - - - :return: The session_id of this LivenessTransaction. # noqa: E501 - :rtype: str - """ - return self._session_id - - @session_id.setter - def session_id(self, session_id): - """Sets the session_id of this LivenessTransaction. - - - :param session_id: The session_id of this LivenessTransaction. # noqa: E501 - :type session_id: str - """ - - self._session_id = session_id - - @property - def status(self): - """Gets the status of this LivenessTransaction. # noqa: E501 - - Whether the liveness detection is confirmed (0) or not (1) # noqa: E501 - - :return: The status of this LivenessTransaction. # noqa: E501 - :rtype: int - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this LivenessTransaction. - - Whether the liveness detection is confirmed (0) or not (1) # noqa: E501 - - :param status: The status of this LivenessTransaction. # noqa: E501 - :type status: int - """ - - self._status = status - - @property - def transaction_id(self): - """Gets the transaction_id of this LivenessTransaction. # noqa: E501 - - - :return: The transaction_id of this LivenessTransaction. # noqa: E501 - :rtype: str - """ - return self._transaction_id - - @transaction_id.setter - def transaction_id(self, transaction_id): - """Sets the transaction_id of this LivenessTransaction. - - - :param transaction_id: The transaction_id of this LivenessTransaction. # noqa: E501 - :type transaction_id: str - """ - - self._transaction_id = transaction_id - - @property - def video(self): - """Gets the video of this LivenessTransaction. # noqa: E501 - - - :return: The video of this LivenessTransaction. # noqa: E501 - :rtype: str - """ - return self._video - - @video.setter - def video(self, video): - """Sets the video of this LivenessTransaction. - - - :param video: The video of this LivenessTransaction. # noqa: E501 - :type video: str - """ - - self._video = video - - @property - def metadata(self): - """Gets the metadata of this LivenessTransaction. # noqa: E501 - - A free-form object containing the request information (server time, client IP, etc.). # noqa: E501 - - :return: The metadata of this LivenessTransaction. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this LivenessTransaction. - - A free-form object containing the request information (server time, client IP, etc.). # noqa: E501 - - :param metadata: The metadata of this LivenessTransaction. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, LivenessTransaction): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, LivenessTransaction): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/liveness_type.py b/regula/facesdk/webclient/gen/model/liveness_type.py deleted file mode 100644 index 5bccd2b..0000000 --- a/regula/facesdk/webclient/gen/model/liveness_type.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class LivenessType(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - "" - ACTIVE = int(0) - - "" - PASSIVE = int(1) - - allowable_values = [ACTIVE, PASSIVE] # noqa: E501 - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """LivenessType - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, LivenessType): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, LivenessType): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_and_search_request.py b/regula/facesdk/webclient/gen/model/match_and_search_request.py deleted file mode 100644 index 9dd6f30..0000000 --- a/regula/facesdk/webclient/gen/model/match_and_search_request.py +++ /dev/null @@ -1,290 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchAndSearchRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tag': 'str', - 'images': '[MatchAndSearchRequestImages]', - 'group_ids': '[str]', - 'threshold': 'float', - 'limit': 'int', - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'tag': 'tag', - 'images': 'images', - 'group_ids': 'groupIds', - 'threshold': 'threshold', - 'limit': 'limit', - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, tag=None, images=None, group_ids=None, threshold=None, limit=None, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """MatchAndSearchRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tag = None - self._images = None - self._group_ids = None - self._threshold = None - self._limit = None - self._tenant = None - self._env = None - self.discriminator = None - - if tag is not None: - self.tag = tag - if images is not None: - self.images = images - if group_ids is not None: - self.group_ids = group_ids - if threshold is not None: - self.threshold = threshold - if limit is not None: - self.limit = limit - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def tag(self): - """Gets the tag of this MatchAndSearchRequest. # noqa: E501 - - Session identificator, should be unique for each session. # noqa: E501 - - :return: The tag of this MatchAndSearchRequest. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this MatchAndSearchRequest. - - Session identificator, should be unique for each session. # noqa: E501 - - :param tag: The tag of this MatchAndSearchRequest. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def images(self): - """Gets the images of this MatchAndSearchRequest. # noqa: E501 - - An array of images to be processed. At least two images must be provided. # noqa: E501 - - :return: The images of this MatchAndSearchRequest. # noqa: E501 - :rtype: [MatchAndSearchRequestImages] - """ - return self._images - - @images.setter - def images(self, images): - """Sets the images of this MatchAndSearchRequest. - - An array of images to be processed. At least two images must be provided. # noqa: E501 - - :param images: The images of this MatchAndSearchRequest. # noqa: E501 - :type images: [MatchAndSearchRequestImages] - """ - - self._images = images - - @property - def group_ids(self): - """Gets the group_ids of this MatchAndSearchRequest. # noqa: E501 - - IDs of the groups in which the search is performed. # noqa: E501 - - :return: The group_ids of this MatchAndSearchRequest. # noqa: E501 - :rtype: [str] - """ - return self._group_ids - - @group_ids.setter - def group_ids(self, group_ids): - """Sets the group_ids of this MatchAndSearchRequest. - - IDs of the groups in which the search is performed. # noqa: E501 - - :param group_ids: The group_ids of this MatchAndSearchRequest. # noqa: E501 - :type group_ids: [str] - """ - - self._group_ids = group_ids - - @property - def threshold(self): - """Gets the threshold of this MatchAndSearchRequest. # noqa: E501 - - The similarity threshold. # noqa: E501 - - :return: The threshold of this MatchAndSearchRequest. # noqa: E501 - :rtype: float - """ - return self._threshold - - @threshold.setter - def threshold(self, threshold): - """Sets the threshold of this MatchAndSearchRequest. - - The similarity threshold. # noqa: E501 - - :param threshold: The threshold of this MatchAndSearchRequest. # noqa: E501 - :type threshold: float - """ - - self._threshold = threshold - - @property - def limit(self): - """Gets the limit of this MatchAndSearchRequest. # noqa: E501 - - The maximum number of results to be returned. # noqa: E501 - - :return: The limit of this MatchAndSearchRequest. # noqa: E501 - :rtype: int - """ - return self._limit - - @limit.setter - def limit(self, limit): - """Sets the limit of this MatchAndSearchRequest. - - The maximum number of results to be returned. # noqa: E501 - - :param limit: The limit of this MatchAndSearchRequest. # noqa: E501 - :type limit: int - """ - - self._limit = limit - - @property - def tenant(self): - """Gets the tenant of this MatchAndSearchRequest. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this MatchAndSearchRequest. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this MatchAndSearchRequest. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this MatchAndSearchRequest. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this MatchAndSearchRequest. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this MatchAndSearchRequest. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this MatchAndSearchRequest. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this MatchAndSearchRequest. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchAndSearchRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchAndSearchRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_and_search_request_all_of.py b/regula/facesdk/webclient/gen/model/match_and_search_request_all_of.py deleted file mode 100644 index 8a26e9e..0000000 --- a/regula/facesdk/webclient/gen/model/match_and_search_request_all_of.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchAndSearchRequestAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tag': 'str', - 'images': '[MatchAndSearchRequestAllOfImages]', - 'group_ids': '[str]', - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'tag': 'tag', - 'images': 'images', - 'group_ids': 'groupIds', - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, tag=None, images=None, group_ids=None, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """MatchAndSearchRequestAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tag = None - self._images = None - self._group_ids = None - self._tenant = None - self._env = None - self.discriminator = None - - if tag is not None: - self.tag = tag - if images is not None: - self.images = images - if group_ids is not None: - self.group_ids = group_ids - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def tag(self): - """Gets the tag of this MatchAndSearchRequestAllOf. # noqa: E501 - - Session identificator, should be unique for each session. # noqa: E501 - - :return: The tag of this MatchAndSearchRequestAllOf. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this MatchAndSearchRequestAllOf. - - Session identificator, should be unique for each session. # noqa: E501 - - :param tag: The tag of this MatchAndSearchRequestAllOf. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def images(self): - """Gets the images of this MatchAndSearchRequestAllOf. # noqa: E501 - - Person's images. # noqa: E501 - - :return: The images of this MatchAndSearchRequestAllOf. # noqa: E501 - :rtype: [MatchAndSearchRequestAllOfImages] - """ - return self._images - - @images.setter - def images(self, images): - """Sets the images of this MatchAndSearchRequestAllOf. - - Person's images. # noqa: E501 - - :param images: The images of this MatchAndSearchRequestAllOf. # noqa: E501 - :type images: [MatchAndSearchRequestAllOfImages] - """ - - self._images = images - - @property - def group_ids(self): - """Gets the group_ids of this MatchAndSearchRequestAllOf. # noqa: E501 - - IDs of the groups in which the search is performed. # noqa: E501 - - :return: The group_ids of this MatchAndSearchRequestAllOf. # noqa: E501 - :rtype: [str] - """ - return self._group_ids - - @group_ids.setter - def group_ids(self, group_ids): - """Sets the group_ids of this MatchAndSearchRequestAllOf. - - IDs of the groups in which the search is performed. # noqa: E501 - - :param group_ids: The group_ids of this MatchAndSearchRequestAllOf. # noqa: E501 - :type group_ids: [str] - """ - - self._group_ids = group_ids - - @property - def tenant(self): - """Gets the tenant of this MatchAndSearchRequestAllOf. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this MatchAndSearchRequestAllOf. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this MatchAndSearchRequestAllOf. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this MatchAndSearchRequestAllOf. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this MatchAndSearchRequestAllOf. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this MatchAndSearchRequestAllOf. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this MatchAndSearchRequestAllOf. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this MatchAndSearchRequestAllOf. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchAndSearchRequestAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchAndSearchRequestAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_and_search_request_all_of_images.py b/regula/facesdk/webclient/gen/model/match_and_search_request_all_of_images.py deleted file mode 100644 index 9603f30..0000000 --- a/regula/facesdk/webclient/gen/model/match_and_search_request_all_of_images.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchAndSearchRequestAllOfImages(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'content': 'str', - 'type': 'ImageSource', - } - - attribute_map = { - 'content': 'content', - 'type': 'type', - } - - def __init__(self, content=None, type=None, local_vars_configuration=None): # noqa: E501 - """MatchAndSearchRequestAllOfImages - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._content = None - self._type = None - self.discriminator = None - - if content is not None: - self.content = content - if type is not None: - self.type = type - - @property - def content(self): - """Gets the content of this MatchAndSearchRequestAllOfImages. # noqa: E501 - - Base64-encoded image. # noqa: E501 - - :return: The content of this MatchAndSearchRequestAllOfImages. # noqa: E501 - :rtype: str - """ - return self._content - - @content.setter - def content(self, content): - """Sets the content of this MatchAndSearchRequestAllOfImages. - - Base64-encoded image. # noqa: E501 - - :param content: The content of this MatchAndSearchRequestAllOfImages. # noqa: E501 - :type content: str - """ - - self._content = content - - @property - def type(self): - """Gets the type of this MatchAndSearchRequestAllOfImages. # noqa: E501 - - - :return: The type of this MatchAndSearchRequestAllOfImages. # noqa: E501 - :rtype: ImageSource - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this MatchAndSearchRequestAllOfImages. - - - :param type: The type of this MatchAndSearchRequestAllOfImages. # noqa: E501 - :type type: ImageSource - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchAndSearchRequestAllOfImages): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchAndSearchRequestAllOfImages): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_and_search_request_images.py b/regula/facesdk/webclient/gen/model/match_and_search_request_images.py deleted file mode 100644 index a7b1f43..0000000 --- a/regula/facesdk/webclient/gen/model/match_and_search_request_images.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchAndSearchRequestImages(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'content': 'str', - 'image_url': 'str', - 'type': 'ImageSource', - } - - attribute_map = { - 'content': 'content', - 'image_url': 'imageUrl', - 'type': 'type', - } - - def __init__(self, content=None, image_url=None, type=None, local_vars_configuration=None): # noqa: E501 - """MatchAndSearchRequestImages - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._content = None - self._image_url = None - self._type = None - self.discriminator = None - - if content is not None: - self.content = content - if image_url is not None: - self.image_url = image_url - if type is not None: - self.type = type - - @property - def content(self): - """Gets the content of this MatchAndSearchRequestImages. # noqa: E501 - - Base64-encoded image. # noqa: E501 - - :return: The content of this MatchAndSearchRequestImages. # noqa: E501 - :rtype: str - """ - return self._content - - @content.setter - def content(self, content): - """Sets the content of this MatchAndSearchRequestImages. - - Base64-encoded image. # noqa: E501 - - :param content: The content of this MatchAndSearchRequestImages. # noqa: E501 - :type content: str - """ - - self._content = content - - @property - def image_url(self): - """Gets the image_url of this MatchAndSearchRequestImages. # noqa: E501 - - Image URL. # noqa: E501 - - :return: The image_url of this MatchAndSearchRequestImages. # noqa: E501 - :rtype: str - """ - return self._image_url - - @image_url.setter - def image_url(self, image_url): - """Sets the image_url of this MatchAndSearchRequestImages. - - Image URL. # noqa: E501 - - :param image_url: The image_url of this MatchAndSearchRequestImages. # noqa: E501 - :type image_url: str - """ - - self._image_url = image_url - - @property - def type(self): - """Gets the type of this MatchAndSearchRequestImages. # noqa: E501 - - - :return: The type of this MatchAndSearchRequestImages. # noqa: E501 - :rtype: ImageSource - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this MatchAndSearchRequestImages. - - - :param type: The type of this MatchAndSearchRequestImages. # noqa: E501 - :type type: ImageSource - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchAndSearchRequestImages): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchAndSearchRequestImages): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_and_search_response.py b/regula/facesdk/webclient/gen/model/match_and_search_response.py deleted file mode 100644 index b85aecb..0000000 --- a/regula/facesdk/webclient/gen/model/match_and_search_response.py +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchAndSearchResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'FaceSDKResultCode', - 'results': '[MatchImageResult]', - 'elapsed_time': 'float', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'detections': '[MatchAndSearchResponseAllOfDetections]', - } - - attribute_map = { - 'code': 'code', - 'results': 'results', - 'elapsed_time': 'elapsedTime', - 'metadata': 'metadata', - 'detections': 'detections', - } - - def __init__(self, code=None, results=None, elapsed_time=None, metadata=None, detections=None, local_vars_configuration=None): # noqa: E501 - """MatchAndSearchResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._results = None - self._elapsed_time = None - self._metadata = None - self._detections = None - self.discriminator = None - - self.code = code - if results is not None: - self.results = results - if elapsed_time is not None: - self.elapsed_time = elapsed_time - if metadata is not None: - self.metadata = metadata - if detections is not None: - self.detections = detections - - @property - def code(self): - """Gets the code of this MatchAndSearchResponse. # noqa: E501 - - - :return: The code of this MatchAndSearchResponse. # noqa: E501 - :rtype: FaceSDKResultCode - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this MatchAndSearchResponse. - - - :param code: The code of this MatchAndSearchResponse. # noqa: E501 - :type code: FaceSDKResultCode - """ - if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - - self._code = code - - @property - def results(self): - """Gets the results of this MatchAndSearchResponse. # noqa: E501 - - The match and search results. # noqa: E501 - - :return: The results of this MatchAndSearchResponse. # noqa: E501 - :rtype: [MatchImageResult] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this MatchAndSearchResponse. - - The match and search results. # noqa: E501 - - :param results: The results of this MatchAndSearchResponse. # noqa: E501 - :type results: [MatchImageResult] - """ - - self._results = results - - @property - def elapsed_time(self): - """Gets the elapsed_time of this MatchAndSearchResponse. # noqa: E501 - - Server processing time, ms. Does not include the time taken to receive the request or deliver the response. # noqa: E501 - - :return: The elapsed_time of this MatchAndSearchResponse. # noqa: E501 - :rtype: float - """ - return self._elapsed_time - - @elapsed_time.setter - def elapsed_time(self, elapsed_time): - """Sets the elapsed_time of this MatchAndSearchResponse. - - Server processing time, ms. Does not include the time taken to receive the request or deliver the response. # noqa: E501 - - :param elapsed_time: The elapsed_time of this MatchAndSearchResponse. # noqa: E501 - :type elapsed_time: float - """ - - self._elapsed_time = elapsed_time - - @property - def metadata(self): - """Gets the metadata of this MatchAndSearchResponse. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this MatchAndSearchResponse. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this MatchAndSearchResponse. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this MatchAndSearchResponse. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def detections(self): - """Gets the detections of this MatchAndSearchResponse. # noqa: E501 - - The detection results. # noqa: E501 - - :return: The detections of this MatchAndSearchResponse. # noqa: E501 - :rtype: [MatchAndSearchResponseAllOfDetections] - """ - return self._detections - - @detections.setter - def detections(self, detections): - """Sets the detections of this MatchAndSearchResponse. - - The detection results. # noqa: E501 - - :param detections: The detections of this MatchAndSearchResponse. # noqa: E501 - :type detections: [MatchAndSearchResponseAllOfDetections] - """ - - self._detections = detections - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchAndSearchResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchAndSearchResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_and_search_response_all_of.py b/regula/facesdk/webclient/gen/model/match_and_search_response_all_of.py deleted file mode 100644 index 972bbc2..0000000 --- a/regula/facesdk/webclient/gen/model/match_and_search_response_all_of.py +++ /dev/null @@ -1,206 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchAndSearchResponseAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'results': '[MatchImageResult]', - 'elapsed_time': 'float', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'detections': '[MatchAndSearchResponseAllOfDetections]', - } - - attribute_map = { - 'results': 'results', - 'elapsed_time': 'elapsedTime', - 'metadata': 'metadata', - 'detections': 'detections', - } - - def __init__(self, results=None, elapsed_time=None, metadata=None, detections=None, local_vars_configuration=None): # noqa: E501 - """MatchAndSearchResponseAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._results = None - self._elapsed_time = None - self._metadata = None - self._detections = None - self.discriminator = None - - if results is not None: - self.results = results - if elapsed_time is not None: - self.elapsed_time = elapsed_time - if metadata is not None: - self.metadata = metadata - if detections is not None: - self.detections = detections - - @property - def results(self): - """Gets the results of this MatchAndSearchResponseAllOf. # noqa: E501 - - The match and search results. # noqa: E501 - - :return: The results of this MatchAndSearchResponseAllOf. # noqa: E501 - :rtype: [MatchImageResult] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this MatchAndSearchResponseAllOf. - - The match and search results. # noqa: E501 - - :param results: The results of this MatchAndSearchResponseAllOf. # noqa: E501 - :type results: [MatchImageResult] - """ - - self._results = results - - @property - def elapsed_time(self): - """Gets the elapsed_time of this MatchAndSearchResponseAllOf. # noqa: E501 - - Server processing time, ms. Does not include the time taken to receive the request or deliver the response. # noqa: E501 - - :return: The elapsed_time of this MatchAndSearchResponseAllOf. # noqa: E501 - :rtype: float - """ - return self._elapsed_time - - @elapsed_time.setter - def elapsed_time(self, elapsed_time): - """Sets the elapsed_time of this MatchAndSearchResponseAllOf. - - Server processing time, ms. Does not include the time taken to receive the request or deliver the response. # noqa: E501 - - :param elapsed_time: The elapsed_time of this MatchAndSearchResponseAllOf. # noqa: E501 - :type elapsed_time: float - """ - - self._elapsed_time = elapsed_time - - @property - def metadata(self): - """Gets the metadata of this MatchAndSearchResponseAllOf. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this MatchAndSearchResponseAllOf. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this MatchAndSearchResponseAllOf. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this MatchAndSearchResponseAllOf. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def detections(self): - """Gets the detections of this MatchAndSearchResponseAllOf. # noqa: E501 - - The detection results. # noqa: E501 - - :return: The detections of this MatchAndSearchResponseAllOf. # noqa: E501 - :rtype: [MatchAndSearchResponseAllOfDetections] - """ - return self._detections - - @detections.setter - def detections(self, detections): - """Sets the detections of this MatchAndSearchResponseAllOf. - - The detection results. # noqa: E501 - - :param detections: The detections of this MatchAndSearchResponseAllOf. # noqa: E501 - :type detections: [MatchAndSearchResponseAllOfDetections] - """ - - self._detections = detections - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchAndSearchResponseAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchAndSearchResponseAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_and_search_response_all_of_detections.py b/regula/facesdk/webclient/gen/model/match_and_search_response_all_of_detections.py deleted file mode 100644 index 614af32..0000000 --- a/regula/facesdk/webclient/gen/model/match_and_search_response_all_of_detections.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchAndSearchResponseAllOfDetections(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'faces': '[FacesResponse]', - 'image_index': 'int', - 'status': 'FaceSDKResultCode', - } - - attribute_map = { - 'faces': 'faces', - 'image_index': 'imageIndex', - 'status': 'status', - } - - def __init__(self, faces=None, image_index=None, status=None, local_vars_configuration=None): # noqa: E501 - """MatchAndSearchResponseAllOfDetections - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._faces = None - self._image_index = None - self._status = None - self.discriminator = None - - if faces is not None: - self.faces = faces - if image_index is not None: - self.image_index = image_index - if status is not None: - self.status = status - - @property - def faces(self): - """Gets the faces of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - - Detected faces. # noqa: E501 - - :return: The faces of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - :rtype: [FacesResponse] - """ - return self._faces - - @faces.setter - def faces(self, faces): - """Sets the faces of this MatchAndSearchResponseAllOfDetections. - - Detected faces. # noqa: E501 - - :param faces: The faces of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - :type faces: [FacesResponse] - """ - - self._faces = faces - - @property - def image_index(self): - """Gets the image_index of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :return: The image_index of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - :rtype: int - """ - return self._image_index - - @image_index.setter - def image_index(self, image_index): - """Sets the image_index of this MatchAndSearchResponseAllOfDetections. - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :param image_index: The image_index of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - :type image_index: int - """ - - self._image_index = image_index - - @property - def status(self): - """Gets the status of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - - - :return: The status of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - :rtype: FaceSDKResultCode - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this MatchAndSearchResponseAllOfDetections. - - - :param status: The status of this MatchAndSearchResponseAllOfDetections. # noqa: E501 - :type status: FaceSDKResultCode - """ - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchAndSearchResponseAllOfDetections): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchAndSearchResponseAllOfDetections): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_image.py b/regula/facesdk/webclient/gen/model/match_image.py deleted file mode 100644 index a670795..0000000 --- a/regula/facesdk/webclient/gen/model/match_image.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchImage(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'index': 'int', - 'type': 'ImageSource', - 'data': 'str', - 'detect_all': 'bool', - } - - attribute_map = { - 'index': 'index', - 'type': 'type', - 'data': 'data', - 'detect_all': 'detectAll', - } - - def __init__(self, index=None, type=None, data=None, detect_all=False, local_vars_configuration=None): # noqa: E501 - """MatchImage - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._index = None - self._type = None - self._data = None - self._detect_all = None - self.discriminator = None - - if index is not None: - self.index = index - if type is not None: - self.type = type - self.data = data - if detect_all is not None: - self.detect_all = detect_all - - @property - def index(self): - """Gets the index of this MatchImage. # noqa: E501 - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :return: The index of this MatchImage. # noqa: E501 - :rtype: int - """ - return self._index - - @index.setter - def index(self, index): - """Sets the index of this MatchImage. - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :param index: The index of this MatchImage. # noqa: E501 - :type index: int - """ - - self._index = index - - @property - def type(self): - """Gets the type of this MatchImage. # noqa: E501 - - - :return: The type of this MatchImage. # noqa: E501 - :rtype: ImageSource - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this MatchImage. - - - :param type: The type of this MatchImage. # noqa: E501 - :type type: ImageSource - """ - - self._type = type - - @property - def data(self): - """Gets the data of this MatchImage. # noqa: E501 - - Base64-encoded image. # noqa: E501 - - :return: The data of this MatchImage. # noqa: E501 - :rtype: str - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this MatchImage. - - Base64-encoded image. # noqa: E501 - - :param data: The data of this MatchImage. # noqa: E501 - :type data: str - """ - if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 - - self._data = data - - @property - def detect_all(self): - """Gets the detect_all of this MatchImage. # noqa: E501 - - Whether to detect all faces in the image. If set to `false`, only the most central face is detected. # noqa: E501 - - :return: The detect_all of this MatchImage. # noqa: E501 - :rtype: bool - """ - return self._detect_all - - @detect_all.setter - def detect_all(self, detect_all): - """Sets the detect_all of this MatchImage. - - Whether to detect all faces in the image. If set to `false`, only the most central face is detected. # noqa: E501 - - :param detect_all: The detect_all of this MatchImage. # noqa: E501 - :type detect_all: bool - """ - - self._detect_all = detect_all - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchImage): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchImage): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_image_detection.py b/regula/facesdk/webclient/gen/model/match_image_detection.py deleted file mode 100644 index d9a9e30..0000000 --- a/regula/facesdk/webclient/gen/model/match_image_detection.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchImageDetection(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'faces': '[DetectionFace]', - 'image_index': 'int', - 'status': 'FaceSDKResultCode', - } - - attribute_map = { - 'faces': 'faces', - 'image_index': 'imageIndex', - 'status': 'status', - } - - def __init__(self, faces=None, image_index=None, status=None, local_vars_configuration=None): # noqa: E501 - """MatchImageDetection - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._faces = None - self._image_index = None - self._status = None - self.discriminator = None - - if faces is not None: - self.faces = faces - self.image_index = image_index - self.status = status - - @property - def faces(self): - """Gets the faces of this MatchImageDetection. # noqa: E501 - - Detected faces. # noqa: E501 - - :return: The faces of this MatchImageDetection. # noqa: E501 - :rtype: [DetectionFace] - """ - return self._faces - - @faces.setter - def faces(self, faces): - """Sets the faces of this MatchImageDetection. - - Detected faces. # noqa: E501 - - :param faces: The faces of this MatchImageDetection. # noqa: E501 - :type faces: [DetectionFace] - """ - - self._faces = faces - - @property - def image_index(self): - """Gets the image_index of this MatchImageDetection. # noqa: E501 - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :return: The image_index of this MatchImageDetection. # noqa: E501 - :rtype: int - """ - return self._image_index - - @image_index.setter - def image_index(self, image_index): - """Sets the image_index of this MatchImageDetection. - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :param image_index: The image_index of this MatchImageDetection. # noqa: E501 - :type image_index: int - """ - if self.local_vars_configuration.client_side_validation and image_index is None: # noqa: E501 - raise ValueError("Invalid value for `image_index`, must not be `None`") # noqa: E501 - - self._image_index = image_index - - @property - def status(self): - """Gets the status of this MatchImageDetection. # noqa: E501 - - - :return: The status of this MatchImageDetection. # noqa: E501 - :rtype: FaceSDKResultCode - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this MatchImageDetection. - - - :param status: The status of this MatchImageDetection. # noqa: E501 - :type status: FaceSDKResultCode - """ - if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 - raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchImageDetection): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchImageDetection): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_image_result.py b/regula/facesdk/webclient/gen/model/match_image_result.py deleted file mode 100644 index 661e314..0000000 --- a/regula/facesdk/webclient/gen/model/match_image_result.py +++ /dev/null @@ -1,316 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchImageResult(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'first_index': 'int', - 'first_face_index': 'float', - 'first': 'ImageSource', - 'second_index': 'int', - 'second_face_index': 'float', - 'second': 'ImageSource', - 'score': 'float', - 'similarity': 'float', - } - - attribute_map = { - 'first_index': 'firstIndex', - 'first_face_index': 'firstFaceIndex', - 'first': 'first', - 'second_index': 'secondIndex', - 'second_face_index': 'secondFaceIndex', - 'second': 'second', - 'score': 'score', - 'similarity': 'similarity', - } - - def __init__(self, first_index=None, first_face_index=None, first=None, second_index=None, second_face_index=None, second=None, score=None, similarity=None, local_vars_configuration=None): # noqa: E501 - """MatchImageResult - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._first_index = None - self._first_face_index = None - self._first = None - self._second_index = None - self._second_face_index = None - self._second = None - self._score = None - self._similarity = None - self.discriminator = None - - self.first_index = first_index - if first_face_index is not None: - self.first_face_index = first_face_index - if first is not None: - self.first = first - self.second_index = second_index - if second_face_index is not None: - self.second_face_index = second_face_index - if second is not None: - self.second = second - if score is not None: - self.score = score - if similarity is not None: - self.similarity = similarity - - @property - def first_index(self): - """Gets the first_index of this MatchImageResult. # noqa: E501 - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :return: The first_index of this MatchImageResult. # noqa: E501 - :rtype: int - """ - return self._first_index - - @first_index.setter - def first_index(self, first_index): - """Sets the first_index of this MatchImageResult. - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :param first_index: The first_index of this MatchImageResult. # noqa: E501 - :type first_index: int - """ - if self.local_vars_configuration.client_side_validation and first_index is None: # noqa: E501 - raise ValueError("Invalid value for `first_index`, must not be `None`") # noqa: E501 - - self._first_index = first_index - - @property - def first_face_index(self): - """Gets the first_face_index of this MatchImageResult. # noqa: E501 - - The detected face index number. # noqa: E501 - - :return: The first_face_index of this MatchImageResult. # noqa: E501 - :rtype: float - """ - return self._first_face_index - - @first_face_index.setter - def first_face_index(self, first_face_index): - """Sets the first_face_index of this MatchImageResult. - - The detected face index number. # noqa: E501 - - :param first_face_index: The first_face_index of this MatchImageResult. # noqa: E501 - :type first_face_index: float - """ - - self._first_face_index = first_face_index - - @property - def first(self): - """Gets the first of this MatchImageResult. # noqa: E501 - - - :return: The first of this MatchImageResult. # noqa: E501 - :rtype: ImageSource - """ - return self._first - - @first.setter - def first(self, first): - """Sets the first of this MatchImageResult. - - - :param first: The first of this MatchImageResult. # noqa: E501 - :type first: ImageSource - """ - - self._first = first - - @property - def second_index(self): - """Gets the second_index of this MatchImageResult. # noqa: E501 - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :return: The second_index of this MatchImageResult. # noqa: E501 - :rtype: int - """ - return self._second_index - - @second_index.setter - def second_index(self, second_index): - """Sets the second_index of this MatchImageResult. - - The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated. # noqa: E501 - - :param second_index: The second_index of this MatchImageResult. # noqa: E501 - :type second_index: int - """ - if self.local_vars_configuration.client_side_validation and second_index is None: # noqa: E501 - raise ValueError("Invalid value for `second_index`, must not be `None`") # noqa: E501 - - self._second_index = second_index - - @property - def second_face_index(self): - """Gets the second_face_index of this MatchImageResult. # noqa: E501 - - The detected face index number. # noqa: E501 - - :return: The second_face_index of this MatchImageResult. # noqa: E501 - :rtype: float - """ - return self._second_face_index - - @second_face_index.setter - def second_face_index(self, second_face_index): - """Sets the second_face_index of this MatchImageResult. - - The detected face index number. # noqa: E501 - - :param second_face_index: The second_face_index of this MatchImageResult. # noqa: E501 - :type second_face_index: float - """ - - self._second_face_index = second_face_index - - @property - def second(self): - """Gets the second of this MatchImageResult. # noqa: E501 - - - :return: The second of this MatchImageResult. # noqa: E501 - :rtype: ImageSource - """ - return self._second - - @second.setter - def second(self, second): - """Sets the second of this MatchImageResult. - - - :param second: The second of this MatchImageResult. # noqa: E501 - :type second: ImageSource - """ - - self._second = second - - @property - def score(self): - """Gets the score of this MatchImageResult. # noqa: E501 - - A dimensionless number that shows how similar the compared faces are. 0—absolutely identical faces. # noqa: E501 - - :return: The score of this MatchImageResult. # noqa: E501 - :rtype: float - """ - return self._score - - @score.setter - def score(self, score): - """Sets the score of this MatchImageResult. - - A dimensionless number that shows how similar the compared faces are. 0—absolutely identical faces. # noqa: E501 - - :param score: The score of this MatchImageResult. # noqa: E501 - :type score: float - """ - - self._score = score - - @property - def similarity(self): - """Gets the similarity of this MatchImageResult. # noqa: E501 - - The detected faces similarity, %. 100%—absolutely identical faces, 0%—absolutely not identical. # noqa: E501 - - :return: The similarity of this MatchImageResult. # noqa: E501 - :rtype: float - """ - return self._similarity - - @similarity.setter - def similarity(self, similarity): - """Sets the similarity of this MatchImageResult. - - The detected faces similarity, %. 100%—absolutely identical faces, 0%—absolutely not identical. # noqa: E501 - - :param similarity: The similarity of this MatchImageResult. # noqa: E501 - :type similarity: float - """ - - self._similarity = similarity - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchImageResult): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchImageResult): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_request.py b/regula/facesdk/webclient/gen/model/match_request.py deleted file mode 100644 index 76d15d3..0000000 --- a/regula/facesdk/webclient/gen/model/match_request.py +++ /dev/null @@ -1,233 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tag': 'str', - 'images': '[MatchImage]', - 'output_image_params': 'OutputImageParams', - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'tag': 'tag', - 'images': 'images', - 'output_image_params': 'outputImageParams', - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, tag=None, images=None, output_image_params=None, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """MatchRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tag = None - self._images = None - self._output_image_params = None - self._tenant = None - self._env = None - self.discriminator = None - - if tag is not None: - self.tag = tag - self.images = images - if output_image_params is not None: - self.output_image_params = output_image_params - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def tag(self): - """Gets the tag of this MatchRequest. # noqa: E501 - - Session identificator, should be unique for each session. # noqa: E501 - - :return: The tag of this MatchRequest. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this MatchRequest. - - Session identificator, should be unique for each session. # noqa: E501 - - :param tag: The tag of this MatchRequest. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def images(self): - """Gets the images of this MatchRequest. # noqa: E501 - - An array of images to be processed. At least two images must be provided. # noqa: E501 - - :return: The images of this MatchRequest. # noqa: E501 - :rtype: [MatchImage] - """ - return self._images - - @images.setter - def images(self, images): - """Sets the images of this MatchRequest. - - An array of images to be processed. At least two images must be provided. # noqa: E501 - - :param images: The images of this MatchRequest. # noqa: E501 - :type images: [MatchImage] - """ - if self.local_vars_configuration.client_side_validation and images is None: # noqa: E501 - raise ValueError("Invalid value for `images`, must not be `None`") # noqa: E501 - - self._images = images - - @property - def output_image_params(self): - """Gets the output_image_params of this MatchRequest. # noqa: E501 - - - :return: The output_image_params of this MatchRequest. # noqa: E501 - :rtype: OutputImageParams - """ - return self._output_image_params - - @output_image_params.setter - def output_image_params(self, output_image_params): - """Sets the output_image_params of this MatchRequest. - - - :param output_image_params: The output_image_params of this MatchRequest. # noqa: E501 - :type output_image_params: OutputImageParams - """ - - self._output_image_params = output_image_params - - @property - def tenant(self): - """Gets the tenant of this MatchRequest. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this MatchRequest. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this MatchRequest. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this MatchRequest. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this MatchRequest. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this MatchRequest. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this MatchRequest. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this MatchRequest. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_request_output_image_params.py b/regula/facesdk/webclient/gen/model/match_request_output_image_params.py deleted file mode 100644 index e06275b..0000000 --- a/regula/facesdk/webclient/gen/model/match_request_output_image_params.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 6.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchRequestOutputImageParams(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'background_color': '[int]', - 'crop': 'MatchRequestOutputImageParamsCrop', - } - - attribute_map = { - 'background_color': 'backgroundColor', - 'crop': 'crop', - } - - def __init__(self, background_color=None, crop=None, local_vars_configuration=None): # noqa: E501 - """MatchRequestOutputImageParams - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._background_color = None - self._crop = None - self.discriminator = None - - if background_color is not None: - self.background_color = background_color - if crop is not None: - self.crop = crop - - @property - def background_color(self): - """Gets the background_color of this MatchRequestOutputImageParams. # noqa: E501 - - The RGB value of a color for filling background behind a person's silhouette and for aligning the image. # noqa: E501 - - :return: The background_color of this MatchRequestOutputImageParams. # noqa: E501 - :rtype: [int] - """ - return self._background_color - - @background_color.setter - def background_color(self, background_color): - """Sets the background_color of this MatchRequestOutputImageParams. - - The RGB value of a color for filling background behind a person's silhouette and for aligning the image. # noqa: E501 - - :param background_color: The background_color of this MatchRequestOutputImageParams. # noqa: E501 - :type background_color: [int] - """ - - self._background_color = background_color - - @property - def crop(self): - """Gets the crop of this MatchRequestOutputImageParams. # noqa: E501 - - - :return: The crop of this MatchRequestOutputImageParams. # noqa: E501 - :rtype: MatchRequestOutputImageParamsCrop - """ - return self._crop - - @crop.setter - def crop(self, crop): - """Sets the crop of this MatchRequestOutputImageParams. - - - :param crop: The crop of this MatchRequestOutputImageParams. # noqa: E501 - :type crop: MatchRequestOutputImageParamsCrop - """ - - self._crop = crop - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchRequestOutputImageParams): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchRequestOutputImageParams): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_request_output_image_params_crop.py b/regula/facesdk/webclient/gen/model/match_request_output_image_params_crop.py deleted file mode 100644 index ed94107..0000000 --- a/regula/facesdk/webclient/gen/model/match_request_output_image_params_crop.py +++ /dev/null @@ -1,212 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 6.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchRequestOutputImageParamsCrop(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'pad_color': '[int]', - 'return_original_rect': 'bool', - 'size': '[int]', - 'type': 'int', - } - - attribute_map = { - 'pad_color': 'padColor', - 'return_original_rect': 'returnOriginalRect', - 'size': 'size', - 'type': 'type', - } - - def __init__(self, pad_color=None, return_original_rect=None, size=None, type=None, local_vars_configuration=None): # noqa: E501 - """MatchRequestOutputImageParamsCrop - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._pad_color = None - self._return_original_rect = None - self._size = None - self._type = None - self.discriminator = None - - if pad_color is not None: - self.pad_color = pad_color - if return_original_rect is not None: - self.return_original_rect = return_original_rect - if size is not None: - self.size = size - if type is not None: - self.type = type - - @property - def pad_color(self): - """Gets the pad_color of this MatchRequestOutputImageParamsCrop. # noqa: E501 - - The RGB value of a color for filling background behind a person's silhouette and for aligning the image. # noqa: E501 - - :return: The pad_color of this MatchRequestOutputImageParamsCrop. # noqa: E501 - :rtype: [int] - """ - return self._pad_color - - @pad_color.setter - def pad_color(self, pad_color): - """Sets the pad_color of this MatchRequestOutputImageParamsCrop. - - The RGB value of a color for filling background behind a person's silhouette and for aligning the image. # noqa: E501 - - :param pad_color: The pad_color of this MatchRequestOutputImageParamsCrop. # noqa: E501 - :type pad_color: [int] - """ - - self._pad_color = pad_color - - @property - def return_original_rect(self): - """Gets the return_original_rect of this MatchRequestOutputImageParamsCrop. # noqa: E501 - - Whether to return the coordinates of the rectangle with the face in the original image prepared for the face crop. # noqa: E501 - - :return: The return_original_rect of this MatchRequestOutputImageParamsCrop. # noqa: E501 - :rtype: bool - """ - return self._return_original_rect - - @return_original_rect.setter - def return_original_rect(self, return_original_rect): - """Sets the return_original_rect of this MatchRequestOutputImageParamsCrop. - - Whether to return the coordinates of the rectangle with the face in the original image prepared for the face crop. # noqa: E501 - - :param return_original_rect: The return_original_rect of this MatchRequestOutputImageParamsCrop. # noqa: E501 - :type return_original_rect: bool - """ - - self._return_original_rect = return_original_rect - - @property - def size(self): - """Gets the size of this MatchRequestOutputImageParamsCrop. # noqa: E501 - - The resize value in case `type` matches this value. If it doesn't, no resize is performed. # noqa: E501 - - :return: The size of this MatchRequestOutputImageParamsCrop. # noqa: E501 - :rtype: [int] - """ - return self._size - - @size.setter - def size(self, size): - """Sets the size of this MatchRequestOutputImageParamsCrop. - - The resize value in case `type` matches this value. If it doesn't, no resize is performed. # noqa: E501 - - :param size: The size of this MatchRequestOutputImageParamsCrop. # noqa: E501 - :type size: [int] - """ - - self._size = size - - @property - def type(self): - """Gets the type of this MatchRequestOutputImageParamsCrop. # noqa: E501 - - The aspect ratio according to which face alignment is performed. See the [FaceImageQualityAlignType enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-align-type/). To get a thumbnail with aspect ratio 3:4, set `0`. # noqa: E501 - - :return: The type of this MatchRequestOutputImageParamsCrop. # noqa: E501 - :rtype: int - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this MatchRequestOutputImageParamsCrop. - - The aspect ratio according to which face alignment is performed. See the [FaceImageQualityAlignType enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-align-type/). To get a thumbnail with aspect ratio 3:4, set `0`. # noqa: E501 - - :param type: The type of this MatchRequestOutputImageParamsCrop. # noqa: E501 - :type type: int - """ - allowed_values = [0, 1, 2, 3, 4] # noqa: E501 - if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchRequestOutputImageParamsCrop): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchRequestOutputImageParamsCrop): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_response.py b/regula/facesdk/webclient/gen/model/match_response.py deleted file mode 100644 index 89d9e97..0000000 --- a/regula/facesdk/webclient/gen/model/match_response.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'FaceSDKResultCode', - 'detections': '[MatchImageDetection]', - 'results': '[MatchImageResult]', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'code': 'code', - 'detections': 'detections', - 'results': 'results', - 'metadata': 'metadata', - } - - def __init__(self, code=None, detections=None, results=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """MatchResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._detections = None - self._results = None - self._metadata = None - self.discriminator = None - - self.code = code - if detections is not None: - self.detections = detections - if results is not None: - self.results = results - if metadata is not None: - self.metadata = metadata - - @property - def code(self): - """Gets the code of this MatchResponse. # noqa: E501 - - - :return: The code of this MatchResponse. # noqa: E501 - :rtype: FaceSDKResultCode - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this MatchResponse. - - - :param code: The code of this MatchResponse. # noqa: E501 - :type code: FaceSDKResultCode - """ - if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - - self._code = code - - @property - def detections(self): - """Gets the detections of this MatchResponse. # noqa: E501 - - The detection results. # noqa: E501 - - :return: The detections of this MatchResponse. # noqa: E501 - :rtype: [MatchImageDetection] - """ - return self._detections - - @detections.setter - def detections(self, detections): - """Sets the detections of this MatchResponse. - - The detection results. # noqa: E501 - - :param detections: The detections of this MatchResponse. # noqa: E501 - :type detections: [MatchImageDetection] - """ - - self._detections = detections - - @property - def results(self): - """Gets the results of this MatchResponse. # noqa: E501 - - The comparison results. # noqa: E501 - - :return: The results of this MatchResponse. # noqa: E501 - :rtype: [MatchImageResult] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this MatchResponse. - - The comparison results. # noqa: E501 - - :param results: The results of this MatchResponse. # noqa: E501 - :type results: [MatchImageResult] - """ - - self._results = results - - @property - def metadata(self): - """Gets the metadata of this MatchResponse. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this MatchResponse. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this MatchResponse. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this MatchResponse. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/match_response_all_of.py b/regula/facesdk/webclient/gen/model/match_response_all_of.py deleted file mode 100644 index 11e4f29..0000000 --- a/regula/facesdk/webclient/gen/model/match_response_all_of.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class MatchResponseAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'detections': '[MatchImageDetection]', - 'results': '[MatchImageResult]', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'detections': 'detections', - 'results': 'results', - 'metadata': 'metadata', - } - - def __init__(self, detections=None, results=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """MatchResponseAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._detections = None - self._results = None - self._metadata = None - self.discriminator = None - - if detections is not None: - self.detections = detections - if results is not None: - self.results = results - if metadata is not None: - self.metadata = metadata - - @property - def detections(self): - """Gets the detections of this MatchResponseAllOf. # noqa: E501 - - The detection results. # noqa: E501 - - :return: The detections of this MatchResponseAllOf. # noqa: E501 - :rtype: [MatchImageDetection] - """ - return self._detections - - @detections.setter - def detections(self, detections): - """Sets the detections of this MatchResponseAllOf. - - The detection results. # noqa: E501 - - :param detections: The detections of this MatchResponseAllOf. # noqa: E501 - :type detections: [MatchImageDetection] - """ - - self._detections = detections - - @property - def results(self): - """Gets the results of this MatchResponseAllOf. # noqa: E501 - - The comparison results. # noqa: E501 - - :return: The results of this MatchResponseAllOf. # noqa: E501 - :rtype: [MatchImageResult] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this MatchResponseAllOf. - - The comparison results. # noqa: E501 - - :param results: The results of this MatchResponseAllOf. # noqa: E501 - :type results: [MatchImageResult] - """ - - self._results = results - - @property - def metadata(self): - """Gets the metadata of this MatchResponseAllOf. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this MatchResponseAllOf. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this MatchResponseAllOf. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this MatchResponseAllOf. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MatchResponseAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MatchResponseAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/operation_log.py b/regula/facesdk/webclient/gen/model/operation_log.py deleted file mode 100644 index 8715f65..0000000 --- a/regula/facesdk/webclient/gen/model/operation_log.py +++ /dev/null @@ -1,206 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class OperationLog(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'status_code': 'int', - 'type': 'str', - 'msg': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'status_code': 'statusCode', - 'type': 'type', - 'msg': 'msg', - 'metadata': 'metadata', - } - - def __init__(self, status_code=None, type=None, msg=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """OperationLog - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._status_code = None - self._type = None - self._msg = None - self._metadata = None - self.discriminator = None - - if status_code is not None: - self.status_code = status_code - if type is not None: - self.type = type - if msg is not None: - self.msg = msg - if metadata is not None: - self.metadata = metadata - - @property - def status_code(self): - """Gets the status_code of this OperationLog. # noqa: E501 - - Status code. # noqa: E501 - - :return: The status_code of this OperationLog. # noqa: E501 - :rtype: int - """ - return self._status_code - - @status_code.setter - def status_code(self, status_code): - """Sets the status_code of this OperationLog. - - Status code. # noqa: E501 - - :param status_code: The status_code of this OperationLog. # noqa: E501 - :type status_code: int - """ - - self._status_code = status_code - - @property - def type(self): - """Gets the type of this OperationLog. # noqa: E501 - - Error type. # noqa: E501 - - :return: The type of this OperationLog. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this OperationLog. - - Error type. # noqa: E501 - - :param type: The type of this OperationLog. # noqa: E501 - :type type: str - """ - - self._type = type - - @property - def msg(self): - """Gets the msg of this OperationLog. # noqa: E501 - - Error message. # noqa: E501 - - :return: The msg of this OperationLog. # noqa: E501 - :rtype: str - """ - return self._msg - - @msg.setter - def msg(self, msg): - """Sets the msg of this OperationLog. - - Error message. # noqa: E501 - - :param msg: The msg of this OperationLog. # noqa: E501 - :type msg: str - """ - - self._msg = msg - - @property - def metadata(self): - """Gets the metadata of this OperationLog. # noqa: E501 - - A free-form object containing group's extended attributes. # noqa: E501 - - :return: The metadata of this OperationLog. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this OperationLog. - - A free-form object containing group's extended attributes. # noqa: E501 - - :param metadata: The metadata of this OperationLog. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OperationLog): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OperationLog): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/output_image_params.py b/regula/facesdk/webclient/gen/model/output_image_params.py deleted file mode 100644 index aa850e3..0000000 --- a/regula/facesdk/webclient/gen/model/output_image_params.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class OutputImageParams(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'background_color': 'RGB', - 'crop': 'Crop', - } - - attribute_map = { - 'background_color': 'backgroundColor', - 'crop': 'crop', - } - - def __init__(self, background_color=None, crop=None, local_vars_configuration=None): # noqa: E501 - """OutputImageParams - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._background_color = None - self._crop = None - self.discriminator = None - - if background_color is not None: - self.background_color = background_color - if crop is not None: - self.crop = crop - - @property - def background_color(self): - """Gets the background_color of this OutputImageParams. # noqa: E501 - - - :return: The background_color of this OutputImageParams. # noqa: E501 - :rtype: RGB - """ - return self._background_color - - @background_color.setter - def background_color(self, background_color): - """Sets the background_color of this OutputImageParams. - - - :param background_color: The background_color of this OutputImageParams. # noqa: E501 - :type background_color: RGB - """ - - self._background_color = background_color - - @property - def crop(self): - """Gets the crop of this OutputImageParams. # noqa: E501 - - - :return: The crop of this OutputImageParams. # noqa: E501 - :rtype: Crop - """ - return self._crop - - @crop.setter - def crop(self, crop): - """Sets the crop of this OutputImageParams. - - - :param crop: The crop of this OutputImageParams. # noqa: E501 - :type crop: Crop - """ - - self._crop = crop - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OutputImageParams): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, OutputImageParams): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/page.py b/regula/facesdk/webclient/gen/model/page.py deleted file mode 100644 index 6c94dfd..0000000 --- a/regula/facesdk/webclient/gen/model/page.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class Page(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'page': 'int', - 'total_pages': 'int', - } - - attribute_map = { - 'page': 'page', - 'total_pages': 'totalPages', - } - - def __init__(self, page=None, total_pages=None, local_vars_configuration=None): # noqa: E501 - """Page - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._page = None - self._total_pages = None - self.discriminator = None - - if page is not None: - self.page = page - if total_pages is not None: - self.total_pages = total_pages - - @property - def page(self): - """Gets the page of this Page. # noqa: E501 - - Current page number. # noqa: E501 - - :return: The page of this Page. # noqa: E501 - :rtype: int - """ - return self._page - - @page.setter - def page(self, page): - """Sets the page of this Page. - - Current page number. # noqa: E501 - - :param page: The page of this Page. # noqa: E501 - :type page: int - """ - - self._page = page - - @property - def total_pages(self): - """Gets the total_pages of this Page. # noqa: E501 - - Total number of pages. # noqa: E501 - - :return: The total_pages of this Page. # noqa: E501 - :rtype: int - """ - return self._total_pages - - @total_pages.setter - def total_pages(self, total_pages): - """Sets the total_pages of this Page. - - Total number of pages. # noqa: E501 - - :param total_pages: The total_pages of this Page. # noqa: E501 - :type total_pages: int - """ - - self._total_pages = total_pages - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Page): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Page): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/person.py b/regula/facesdk/webclient/gen/model/person.py deleted file mode 100644 index c847000..0000000 --- a/regula/facesdk/webclient/gen/model/person.py +++ /dev/null @@ -1,319 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class Person(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'external_id': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'groups': '[str]', - 'expire_at': 'str', - 'id': 'str', - 'created_at': 'str', - 'updated_at': 'str', - } - - attribute_map = { - 'name': 'name', - 'external_id': 'externalId', - 'metadata': 'metadata', - 'groups': 'groups', - 'expire_at': 'expireAt', - 'id': 'id', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - } - - def __init__(self, name=None, external_id=None, metadata=None, groups=None, expire_at=None, id=None, created_at=None, updated_at=None, local_vars_configuration=None): # noqa: E501 - """Person - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._external_id = None - self._metadata = None - self._groups = None - self._expire_at = None - self._id = None - self._created_at = None - self._updated_at = None - self.discriminator = None - - self.name = name - if external_id is not None: - self.external_id = external_id - if metadata is not None: - self.metadata = metadata - if groups is not None: - self.groups = groups - if expire_at is not None: - self.expire_at = expire_at - if id is not None: - self.id = id - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - - @property - def name(self): - """Gets the name of this Person. # noqa: E501 - - Person's name. # noqa: E501 - - :return: The name of this Person. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Person. - - Person's name. # noqa: E501 - - :param name: The name of this Person. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def external_id(self): - """Gets the external_id of this Person. # noqa: E501 - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :return: The external_id of this Person. # noqa: E501 - :rtype: str - """ - return self._external_id - - @external_id.setter - def external_id(self, external_id): - """Sets the external_id of this Person. - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :param external_id: The external_id of this Person. # noqa: E501 - :type external_id: str - """ - - self._external_id = external_id - - @property - def metadata(self): - """Gets the metadata of this Person. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this Person. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this Person. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this Person. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def groups(self): - """Gets the groups of this Person. # noqa: E501 - - List of groups this person belongs to. # noqa: E501 - - :return: The groups of this Person. # noqa: E501 - :rtype: [str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this Person. - - List of groups this person belongs to. # noqa: E501 - - :param groups: The groups of this Person. # noqa: E501 - :type groups: [str] - """ - - self._groups = groups - - @property - def expire_at(self): - """Gets the expire_at of this Person. # noqa: E501 - - Person expiration date. # noqa: E501 - - :return: The expire_at of this Person. # noqa: E501 - :rtype: str - """ - return self._expire_at - - @expire_at.setter - def expire_at(self, expire_at): - """Sets the expire_at of this Person. - - Person expiration date. # noqa: E501 - - :param expire_at: The expire_at of this Person. # noqa: E501 - :type expire_at: str - """ - - self._expire_at = expire_at - - @property - def id(self): - """Gets the id of this Person. # noqa: E501 - - Person ID. The list of persons is sorted by decreasing ID value. # noqa: E501 - - :return: The id of this Person. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Person. - - Person ID. The list of persons is sorted by decreasing ID value. # noqa: E501 - - :param id: The id of this Person. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def created_at(self): - """Gets the created_at of this Person. # noqa: E501 - - Person creation date. # noqa: E501 - - :return: The created_at of this Person. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this Person. - - Person creation date. # noqa: E501 - - :param created_at: The created_at of this Person. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - @property - def updated_at(self): - """Gets the updated_at of this Person. # noqa: E501 - - Person update date. # noqa: E501 - - :return: The updated_at of this Person. # noqa: E501 - :rtype: str - """ - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Sets the updated_at of this Person. - - Person update date. # noqa: E501 - - :param updated_at: The updated_at of this Person. # noqa: E501 - :type updated_at: str - """ - - self._updated_at = updated_at - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Person): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Person): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/person_all_of.py b/regula/facesdk/webclient/gen/model/person_all_of.py deleted file mode 100644 index ee1c19f..0000000 --- a/regula/facesdk/webclient/gen/model/person_all_of.py +++ /dev/null @@ -1,206 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'created_at': 'str', - 'updated_at': 'str', - 'groups': '[str]', - } - - attribute_map = { - 'id': 'id', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'groups': 'groups', - } - - def __init__(self, id=None, created_at=None, updated_at=None, groups=None, local_vars_configuration=None): # noqa: E501 - """PersonAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._created_at = None - self._updated_at = None - self._groups = None - self.discriminator = None - - if id is not None: - self.id = id - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - if groups is not None: - self.groups = groups - - @property - def id(self): - """Gets the id of this PersonAllOf. # noqa: E501 - - Person ID. The list of persons is sorted by decreasing ID value. # noqa: E501 - - :return: The id of this PersonAllOf. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this PersonAllOf. - - Person ID. The list of persons is sorted by decreasing ID value. # noqa: E501 - - :param id: The id of this PersonAllOf. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def created_at(self): - """Gets the created_at of this PersonAllOf. # noqa: E501 - - Person creation date. # noqa: E501 - - :return: The created_at of this PersonAllOf. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this PersonAllOf. - - Person creation date. # noqa: E501 - - :param created_at: The created_at of this PersonAllOf. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - @property - def updated_at(self): - """Gets the updated_at of this PersonAllOf. # noqa: E501 - - Person update date. # noqa: E501 - - :return: The updated_at of this PersonAllOf. # noqa: E501 - :rtype: str - """ - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Sets the updated_at of this PersonAllOf. - - Person update date. # noqa: E501 - - :param updated_at: The updated_at of this PersonAllOf. # noqa: E501 - :type updated_at: str - """ - - self._updated_at = updated_at - - @property - def groups(self): - """Gets the groups of this PersonAllOf. # noqa: E501 - - List of groups this person belongs to. # noqa: E501 - - :return: The groups of this PersonAllOf. # noqa: E501 - :rtype: [str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this PersonAllOf. - - List of groups this person belongs to. # noqa: E501 - - :param groups: The groups of this PersonAllOf. # noqa: E501 - :type groups: [str] - """ - - self._groups = groups - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/person_created_response.py b/regula/facesdk/webclient/gen/model/person_created_response.py deleted file mode 100644 index 4d372f0..0000000 --- a/regula/facesdk/webclient/gen/model/person_created_response.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - [Download OpenAPI specification](https://github.com/regulaforensics/FaceSDK-web-openapi) ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 6.1.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonCreatedResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'persons': '[SearchPerson]', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - } - - attribute_map = { - 'code': 'code', - 'persons': 'persons', - 'metadata': 'metadata', - } - - def __init__(self, code=None, persons=None, metadata=None, local_vars_configuration=None): # noqa: E501 - """PersonCreatedResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._persons = None - self._metadata = None - self.discriminator = None - - if code is not None: - self.code = code - if persons is not None: - self.persons = persons - if metadata is not None: - self.metadata = metadata - - @property - def code(self): - """Gets the code of this PersonCreatedResponse. # noqa: E501 - - Result code. # noqa: E501 - - :return: The code of this PersonCreatedResponse. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this PersonCreatedResponse. - - Result code. # noqa: E501 - - :param code: The code of this PersonCreatedResponse. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def persons(self): - """Gets the persons of this PersonCreatedResponse. # noqa: E501 - - Array of Person images. # noqa: E501 - - :return: The persons of this PersonCreatedResponse. # noqa: E501 - :rtype: [SearchPerson] - """ - return self._persons - - @persons.setter - def persons(self, persons): - """Sets the persons of this PersonCreatedResponse. - - Array of Person images. # noqa: E501 - - :param persons: The persons of this PersonCreatedResponse. # noqa: E501 - :type persons: [SearchPerson] - """ - - self._persons = persons - - @property - def metadata(self): - """Gets the metadata of this PersonCreatedResponse. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this PersonCreatedResponse. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this PersonCreatedResponse. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this PersonCreatedResponse. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonCreatedResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonCreatedResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/person_fields.py b/regula/facesdk/webclient/gen/model/person_fields.py deleted file mode 100644 index 7829c45..0000000 --- a/regula/facesdk/webclient/gen/model/person_fields.py +++ /dev/null @@ -1,235 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonFields(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'external_id': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'groups': '[str]', - 'expire_at': 'str', - } - - attribute_map = { - 'name': 'name', - 'external_id': 'externalId', - 'metadata': 'metadata', - 'groups': 'groups', - 'expire_at': 'expireAt', - } - - def __init__(self, name=None, external_id=None, metadata=None, groups=None, expire_at=None, local_vars_configuration=None): # noqa: E501 - """PersonFields - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._external_id = None - self._metadata = None - self._groups = None - self._expire_at = None - self.discriminator = None - - self.name = name - if external_id is not None: - self.external_id = external_id - if metadata is not None: - self.metadata = metadata - if groups is not None: - self.groups = groups - if expire_at is not None: - self.expire_at = expire_at - - @property - def name(self): - """Gets the name of this PersonFields. # noqa: E501 - - Person's name. # noqa: E501 - - :return: The name of this PersonFields. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this PersonFields. - - Person's name. # noqa: E501 - - :param name: The name of this PersonFields. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def external_id(self): - """Gets the external_id of this PersonFields. # noqa: E501 - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :return: The external_id of this PersonFields. # noqa: E501 - :rtype: str - """ - return self._external_id - - @external_id.setter - def external_id(self, external_id): - """Sets the external_id of this PersonFields. - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :param external_id: The external_id of this PersonFields. # noqa: E501 - :type external_id: str - """ - - self._external_id = external_id - - @property - def metadata(self): - """Gets the metadata of this PersonFields. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this PersonFields. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this PersonFields. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this PersonFields. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def groups(self): - """Gets the groups of this PersonFields. # noqa: E501 - - Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it. # noqa: E501 - - :return: The groups of this PersonFields. # noqa: E501 - :rtype: [str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this PersonFields. - - Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it. # noqa: E501 - - :param groups: The groups of this PersonFields. # noqa: E501 - :type groups: [str] - """ - - self._groups = groups - - @property - def expire_at(self): - """Gets the expire_at of this PersonFields. # noqa: E501 - - Person expiration date. # noqa: E501 - - :return: The expire_at of this PersonFields. # noqa: E501 - :rtype: str - """ - return self._expire_at - - @expire_at.setter - def expire_at(self, expire_at): - """Sets the expire_at of this PersonFields. - - Person expiration date. # noqa: E501 - - :param expire_at: The expire_at of this PersonFields. # noqa: E501 - :type expire_at: str - """ - - self._expire_at = expire_at - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonFields): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonFields): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/person_to_update_fields.py b/regula/facesdk/webclient/gen/model/person_to_update_fields.py deleted file mode 100644 index 1ae6700..0000000 --- a/regula/facesdk/webclient/gen/model/person_to_update_fields.py +++ /dev/null @@ -1,206 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonToUpdateFields(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'external_id': 'str', - 'name': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'groups': '[str]', - } - - attribute_map = { - 'external_id': 'externalId', - 'name': 'name', - 'metadata': 'metadata', - 'groups': 'groups', - } - - def __init__(self, external_id=None, name=None, metadata=None, groups=None, local_vars_configuration=None): # noqa: E501 - """PersonToUpdateFields - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._external_id = None - self._name = None - self._metadata = None - self._groups = None - self.discriminator = None - - if external_id is not None: - self.external_id = external_id - if name is not None: - self.name = name - if metadata is not None: - self.metadata = metadata - if groups is not None: - self.groups = groups - - @property - def external_id(self): - """Gets the external_id of this PersonToUpdateFields. # noqa: E501 - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :return: The external_id of this PersonToUpdateFields. # noqa: E501 - :rtype: str - """ - return self._external_id - - @external_id.setter - def external_id(self, external_id): - """Sets the external_id of this PersonToUpdateFields. - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :param external_id: The external_id of this PersonToUpdateFields. # noqa: E501 - :type external_id: str - """ - - self._external_id = external_id - - @property - def name(self): - """Gets the name of this PersonToUpdateFields. # noqa: E501 - - Person's name. # noqa: E501 - - :return: The name of this PersonToUpdateFields. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this PersonToUpdateFields. - - Person's name. # noqa: E501 - - :param name: The name of this PersonToUpdateFields. # noqa: E501 - :type name: str - """ - - self._name = name - - @property - def metadata(self): - """Gets the metadata of this PersonToUpdateFields. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this PersonToUpdateFields. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this PersonToUpdateFields. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this PersonToUpdateFields. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def groups(self): - """Gets the groups of this PersonToUpdateFields. # noqa: E501 - - Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it. # noqa: E501 - - :return: The groups of this PersonToUpdateFields. # noqa: E501 - :rtype: [str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this PersonToUpdateFields. - - Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it. # noqa: E501 - - :param groups: The groups of this PersonToUpdateFields. # noqa: E501 - :type groups: [str] - """ - - self._groups = groups - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonToUpdateFields): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonToUpdateFields): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/person_with_images.py b/regula/facesdk/webclient/gen/model/person_with_images.py deleted file mode 100644 index 002e83d..0000000 --- a/regula/facesdk/webclient/gen/model/person_with_images.py +++ /dev/null @@ -1,347 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonWithImages(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'images': '[RecognizeImage]', - 'name': 'str', - 'external_id': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'groups': '[str]', - 'expire_at': 'str', - 'id': 'str', - 'created_at': 'str', - 'updated_at': 'str', - } - - attribute_map = { - 'images': 'images', - 'name': 'name', - 'external_id': 'externalId', - 'metadata': 'metadata', - 'groups': 'groups', - 'expire_at': 'expireAt', - 'id': 'id', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - } - - def __init__(self, images=None, name=None, external_id=None, metadata=None, groups=None, expire_at=None, id=None, created_at=None, updated_at=None, local_vars_configuration=None): # noqa: E501 - """PersonWithImages - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._images = None - self._name = None - self._external_id = None - self._metadata = None - self._groups = None - self._expire_at = None - self._id = None - self._created_at = None - self._updated_at = None - self.discriminator = None - - if images is not None: - self.images = images - self.name = name - if external_id is not None: - self.external_id = external_id - if metadata is not None: - self.metadata = metadata - if groups is not None: - self.groups = groups - if expire_at is not None: - self.expire_at = expire_at - if id is not None: - self.id = id - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - - @property - def images(self): - """Gets the images of this PersonWithImages. # noqa: E501 - - Detected Persons. # noqa: E501 - - :return: The images of this PersonWithImages. # noqa: E501 - :rtype: [RecognizeImage] - """ - return self._images - - @images.setter - def images(self, images): - """Sets the images of this PersonWithImages. - - Detected Persons. # noqa: E501 - - :param images: The images of this PersonWithImages. # noqa: E501 - :type images: [RecognizeImage] - """ - - self._images = images - - @property - def name(self): - """Gets the name of this PersonWithImages. # noqa: E501 - - Person's name. # noqa: E501 - - :return: The name of this PersonWithImages. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this PersonWithImages. - - Person's name. # noqa: E501 - - :param name: The name of this PersonWithImages. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def external_id(self): - """Gets the external_id of this PersonWithImages. # noqa: E501 - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :return: The external_id of this PersonWithImages. # noqa: E501 - :rtype: str - """ - return self._external_id - - @external_id.setter - def external_id(self, external_id): - """Sets the external_id of this PersonWithImages. - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :param external_id: The external_id of this PersonWithImages. # noqa: E501 - :type external_id: str - """ - - self._external_id = external_id - - @property - def metadata(self): - """Gets the metadata of this PersonWithImages. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this PersonWithImages. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this PersonWithImages. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this PersonWithImages. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def groups(self): - """Gets the groups of this PersonWithImages. # noqa: E501 - - List of groups this person belongs to. # noqa: E501 - - :return: The groups of this PersonWithImages. # noqa: E501 - :rtype: [str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this PersonWithImages. - - List of groups this person belongs to. # noqa: E501 - - :param groups: The groups of this PersonWithImages. # noqa: E501 - :type groups: [str] - """ - - self._groups = groups - - @property - def expire_at(self): - """Gets the expire_at of this PersonWithImages. # noqa: E501 - - Person expiration date. # noqa: E501 - - :return: The expire_at of this PersonWithImages. # noqa: E501 - :rtype: str - """ - return self._expire_at - - @expire_at.setter - def expire_at(self, expire_at): - """Sets the expire_at of this PersonWithImages. - - Person expiration date. # noqa: E501 - - :param expire_at: The expire_at of this PersonWithImages. # noqa: E501 - :type expire_at: str - """ - - self._expire_at = expire_at - - @property - def id(self): - """Gets the id of this PersonWithImages. # noqa: E501 - - Person ID. The list of persons is sorted by decreasing ID value. # noqa: E501 - - :return: The id of this PersonWithImages. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this PersonWithImages. - - Person ID. The list of persons is sorted by decreasing ID value. # noqa: E501 - - :param id: The id of this PersonWithImages. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def created_at(self): - """Gets the created_at of this PersonWithImages. # noqa: E501 - - Person creation date. # noqa: E501 - - :return: The created_at of this PersonWithImages. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this PersonWithImages. - - Person creation date. # noqa: E501 - - :param created_at: The created_at of this PersonWithImages. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - @property - def updated_at(self): - """Gets the updated_at of this PersonWithImages. # noqa: E501 - - Person update date. # noqa: E501 - - :return: The updated_at of this PersonWithImages. # noqa: E501 - :rtype: str - """ - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Sets the updated_at of this PersonWithImages. - - Person update date. # noqa: E501 - - :param updated_at: The updated_at of this PersonWithImages. # noqa: E501 - :type updated_at: str - """ - - self._updated_at = updated_at - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonWithImages): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonWithImages): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/person_with_images_all_of.py b/regula/facesdk/webclient/gen/model/person_with_images_all_of.py deleted file mode 100644 index ed07549..0000000 --- a/regula/facesdk/webclient/gen/model/person_with_images_all_of.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonWithImagesAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'images': '[RecognizeImage]', - } - - attribute_map = { - 'images': 'images', - } - - def __init__(self, images=None, local_vars_configuration=None): # noqa: E501 - """PersonWithImagesAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._images = None - self.discriminator = None - - if images is not None: - self.images = images - - @property - def images(self): - """Gets the images of this PersonWithImagesAllOf. # noqa: E501 - - Detected Persons. # noqa: E501 - - :return: The images of this PersonWithImagesAllOf. # noqa: E501 - :rtype: [RecognizeImage] - """ - return self._images - - @images.setter - def images(self, images): - """Sets the images of this PersonWithImagesAllOf. - - Detected Persons. # noqa: E501 - - :param images: The images of this PersonWithImagesAllOf. # noqa: E501 - :type images: [RecognizeImage] - """ - - self._images = images - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonWithImagesAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonWithImagesAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/persons_page.py b/regula/facesdk/webclient/gen/model/persons_page.py deleted file mode 100644 index 46e38fa..0000000 --- a/regula/facesdk/webclient/gen/model/persons_page.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonsPage(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'items': '[Person]', - 'page': 'int', - 'total_pages': 'int', - } - - attribute_map = { - 'items': 'items', - 'page': 'page', - 'total_pages': 'totalPages', - } - - def __init__(self, items=None, page=None, total_pages=None, local_vars_configuration=None): # noqa: E501 - """PersonsPage - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._items = None - self._page = None - self._total_pages = None - self.discriminator = None - - if items is not None: - self.items = items - if page is not None: - self.page = page - if total_pages is not None: - self.total_pages = total_pages - - @property - def items(self): - """Gets the items of this PersonsPage. # noqa: E501 - - - :return: The items of this PersonsPage. # noqa: E501 - :rtype: [Person] - """ - return self._items - - @items.setter - def items(self, items): - """Sets the items of this PersonsPage. - - - :param items: The items of this PersonsPage. # noqa: E501 - :type items: [Person] - """ - - self._items = items - - @property - def page(self): - """Gets the page of this PersonsPage. # noqa: E501 - - Current page number. # noqa: E501 - - :return: The page of this PersonsPage. # noqa: E501 - :rtype: int - """ - return self._page - - @page.setter - def page(self, page): - """Sets the page of this PersonsPage. - - Current page number. # noqa: E501 - - :param page: The page of this PersonsPage. # noqa: E501 - :type page: int - """ - - self._page = page - - @property - def total_pages(self): - """Gets the total_pages of this PersonsPage. # noqa: E501 - - Total number of pages. # noqa: E501 - - :return: The total_pages of this PersonsPage. # noqa: E501 - :rtype: int - """ - return self._total_pages - - @total_pages.setter - def total_pages(self, total_pages): - """Sets the total_pages of this PersonsPage. - - Total number of pages. # noqa: E501 - - :param total_pages: The total_pages of this PersonsPage. # noqa: E501 - :type total_pages: int - """ - - self._total_pages = total_pages - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonsPage): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonsPage): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/persons_page_all_of.py b/regula/facesdk/webclient/gen/model/persons_page_all_of.py deleted file mode 100644 index b48d786..0000000 --- a/regula/facesdk/webclient/gen/model/persons_page_all_of.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonsPageAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'items': '[Person]', - } - - attribute_map = { - 'items': 'items', - } - - def __init__(self, items=None, local_vars_configuration=None): # noqa: E501 - """PersonsPageAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._items = None - self.discriminator = None - - if items is not None: - self.items = items - - @property - def items(self): - """Gets the items of this PersonsPageAllOf. # noqa: E501 - - - :return: The items of this PersonsPageAllOf. # noqa: E501 - :rtype: [Person] - """ - return self._items - - @items.setter - def items(self, items): - """Sets the items of this PersonsPageAllOf. - - - :param items: The items of this PersonsPageAllOf. # noqa: E501 - :type items: [Person] - """ - - self._items = items - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonsPageAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonsPageAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/persons_request.py b/regula/facesdk/webclient/gen/model/persons_request.py deleted file mode 100644 index 8de61e6..0000000 --- a/regula/facesdk/webclient/gen/model/persons_request.py +++ /dev/null @@ -1,291 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonsRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'external_id': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'groups': '[str]', - 'expire_at': 'str', - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'name': 'name', - 'external_id': 'externalId', - 'metadata': 'metadata', - 'groups': 'groups', - 'expire_at': 'expireAt', - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, name=None, external_id=None, metadata=None, groups=None, expire_at=None, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """PersonsRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._external_id = None - self._metadata = None - self._groups = None - self._expire_at = None - self._tenant = None - self._env = None - self.discriminator = None - - self.name = name - if external_id is not None: - self.external_id = external_id - if metadata is not None: - self.metadata = metadata - if groups is not None: - self.groups = groups - if expire_at is not None: - self.expire_at = expire_at - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def name(self): - """Gets the name of this PersonsRequest. # noqa: E501 - - Person's name. # noqa: E501 - - :return: The name of this PersonsRequest. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this PersonsRequest. - - Person's name. # noqa: E501 - - :param name: The name of this PersonsRequest. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def external_id(self): - """Gets the external_id of this PersonsRequest. # noqa: E501 - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :return: The external_id of this PersonsRequest. # noqa: E501 - :rtype: str - """ - return self._external_id - - @external_id.setter - def external_id(self, external_id): - """Sets the external_id of this PersonsRequest. - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :param external_id: The external_id of this PersonsRequest. # noqa: E501 - :type external_id: str - """ - - self._external_id = external_id - - @property - def metadata(self): - """Gets the metadata of this PersonsRequest. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this PersonsRequest. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this PersonsRequest. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this PersonsRequest. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def groups(self): - """Gets the groups of this PersonsRequest. # noqa: E501 - - Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it. # noqa: E501 - - :return: The groups of this PersonsRequest. # noqa: E501 - :rtype: [str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this PersonsRequest. - - Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it. # noqa: E501 - - :param groups: The groups of this PersonsRequest. # noqa: E501 - :type groups: [str] - """ - - self._groups = groups - - @property - def expire_at(self): - """Gets the expire_at of this PersonsRequest. # noqa: E501 - - Person expiration date. # noqa: E501 - - :return: The expire_at of this PersonsRequest. # noqa: E501 - :rtype: str - """ - return self._expire_at - - @expire_at.setter - def expire_at(self, expire_at): - """Sets the expire_at of this PersonsRequest. - - Person expiration date. # noqa: E501 - - :param expire_at: The expire_at of this PersonsRequest. # noqa: E501 - :type expire_at: str - """ - - self._expire_at = expire_at - - @property - def tenant(self): - """Gets the tenant of this PersonsRequest. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this PersonsRequest. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this PersonsRequest. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this PersonsRequest. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this PersonsRequest. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this PersonsRequest. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this PersonsRequest. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this PersonsRequest. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonsRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonsRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/persons_request_all_of.py b/regula/facesdk/webclient/gen/model/persons_request_all_of.py deleted file mode 100644 index 4a5336f..0000000 --- a/regula/facesdk/webclient/gen/model/persons_request_all_of.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class PersonsRequestAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """PersonsRequestAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tenant = None - self._env = None - self.discriminator = None - - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def tenant(self): - """Gets the tenant of this PersonsRequestAllOf. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this PersonsRequestAllOf. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this PersonsRequestAllOf. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this PersonsRequestAllOf. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this PersonsRequestAllOf. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this PersonsRequestAllOf. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this PersonsRequestAllOf. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this PersonsRequestAllOf. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, PersonsRequestAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, PersonsRequestAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/process_param.py b/regula/facesdk/webclient/gen/model/process_param.py deleted file mode 100644 index 2905750..0000000 --- a/regula/facesdk/webclient/gen/model/process_param.py +++ /dev/null @@ -1,226 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class ProcessParam(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'scenario': 'FaceQualityScenarios', - 'only_central_face': 'bool', - 'output_image_params': 'OutputImageParams', - 'quality': 'QualityRequest', - 'attributes': 'ProcessParamAttributes', - } - - attribute_map = { - 'scenario': 'scenario', - 'only_central_face': 'onlyCentralFace', - 'output_image_params': 'outputImageParams', - 'quality': 'quality', - 'attributes': 'attributes', - } - - def __init__(self, scenario=None, only_central_face=None, output_image_params=None, quality=None, attributes=None, local_vars_configuration=None): # noqa: E501 - """ProcessParam - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._scenario = None - self._only_central_face = None - self._output_image_params = None - self._quality = None - self._attributes = None - self.discriminator = None - - if scenario is not None: - self.scenario = scenario - if only_central_face is not None: - self.only_central_face = only_central_face - if output_image_params is not None: - self.output_image_params = output_image_params - if quality is not None: - self.quality = quality - if attributes is not None: - self.attributes = attributes - - @property - def scenario(self): - """Gets the scenario of this ProcessParam. # noqa: E501 - - - :return: The scenario of this ProcessParam. # noqa: E501 - :rtype: FaceQualityScenarios - """ - return self._scenario - - @scenario.setter - def scenario(self, scenario): - """Sets the scenario of this ProcessParam. - - - :param scenario: The scenario of this ProcessParam. # noqa: E501 - :type scenario: FaceQualityScenarios - """ - - self._scenario = scenario - - @property - def only_central_face(self): - """Gets the only_central_face of this ProcessParam. # noqa: E501 - - Whether to process only the central face in the image. If set to `false`, all the faces are processed. # noqa: E501 - - :return: The only_central_face of this ProcessParam. # noqa: E501 - :rtype: bool - """ - return self._only_central_face - - @only_central_face.setter - def only_central_face(self, only_central_face): - """Sets the only_central_face of this ProcessParam. - - Whether to process only the central face in the image. If set to `false`, all the faces are processed. # noqa: E501 - - :param only_central_face: The only_central_face of this ProcessParam. # noqa: E501 - :type only_central_face: bool - """ - - self._only_central_face = only_central_face - - @property - def output_image_params(self): - """Gets the output_image_params of this ProcessParam. # noqa: E501 - - - :return: The output_image_params of this ProcessParam. # noqa: E501 - :rtype: OutputImageParams - """ - return self._output_image_params - - @output_image_params.setter - def output_image_params(self, output_image_params): - """Sets the output_image_params of this ProcessParam. - - - :param output_image_params: The output_image_params of this ProcessParam. # noqa: E501 - :type output_image_params: OutputImageParams - """ - - self._output_image_params = output_image_params - - @property - def quality(self): - """Gets the quality of this ProcessParam. # noqa: E501 - - - :return: The quality of this ProcessParam. # noqa: E501 - :rtype: QualityRequest - """ - return self._quality - - @quality.setter - def quality(self, quality): - """Sets the quality of this ProcessParam. - - - :param quality: The quality of this ProcessParam. # noqa: E501 - :type quality: QualityRequest - """ - - self._quality = quality - - @property - def attributes(self): - """Gets the attributes of this ProcessParam. # noqa: E501 - - - :return: The attributes of this ProcessParam. # noqa: E501 - :rtype: ProcessParamAttributes - """ - return self._attributes - - @attributes.setter - def attributes(self, attributes): - """Sets the attributes of this ProcessParam. - - - :param attributes: The attributes of this ProcessParam. # noqa: E501 - :type attributes: ProcessParamAttributes - """ - - self._attributes = attributes - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ProcessParam): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ProcessParam): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/process_param_attributes.py b/regula/facesdk/webclient/gen/model/process_param_attributes.py deleted file mode 100644 index 2f7e081..0000000 --- a/regula/facesdk/webclient/gen/model/process_param_attributes.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class ProcessParamAttributes(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'config': 'AttributeConfigList', - } - - attribute_map = { - 'config': 'config', - } - - def __init__(self, config=None, local_vars_configuration=None): # noqa: E501 - """ProcessParamAttributes - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._config = None - self.discriminator = None - - if config is not None: - self.config = config - - @property - def config(self): - """Gets the config of this ProcessParamAttributes. # noqa: E501 - - - :return: The config of this ProcessParamAttributes. # noqa: E501 - :rtype: AttributeConfigList - """ - return self._config - - @config.setter - def config(self, config): - """Sets the config of this ProcessParamAttributes. - - - :param config: The config of this ProcessParamAttributes. # noqa: E501 - :type config: AttributeConfigList - """ - - self._config = config - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ProcessParamAttributes): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ProcessParamAttributes): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/quality_config.py b/regula/facesdk/webclient/gen/model/quality_config.py deleted file mode 100644 index f61d22b..0000000 --- a/regula/facesdk/webclient/gen/model/quality_config.py +++ /dev/null @@ -1,154 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class QualityConfig(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'FaceQualityConfigName', - 'range': '[float]', - } - - attribute_map = { - 'name': 'name', - 'range': 'range', - } - - def __init__(self, name=None, range=None, local_vars_configuration=None): # noqa: E501 - """QualityConfig - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._range = None - self.discriminator = None - - if name is not None: - self.name = name - if range is not None: - self.range = range - - @property - def name(self): - """Gets the name of this QualityConfig. # noqa: E501 - - - :return: The name of this QualityConfig. # noqa: E501 - :rtype: FaceQualityConfigName - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this QualityConfig. - - - :param name: The name of this QualityConfig. # noqa: E501 - :type name: FaceQualityConfigName - """ - - self._name = name - - @property - def range(self): - """Gets the range of this QualityConfig. # noqa: E501 - - The range of applicable values for this characteristic. If the returned in the response value fits this range, the characteristic is identified as compliant with the requirements. For recommended ranges, see [Face Image Quality Assessment](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). # noqa: E501 - - :return: The range of this QualityConfig. # noqa: E501 - :rtype: [float] - """ - return self._range - - @range.setter - def range(self, range): - """Sets the range of this QualityConfig. - - The range of applicable values for this characteristic. If the returned in the response value fits this range, the characteristic is identified as compliant with the requirements. For recommended ranges, see [Face Image Quality Assessment](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). # noqa: E501 - - :param range: The range of this QualityConfig. # noqa: E501 - :type range: [float] - """ - if (self.local_vars_configuration.client_side_validation and - range is not None and len(range) > 2): - raise ValueError("Invalid value for `range`, number of items must be less than or equal to `2`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - range is not None and len(range) < 2): - raise ValueError("Invalid value for `range`, number of items must be greater than or equal to `2`") # noqa: E501 - - self._range = range - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, QualityConfig): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, QualityConfig): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/quality_config_list.py b/regula/facesdk/webclient/gen/model/quality_config_list.py deleted file mode 100644 index 5b7720d..0000000 --- a/regula/facesdk/webclient/gen/model/quality_config_list.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class QualityConfigList(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """QualityConfigList - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, QualityConfigList): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, QualityConfigList): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/quality_detail.py b/regula/facesdk/webclient/gen/model/quality_detail.py deleted file mode 100644 index 13ae8ce..0000000 --- a/regula/facesdk/webclient/gen/model/quality_detail.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class QualityDetail(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'group_id': 'FaceImageQualityGroups', - 'name': 'FaceQualityConfigName', - 'range': '[float]', - 'status': 'FaceImageQualityStatus', - 'value': 'float', - } - - attribute_map = { - 'group_id': 'groupId', - 'name': 'name', - 'range': 'range', - 'status': 'status', - 'value': 'value', - } - - def __init__(self, group_id=None, name=None, range=None, status=None, value=None, local_vars_configuration=None): # noqa: E501 - """QualityDetail - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._group_id = None - self._name = None - self._range = None - self._status = None - self._value = None - self.discriminator = None - - if group_id is not None: - self.group_id = group_id - if name is not None: - self.name = name - if range is not None: - self.range = range - if status is not None: - self.status = status - if value is not None: - self.value = value - - @property - def group_id(self): - """Gets the group_id of this QualityDetail. # noqa: E501 - - - :return: The group_id of this QualityDetail. # noqa: E501 - :rtype: FaceImageQualityGroups - """ - return self._group_id - - @group_id.setter - def group_id(self, group_id): - """Sets the group_id of this QualityDetail. - - - :param group_id: The group_id of this QualityDetail. # noqa: E501 - :type group_id: FaceImageQualityGroups - """ - - self._group_id = group_id - - @property - def name(self): - """Gets the name of this QualityDetail. # noqa: E501 - - - :return: The name of this QualityDetail. # noqa: E501 - :rtype: FaceQualityConfigName - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this QualityDetail. - - - :param name: The name of this QualityDetail. # noqa: E501 - :type name: FaceQualityConfigName - """ - - self._name = name - - @property - def range(self): - """Gets the range of this QualityDetail. # noqa: E501 - - The range of set values for this characteristic, see the [Recommended range column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). # noqa: E501 - - :return: The range of this QualityDetail. # noqa: E501 - :rtype: [float] - """ - return self._range - - @range.setter - def range(self, range): - """Sets the range of this QualityDetail. - - The range of set values for this characteristic, see the [Recommended range column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). # noqa: E501 - - :param range: The range of this QualityDetail. # noqa: E501 - :type range: [float] - """ - if (self.local_vars_configuration.client_side_validation and - range is not None and len(range) > 2): - raise ValueError("Invalid value for `range`, number of items must be less than or equal to `2`") # noqa: E501 - if (self.local_vars_configuration.client_side_validation and - range is not None and len(range) < 2): - raise ValueError("Invalid value for `range`, number of items must be greater than or equal to `2`") # noqa: E501 - - self._range = range - - @property - def status(self): - """Gets the status of this QualityDetail. # noqa: E501 - - - :return: The status of this QualityDetail. # noqa: E501 - :rtype: FaceImageQualityStatus - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this QualityDetail. - - - :param status: The status of this QualityDetail. # noqa: E501 - :type status: FaceImageQualityStatus - """ - - self._status = status - - @property - def value(self): - """Gets the value of this QualityDetail. # noqa: E501 - - The result value for the characteristic, returned in set units. # noqa: E501 - - :return: The value of this QualityDetail. # noqa: E501 - :rtype: float - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this QualityDetail. - - The result value for the characteristic, returned in set units. # noqa: E501 - - :param value: The value of this QualityDetail. # noqa: E501 - :type value: float - """ - - self._value = value - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, QualityDetail): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, QualityDetail): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/quality_details_groups.py b/regula/facesdk/webclient/gen/model/quality_details_groups.py deleted file mode 100644 index 89ffa49..0000000 --- a/regula/facesdk/webclient/gen/model/quality_details_groups.py +++ /dev/null @@ -1,202 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class QualityDetailsGroups(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'group_id': 'FaceImageQualityGroups', - 'name': 'FaceImageQualityGroupsStrings', - 'total_count': 'int', - 'compliant_count': 'int', - } - - attribute_map = { - 'group_id': 'groupId', - 'name': 'name', - 'total_count': 'totalCount', - 'compliant_count': 'compliantCount', - } - - def __init__(self, group_id=None, name=None, total_count=None, compliant_count=None, local_vars_configuration=None): # noqa: E501 - """QualityDetailsGroups - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._group_id = None - self._name = None - self._total_count = None - self._compliant_count = None - self.discriminator = None - - if group_id is not None: - self.group_id = group_id - if name is not None: - self.name = name - if total_count is not None: - self.total_count = total_count - if compliant_count is not None: - self.compliant_count = compliant_count - - @property - def group_id(self): - """Gets the group_id of this QualityDetailsGroups. # noqa: E501 - - - :return: The group_id of this QualityDetailsGroups. # noqa: E501 - :rtype: FaceImageQualityGroups - """ - return self._group_id - - @group_id.setter - def group_id(self, group_id): - """Sets the group_id of this QualityDetailsGroups. - - - :param group_id: The group_id of this QualityDetailsGroups. # noqa: E501 - :type group_id: FaceImageQualityGroups - """ - - self._group_id = group_id - - @property - def name(self): - """Gets the name of this QualityDetailsGroups. # noqa: E501 - - - :return: The name of this QualityDetailsGroups. # noqa: E501 - :rtype: FaceImageQualityGroupsStrings - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this QualityDetailsGroups. - - - :param name: The name of this QualityDetailsGroups. # noqa: E501 - :type name: FaceImageQualityGroupsStrings - """ - - self._name = name - - @property - def total_count(self): - """Gets the total_count of this QualityDetailsGroups. # noqa: E501 - - The total number of characteristics in the group. # noqa: E501 - - :return: The total_count of this QualityDetailsGroups. # noqa: E501 - :rtype: int - """ - return self._total_count - - @total_count.setter - def total_count(self, total_count): - """Sets the total_count of this QualityDetailsGroups. - - The total number of characteristics in the group. # noqa: E501 - - :param total_count: The total_count of this QualityDetailsGroups. # noqa: E501 - :type total_count: int - """ - - self._total_count = total_count - - @property - def compliant_count(self): - """Gets the compliant_count of this QualityDetailsGroups. # noqa: E501 - - The number of compliant characteristics in the group. # noqa: E501 - - :return: The compliant_count of this QualityDetailsGroups. # noqa: E501 - :rtype: int - """ - return self._compliant_count - - @compliant_count.setter - def compliant_count(self, compliant_count): - """Sets the compliant_count of this QualityDetailsGroups. - - The number of compliant characteristics in the group. # noqa: E501 - - :param compliant_count: The compliant_count of this QualityDetailsGroups. # noqa: E501 - :type compliant_count: int - """ - - self._compliant_count = compliant_count - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, QualityDetailsGroups): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, QualityDetailsGroups): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/quality_request.py b/regula/facesdk/webclient/gen/model/quality_request.py deleted file mode 100644 index 11019d9..0000000 --- a/regula/facesdk/webclient/gen/model/quality_request.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class QualityRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'background_match_color': 'RGB', - 'config': 'QualityConfigList', - } - - attribute_map = { - 'background_match_color': 'backgroundMatchColor', - 'config': 'config', - } - - def __init__(self, background_match_color=None, config=None, local_vars_configuration=None): # noqa: E501 - """QualityRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._background_match_color = None - self._config = None - self.discriminator = None - - if background_match_color is not None: - self.background_match_color = background_match_color - if config is not None: - self.config = config - - @property - def background_match_color(self): - """Gets the background_match_color of this QualityRequest. # noqa: E501 - - - :return: The background_match_color of this QualityRequest. # noqa: E501 - :rtype: RGB - """ - return self._background_match_color - - @background_match_color.setter - def background_match_color(self, background_match_color): - """Sets the background_match_color of this QualityRequest. - - - :param background_match_color: The background_match_color of this QualityRequest. # noqa: E501 - :type background_match_color: RGB - """ - - self._background_match_color = background_match_color - - @property - def config(self): - """Gets the config of this QualityRequest. # noqa: E501 - - - :return: The config of this QualityRequest. # noqa: E501 - :rtype: QualityConfigList - """ - return self._config - - @config.setter - def config(self, config): - """Sets the config of this QualityRequest. - - - :param config: The config of this QualityRequest. # noqa: E501 - :type config: QualityConfigList - """ - - self._config = config - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, QualityRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, QualityRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/recognize_image.py b/regula/facesdk/webclient/gen/model/recognize_image.py deleted file mode 100644 index 21c05e6..0000000 --- a/regula/facesdk/webclient/gen/model/recognize_image.py +++ /dev/null @@ -1,374 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class RecognizeImage(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'str', - 'content': 'str', - 'content_type': 'str', - 'created_at': 'str', - 'updated_at': 'str', - 'path': 'str', - 'url': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'similarity': 'float', - 'distance': 'float', - } - - attribute_map = { - 'id': 'id', - 'content': 'content', - 'content_type': 'contentType', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'path': 'path', - 'url': 'url', - 'metadata': 'metadata', - 'similarity': 'similarity', - 'distance': 'distance', - } - - def __init__(self, id=None, content=None, content_type=None, created_at=None, updated_at=None, path=None, url=None, metadata=None, similarity=None, distance=None, local_vars_configuration=None): # noqa: E501 - """RecognizeImage - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._content = None - self._content_type = None - self._created_at = None - self._updated_at = None - self._path = None - self._url = None - self._metadata = None - self._similarity = None - self._distance = None - self.discriminator = None - - if id is not None: - self.id = id - if content is not None: - self.content = content - if content_type is not None: - self.content_type = content_type - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - if path is not None: - self.path = path - if url is not None: - self.url = url - if metadata is not None: - self.metadata = metadata - if similarity is not None: - self.similarity = similarity - if distance is not None: - self.distance = distance - - @property - def id(self): - """Gets the id of this RecognizeImage. # noqa: E501 - - Response image ID. The list is sorted by decreasing ID value. # noqa: E501 - - :return: The id of this RecognizeImage. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this RecognizeImage. - - Response image ID. The list is sorted by decreasing ID value. # noqa: E501 - - :param id: The id of this RecognizeImage. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def content(self): - """Gets the content of this RecognizeImage. # noqa: E501 - - Base64-encoded image. Returned only if `withImages` is set to true in the request. # noqa: E501 - - :return: The content of this RecognizeImage. # noqa: E501 - :rtype: str - """ - return self._content - - @content.setter - def content(self, content): - """Sets the content of this RecognizeImage. - - Base64-encoded image. Returned only if `withImages` is set to true in the request. # noqa: E501 - - :param content: The content of this RecognizeImage. # noqa: E501 - :type content: str - """ - - self._content = content - - @property - def content_type(self): - """Gets the content_type of this RecognizeImage. # noqa: E501 - - Original media type of the returned image. # noqa: E501 - - :return: The content_type of this RecognizeImage. # noqa: E501 - :rtype: str - """ - return self._content_type - - @content_type.setter - def content_type(self, content_type): - """Sets the content_type of this RecognizeImage. - - Original media type of the returned image. # noqa: E501 - - :param content_type: The content_type of this RecognizeImage. # noqa: E501 - :type content_type: str - """ - - self._content_type = content_type - - @property - def created_at(self): - """Gets the created_at of this RecognizeImage. # noqa: E501 - - Returned image creation date. # noqa: E501 - - :return: The created_at of this RecognizeImage. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this RecognizeImage. - - Returned image creation date. # noqa: E501 - - :param created_at: The created_at of this RecognizeImage. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - @property - def updated_at(self): - """Gets the updated_at of this RecognizeImage. # noqa: E501 - - Returned image update date. # noqa: E501 - - :return: The updated_at of this RecognizeImage. # noqa: E501 - :rtype: str - """ - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Sets the updated_at of this RecognizeImage. - - Returned image update date. # noqa: E501 - - :param updated_at: The updated_at of this RecognizeImage. # noqa: E501 - :type updated_at: str - """ - - self._updated_at = updated_at - - @property - def path(self): - """Gets the path of this RecognizeImage. # noqa: E501 - - Returned image path. # noqa: E501 - - :return: The path of this RecognizeImage. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this RecognizeImage. - - Returned image path. # noqa: E501 - - :param path: The path of this RecognizeImage. # noqa: E501 - :type path: str - """ - - self._path = path - - @property - def url(self): - """Gets the url of this RecognizeImage. # noqa: E501 - - Returned image URL. # noqa: E501 - - :return: The url of this RecognizeImage. # noqa: E501 - :rtype: str - """ - return self._url - - @url.setter - def url(self, url): - """Sets the url of this RecognizeImage. - - Returned image URL. # noqa: E501 - - :param url: The url of this RecognizeImage. # noqa: E501 - :type url: str - """ - - self._url = url - - @property - def metadata(self): - """Gets the metadata of this RecognizeImage. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this RecognizeImage. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this RecognizeImage. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this RecognizeImage. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def similarity(self): - """Gets the similarity of this RecognizeImage. # noqa: E501 - - Similarity score. # noqa: E501 - - :return: The similarity of this RecognizeImage. # noqa: E501 - :rtype: float - """ - return self._similarity - - @similarity.setter - def similarity(self, similarity): - """Sets the similarity of this RecognizeImage. - - Similarity score. # noqa: E501 - - :param similarity: The similarity of this RecognizeImage. # noqa: E501 - :type similarity: float - """ - - self._similarity = similarity - - @property - def distance(self): - """Gets the distance of this RecognizeImage. # noqa: E501 - - Similarity distance score: the lower the distance, the higher the face's similarity. # noqa: E501 - - :return: The distance of this RecognizeImage. # noqa: E501 - :rtype: float - """ - return self._distance - - @distance.setter - def distance(self, distance): - """Sets the distance of this RecognizeImage. - - Similarity distance score: the lower the distance, the higher the face's similarity. # noqa: E501 - - :param distance: The distance of this RecognizeImage. # noqa: E501 - :type distance: float - """ - - self._distance = distance - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, RecognizeImage): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, RecognizeImage): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/recognize_image_all_of.py b/regula/facesdk/webclient/gen/model/recognize_image_all_of.py deleted file mode 100644 index 6eaddde..0000000 --- a/regula/facesdk/webclient/gen/model/recognize_image_all_of.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class RecognizeImageAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'similarity': 'float', - 'distance': 'float', - } - - attribute_map = { - 'similarity': 'similarity', - 'distance': 'distance', - } - - def __init__(self, similarity=None, distance=None, local_vars_configuration=None): # noqa: E501 - """RecognizeImageAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._similarity = None - self._distance = None - self.discriminator = None - - if similarity is not None: - self.similarity = similarity - if distance is not None: - self.distance = distance - - @property - def similarity(self): - """Gets the similarity of this RecognizeImageAllOf. # noqa: E501 - - Similarity score. # noqa: E501 - - :return: The similarity of this RecognizeImageAllOf. # noqa: E501 - :rtype: float - """ - return self._similarity - - @similarity.setter - def similarity(self, similarity): - """Sets the similarity of this RecognizeImageAllOf. - - Similarity score. # noqa: E501 - - :param similarity: The similarity of this RecognizeImageAllOf. # noqa: E501 - :type similarity: float - """ - - self._similarity = similarity - - @property - def distance(self): - """Gets the distance of this RecognizeImageAllOf. # noqa: E501 - - Similarity distance score: the lower the distance, the higher the face's similarity. # noqa: E501 - - :return: The distance of this RecognizeImageAllOf. # noqa: E501 - :rtype: float - """ - return self._distance - - @distance.setter - def distance(self, distance): - """Sets the distance of this RecognizeImageAllOf. - - Similarity distance score: the lower the distance, the higher the face's similarity. # noqa: E501 - - :param distance: The distance of this RecognizeImageAllOf. # noqa: E501 - :type distance: float - """ - - self._distance = distance - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, RecognizeImageAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, RecognizeImageAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/resize_options.py b/regula/facesdk/webclient/gen/model/resize_options.py deleted file mode 100644 index a510e73..0000000 --- a/regula/facesdk/webclient/gen/model/resize_options.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class ResizeOptions(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'width': 'int', - 'height': 'int', - 'quality': 'int', - } - - attribute_map = { - 'width': 'width', - 'height': 'height', - 'quality': 'quality', - } - - def __init__(self, width=None, height=None, quality=100, local_vars_configuration=None): # noqa: E501 - """ResizeOptions - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._width = None - self._height = None - self._quality = None - self.discriminator = None - - if width is not None: - self.width = width - if height is not None: - self.height = height - if quality is not None: - self.quality = quality - - @property - def width(self): - """Gets the width of this ResizeOptions. # noqa: E501 - - Resized image width, px. # noqa: E501 - - :return: The width of this ResizeOptions. # noqa: E501 - :rtype: int - """ - return self._width - - @width.setter - def width(self, width): - """Sets the width of this ResizeOptions. - - Resized image width, px. # noqa: E501 - - :param width: The width of this ResizeOptions. # noqa: E501 - :type width: int - """ - - self._width = width - - @property - def height(self): - """Gets the height of this ResizeOptions. # noqa: E501 - - Resized image height, px. # noqa: E501 - - :return: The height of this ResizeOptions. # noqa: E501 - :rtype: int - """ - return self._height - - @height.setter - def height(self, height): - """Sets the height of this ResizeOptions. - - Resized image height, px. # noqa: E501 - - :param height: The height of this ResizeOptions. # noqa: E501 - :type height: int - """ - - self._height = height - - @property - def quality(self): - """Gets the quality of this ResizeOptions. # noqa: E501 - - Resized image quality, percent. # noqa: E501 - - :return: The quality of this ResizeOptions. # noqa: E501 - :rtype: int - """ - return self._quality - - @quality.setter - def quality(self, quality): - """Sets the quality of this ResizeOptions. - - Resized image quality, percent. # noqa: E501 - - :param quality: The quality of this ResizeOptions. # noqa: E501 - :type quality: int - """ - - self._quality = quality - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ResizeOptions): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, ResizeOptions): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/rgb.py b/regula/facesdk/webclient/gen/model/rgb.py deleted file mode 100644 index 767121d..0000000 --- a/regula/facesdk/webclient/gen/model/rgb.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class RGB(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """RGB - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, RGB): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, RGB): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_bad_params.py b/regula/facesdk/webclient/gen/model/search_bad_params.py deleted file mode 100644 index 0232ec6..0000000 --- a/regula/facesdk/webclient/gen/model/search_bad_params.py +++ /dev/null @@ -1,172 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchBadParams(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'msg': 'str', - 'status_code': 'int', - 'type': 'str', - } - - attribute_map = { - 'msg': 'msg', - 'status_code': 'statusCode', - 'type': 'type', - } - - def __init__(self, msg="Descriptor already calculated", status_code=400, type="BadParamsException", local_vars_configuration=None): # noqa: E501 - """SearchBadParams - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._msg = None - self._status_code = None - self._type = None - self.discriminator = None - - if msg is not None: - self.msg = msg - if status_code is not None: - self.status_code = status_code - if type is not None: - self.type = type - - @property - def msg(self): - """Gets the msg of this SearchBadParams. # noqa: E501 - - - :return: The msg of this SearchBadParams. # noqa: E501 - :rtype: str - """ - return self._msg - - @msg.setter - def msg(self, msg): - """Sets the msg of this SearchBadParams. - - - :param msg: The msg of this SearchBadParams. # noqa: E501 - :type msg: str - """ - - self._msg = msg - - @property - def status_code(self): - """Gets the status_code of this SearchBadParams. # noqa: E501 - - - :return: The status_code of this SearchBadParams. # noqa: E501 - :rtype: int - """ - return self._status_code - - @status_code.setter - def status_code(self, status_code): - """Sets the status_code of this SearchBadParams. - - - :param status_code: The status_code of this SearchBadParams. # noqa: E501 - :type status_code: int - """ - - self._status_code = status_code - - @property - def type(self): - """Gets the type of this SearchBadParams. # noqa: E501 - - - :return: The type of this SearchBadParams. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SearchBadParams. - - - :param type: The type of this SearchBadParams. # noqa: E501 - :type type: str - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchBadParams): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchBadParams): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_detection.py b/regula/facesdk/webclient/gen/model/search_detection.py deleted file mode 100644 index 93f7c95..0000000 --- a/regula/facesdk/webclient/gen/model/search_detection.py +++ /dev/null @@ -1,398 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchDetection(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'crop': 'str', - 'detector_type': 'int', - 'hash': 'str', - 'idx': 'int', - 'image': 'str', - 'landmarks': '[[int]]', - 'landmarks_type': 'int', - 'msg': 'str', - 'roi': 'FaceRectangular', - 'version_sdk': 'str', - } - - attribute_map = { - 'code': 'code', - 'crop': 'crop', - 'detector_type': 'detectorType', - 'hash': 'hash', - 'idx': 'idx', - 'image': 'image', - 'landmarks': 'landmarks', - 'landmarks_type': 'landmarksType', - 'msg': 'msg', - 'roi': 'roi', - 'version_sdk': 'versionSDK', - } - - def __init__(self, code=None, crop=None, detector_type=None, hash=None, idx=None, image=None, landmarks=None, landmarks_type=None, msg=None, roi=None, version_sdk=None, local_vars_configuration=None): # noqa: E501 - """SearchDetection - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._crop = None - self._detector_type = None - self._hash = None - self._idx = None - self._image = None - self._landmarks = None - self._landmarks_type = None - self._msg = None - self._roi = None - self._version_sdk = None - self.discriminator = None - - if code is not None: - self.code = code - if crop is not None: - self.crop = crop - if detector_type is not None: - self.detector_type = detector_type - if hash is not None: - self.hash = hash - if idx is not None: - self.idx = idx - if image is not None: - self.image = image - if landmarks is not None: - self.landmarks = landmarks - if landmarks_type is not None: - self.landmarks_type = landmarks_type - if msg is not None: - self.msg = msg - if roi is not None: - self.roi = roi - if version_sdk is not None: - self.version_sdk = version_sdk - - @property - def code(self): - """Gets the code of this SearchDetection. # noqa: E501 - - Internal. # noqa: E501 - - :return: The code of this SearchDetection. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this SearchDetection. - - Internal. # noqa: E501 - - :param code: The code of this SearchDetection. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def crop(self): - """Gets the crop of this SearchDetection. # noqa: E501 - - Base64 of the aligned and cropped portrait. # noqa: E501 - - :return: The crop of this SearchDetection. # noqa: E501 - :rtype: str - """ - return self._crop - - @crop.setter - def crop(self, crop): - """Sets the crop of this SearchDetection. - - Base64 of the aligned and cropped portrait. # noqa: E501 - - :param crop: The crop of this SearchDetection. # noqa: E501 - :type crop: str - """ - - self._crop = crop - - @property - def detector_type(self): - """Gets the detector_type of this SearchDetection. # noqa: E501 - - Internal. # noqa: E501 - - :return: The detector_type of this SearchDetection. # noqa: E501 - :rtype: int - """ - return self._detector_type - - @detector_type.setter - def detector_type(self, detector_type): - """Sets the detector_type of this SearchDetection. - - Internal. # noqa: E501 - - :param detector_type: The detector_type of this SearchDetection. # noqa: E501 - :type detector_type: int - """ - - self._detector_type = detector_type - - @property - def hash(self): - """Gets the hash of this SearchDetection. # noqa: E501 - - Internal. # noqa: E501 - - :return: The hash of this SearchDetection. # noqa: E501 - :rtype: str - """ - return self._hash - - @hash.setter - def hash(self, hash): - """Sets the hash of this SearchDetection. - - Internal. # noqa: E501 - - :param hash: The hash of this SearchDetection. # noqa: E501 - :type hash: str - """ - - self._hash = hash - - @property - def idx(self): - """Gets the idx of this SearchDetection. # noqa: E501 - - Internal. # noqa: E501 - - :return: The idx of this SearchDetection. # noqa: E501 - :rtype: int - """ - return self._idx - - @idx.setter - def idx(self, idx): - """Sets the idx of this SearchDetection. - - Internal. # noqa: E501 - - :param idx: The idx of this SearchDetection. # noqa: E501 - :type idx: int - """ - - self._idx = idx - - @property - def image(self): - """Gets the image of this SearchDetection. # noqa: E501 - - Internal. # noqa: E501 - - :return: The image of this SearchDetection. # noqa: E501 - :rtype: str - """ - return self._image - - @image.setter - def image(self, image): - """Sets the image of this SearchDetection. - - Internal. # noqa: E501 - - :param image: The image of this SearchDetection. # noqa: E501 - :type image: str - """ - - self._image = image - - @property - def landmarks(self): - """Gets the landmarks of this SearchDetection. # noqa: E501 - - Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips. # noqa: E501 - - :return: The landmarks of this SearchDetection. # noqa: E501 - :rtype: [[int]] - """ - return self._landmarks - - @landmarks.setter - def landmarks(self, landmarks): - """Sets the landmarks of this SearchDetection. - - Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips. # noqa: E501 - - :param landmarks: The landmarks of this SearchDetection. # noqa: E501 - :type landmarks: [[int]] - """ - - self._landmarks = landmarks - - @property - def landmarks_type(self): - """Gets the landmarks_type of this SearchDetection. # noqa: E501 - - Internal. # noqa: E501 - - :return: The landmarks_type of this SearchDetection. # noqa: E501 - :rtype: int - """ - return self._landmarks_type - - @landmarks_type.setter - def landmarks_type(self, landmarks_type): - """Sets the landmarks_type of this SearchDetection. - - Internal. # noqa: E501 - - :param landmarks_type: The landmarks_type of this SearchDetection. # noqa: E501 - :type landmarks_type: int - """ - - self._landmarks_type = landmarks_type - - @property - def msg(self): - """Gets the msg of this SearchDetection. # noqa: E501 - - Internal. # noqa: E501 - - :return: The msg of this SearchDetection. # noqa: E501 - :rtype: str - """ - return self._msg - - @msg.setter - def msg(self, msg): - """Sets the msg of this SearchDetection. - - Internal. # noqa: E501 - - :param msg: The msg of this SearchDetection. # noqa: E501 - :type msg: str - """ - - self._msg = msg - - @property - def roi(self): - """Gets the roi of this SearchDetection. # noqa: E501 - - - :return: The roi of this SearchDetection. # noqa: E501 - :rtype: FaceRectangular - """ - return self._roi - - @roi.setter - def roi(self, roi): - """Sets the roi of this SearchDetection. - - - :param roi: The roi of this SearchDetection. # noqa: E501 - :type roi: FaceRectangular - """ - - self._roi = roi - - @property - def version_sdk(self): - """Gets the version_sdk of this SearchDetection. # noqa: E501 - - - :return: The version_sdk of this SearchDetection. # noqa: E501 - :rtype: str - """ - return self._version_sdk - - @version_sdk.setter - def version_sdk(self, version_sdk): - """Sets the version_sdk of this SearchDetection. - - - :param version_sdk: The version_sdk of this SearchDetection. # noqa: E501 - :type version_sdk: str - """ - - self._version_sdk = version_sdk - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchDetection): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchDetection): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_parameters.py b/regula/facesdk/webclient/gen/model/search_parameters.py deleted file mode 100644 index b8e6ec4..0000000 --- a/regula/facesdk/webclient/gen/model/search_parameters.py +++ /dev/null @@ -1,174 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchParameters(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'create_person': 'SearchParametersCreatePerson', - 'group_ids': '[str]', - 'filter': 'FilterSearchRequest', - } - - attribute_map = { - 'create_person': 'createPerson', - 'group_ids': 'groupIds', - 'filter': 'filter', - } - - def __init__(self, create_person=None, group_ids=None, filter=None, local_vars_configuration=None): # noqa: E501 - """SearchParameters - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._create_person = None - self._group_ids = None - self._filter = None - self.discriminator = None - - if create_person is not None: - self.create_person = create_person - if group_ids is not None: - self.group_ids = group_ids - if filter is not None: - self.filter = filter - - @property - def create_person(self): - """Gets the create_person of this SearchParameters. # noqa: E501 - - - :return: The create_person of this SearchParameters. # noqa: E501 - :rtype: SearchParametersCreatePerson - """ - return self._create_person - - @create_person.setter - def create_person(self, create_person): - """Sets the create_person of this SearchParameters. - - - :param create_person: The create_person of this SearchParameters. # noqa: E501 - :type create_person: SearchParametersCreatePerson - """ - - self._create_person = create_person - - @property - def group_ids(self): - """Gets the group_ids of this SearchParameters. # noqa: E501 - - IDs of the groups in which the search is performed. # noqa: E501 - - :return: The group_ids of this SearchParameters. # noqa: E501 - :rtype: [str] - """ - return self._group_ids - - @group_ids.setter - def group_ids(self, group_ids): - """Sets the group_ids of this SearchParameters. - - IDs of the groups in which the search is performed. # noqa: E501 - - :param group_ids: The group_ids of this SearchParameters. # noqa: E501 - :type group_ids: [str] - """ - - self._group_ids = group_ids - - @property - def filter(self): - """Gets the filter of this SearchParameters. # noqa: E501 - - - :return: The filter of this SearchParameters. # noqa: E501 - :rtype: FilterSearchRequest - """ - return self._filter - - @filter.setter - def filter(self, filter): - """Sets the filter of this SearchParameters. - - - :param filter: The filter of this SearchParameters. # noqa: E501 - :type filter: FilterSearchRequest - """ - - self._filter = filter - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchParameters): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchParameters): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_parameters_create_person.py b/regula/facesdk/webclient/gen/model/search_parameters_create_person.py deleted file mode 100644 index f9a7912..0000000 --- a/regula/facesdk/webclient/gen/model/search_parameters_create_person.py +++ /dev/null @@ -1,177 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchParametersCreatePerson(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'ttl': 'int, none_type', - } - - attribute_map = { - 'name': 'name', - 'metadata': 'metadata', - 'ttl': 'ttl', - } - - def __init__(self, name=None, metadata=None, ttl=None, local_vars_configuration=None): # noqa: E501 - """SearchParametersCreatePerson - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._metadata = None - self._ttl = None - self.discriminator = None - - if name is not None: - self.name = name - if metadata is not None: - self.metadata = metadata - self.ttl = ttl - - @property - def name(self): - """Gets the name of this SearchParametersCreatePerson. # noqa: E501 - - Person's name. # noqa: E501 - - :return: The name of this SearchParametersCreatePerson. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this SearchParametersCreatePerson. - - Person's name. # noqa: E501 - - :param name: The name of this SearchParametersCreatePerson. # noqa: E501 - :type name: str - """ - - self._name = name - - @property - def metadata(self): - """Gets the metadata of this SearchParametersCreatePerson. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this SearchParametersCreatePerson. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this SearchParametersCreatePerson. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this SearchParametersCreatePerson. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def ttl(self): - """Gets the ttl of this SearchParametersCreatePerson. # noqa: E501 - - The lifespan of the Person's records, seconds. Optional. # noqa: E501 - - :return: The ttl of this SearchParametersCreatePerson. # noqa: E501 - :rtype: int, none_type - """ - return self._ttl - - @ttl.setter - def ttl(self, ttl): - """Sets the ttl of this SearchParametersCreatePerson. - - The lifespan of the Person's records, seconds. Optional. # noqa: E501 - - :param ttl: The ttl of this SearchParametersCreatePerson. # noqa: E501 - :type ttl: int, none_type - """ - - self._ttl = ttl - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchParametersCreatePerson): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchParametersCreatePerson): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_person.py b/regula/facesdk/webclient/gen/model/search_person.py deleted file mode 100644 index 81edc54..0000000 --- a/regula/facesdk/webclient/gen/model/search_person.py +++ /dev/null @@ -1,373 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchPerson(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'name': 'str', - 'external_id': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'groups': '[str]', - 'expire_at': 'str', - 'id': 'str', - 'created_at': 'str', - 'updated_at': 'str', - 'detection': 'SearchDetection', - 'images': '[RecognizeImage]', - } - - attribute_map = { - 'name': 'name', - 'external_id': 'externalId', - 'metadata': 'metadata', - 'groups': 'groups', - 'expire_at': 'expireAt', - 'id': 'id', - 'created_at': 'createdAt', - 'updated_at': 'updatedAt', - 'detection': 'detection', - 'images': 'images', - } - - def __init__(self, name=None, external_id=None, metadata=None, groups=None, expire_at=None, id=None, created_at=None, updated_at=None, detection=None, images=None, local_vars_configuration=None): # noqa: E501 - """SearchPerson - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._name = None - self._external_id = None - self._metadata = None - self._groups = None - self._expire_at = None - self._id = None - self._created_at = None - self._updated_at = None - self._detection = None - self._images = None - self.discriminator = None - - self.name = name - if external_id is not None: - self.external_id = external_id - if metadata is not None: - self.metadata = metadata - if groups is not None: - self.groups = groups - if expire_at is not None: - self.expire_at = expire_at - if id is not None: - self.id = id - if created_at is not None: - self.created_at = created_at - if updated_at is not None: - self.updated_at = updated_at - if detection is not None: - self.detection = detection - if images is not None: - self.images = images - - @property - def name(self): - """Gets the name of this SearchPerson. # noqa: E501 - - Person's name. # noqa: E501 - - :return: The name of this SearchPerson. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this SearchPerson. - - Person's name. # noqa: E501 - - :param name: The name of this SearchPerson. # noqa: E501 - :type name: str - """ - if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def external_id(self): - """Gets the external_id of this SearchPerson. # noqa: E501 - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :return: The external_id of this SearchPerson. # noqa: E501 - :rtype: str - """ - return self._external_id - - @external_id.setter - def external_id(self, external_id): - """Sets the external_id of this SearchPerson. - - Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional. # noqa: E501 - - :param external_id: The external_id of this SearchPerson. # noqa: E501 - :type external_id: str - """ - - self._external_id = external_id - - @property - def metadata(self): - """Gets the metadata of this SearchPerson. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this SearchPerson. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this SearchPerson. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this SearchPerson. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def groups(self): - """Gets the groups of this SearchPerson. # noqa: E501 - - List of groups this person belongs to. # noqa: E501 - - :return: The groups of this SearchPerson. # noqa: E501 - :rtype: [str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this SearchPerson. - - List of groups this person belongs to. # noqa: E501 - - :param groups: The groups of this SearchPerson. # noqa: E501 - :type groups: [str] - """ - - self._groups = groups - - @property - def expire_at(self): - """Gets the expire_at of this SearchPerson. # noqa: E501 - - Person expiration date. # noqa: E501 - - :return: The expire_at of this SearchPerson. # noqa: E501 - :rtype: str - """ - return self._expire_at - - @expire_at.setter - def expire_at(self, expire_at): - """Sets the expire_at of this SearchPerson. - - Person expiration date. # noqa: E501 - - :param expire_at: The expire_at of this SearchPerson. # noqa: E501 - :type expire_at: str - """ - - self._expire_at = expire_at - - @property - def id(self): - """Gets the id of this SearchPerson. # noqa: E501 - - Person ID. The list of persons is sorted by decreasing ID value. # noqa: E501 - - :return: The id of this SearchPerson. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SearchPerson. - - Person ID. The list of persons is sorted by decreasing ID value. # noqa: E501 - - :param id: The id of this SearchPerson. # noqa: E501 - :type id: str - """ - - self._id = id - - @property - def created_at(self): - """Gets the created_at of this SearchPerson. # noqa: E501 - - Person creation date. # noqa: E501 - - :return: The created_at of this SearchPerson. # noqa: E501 - :rtype: str - """ - return self._created_at - - @created_at.setter - def created_at(self, created_at): - """Sets the created_at of this SearchPerson. - - Person creation date. # noqa: E501 - - :param created_at: The created_at of this SearchPerson. # noqa: E501 - :type created_at: str - """ - - self._created_at = created_at - - @property - def updated_at(self): - """Gets the updated_at of this SearchPerson. # noqa: E501 - - Person update date. # noqa: E501 - - :return: The updated_at of this SearchPerson. # noqa: E501 - :rtype: str - """ - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Sets the updated_at of this SearchPerson. - - Person update date. # noqa: E501 - - :param updated_at: The updated_at of this SearchPerson. # noqa: E501 - :type updated_at: str - """ - - self._updated_at = updated_at - - @property - def detection(self): - """Gets the detection of this SearchPerson. # noqa: E501 - - - :return: The detection of this SearchPerson. # noqa: E501 - :rtype: SearchDetection - """ - return self._detection - - @detection.setter - def detection(self, detection): - """Sets the detection of this SearchPerson. - - - :param detection: The detection of this SearchPerson. # noqa: E501 - :type detection: SearchDetection - """ - - self._detection = detection - - @property - def images(self): - """Gets the images of this SearchPerson. # noqa: E501 - - Array of Person images. # noqa: E501 - - :return: The images of this SearchPerson. # noqa: E501 - :rtype: [RecognizeImage] - """ - return self._images - - @images.setter - def images(self, images): - """Sets the images of this SearchPerson. - - Array of Person images. # noqa: E501 - - :param images: The images of this SearchPerson. # noqa: E501 - :type images: [RecognizeImage] - """ - - self._images = images - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchPerson): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchPerson): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_person_all_of.py b/regula/facesdk/webclient/gen/model/search_person_all_of.py deleted file mode 100644 index c1673af..0000000 --- a/regula/facesdk/webclient/gen/model/search_person_all_of.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchPersonAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'detection': 'SearchDetection', - 'images': '[RecognizeImage]', - } - - attribute_map = { - 'detection': 'detection', - 'images': 'images', - } - - def __init__(self, detection=None, images=None, local_vars_configuration=None): # noqa: E501 - """SearchPersonAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._detection = None - self._images = None - self.discriminator = None - - if detection is not None: - self.detection = detection - if images is not None: - self.images = images - - @property - def detection(self): - """Gets the detection of this SearchPersonAllOf. # noqa: E501 - - - :return: The detection of this SearchPersonAllOf. # noqa: E501 - :rtype: SearchDetection - """ - return self._detection - - @detection.setter - def detection(self, detection): - """Sets the detection of this SearchPersonAllOf. - - - :param detection: The detection of this SearchPersonAllOf. # noqa: E501 - :type detection: SearchDetection - """ - - self._detection = detection - - @property - def images(self): - """Gets the images of this SearchPersonAllOf. # noqa: E501 - - Array of Person images. # noqa: E501 - - :return: The images of this SearchPersonAllOf. # noqa: E501 - :rtype: [RecognizeImage] - """ - return self._images - - @images.setter - def images(self, images): - """Sets the images of this SearchPersonAllOf. - - Array of Person images. # noqa: E501 - - :param images: The images of this SearchPersonAllOf. # noqa: E501 - :type images: [RecognizeImage] - """ - - self._images = images - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchPersonAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchPersonAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_request.py b/regula/facesdk/webclient/gen/model/search_request.py deleted file mode 100644 index 765042f..0000000 --- a/regula/facesdk/webclient/gen/model/search_request.py +++ /dev/null @@ -1,394 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'create_person': 'SearchParametersCreatePerson', - 'group_ids': '[str]', - 'filter': 'FilterSearchRequest', - 'tag': 'str', - 'image': 'AddImageToPersonRequestImage', - 'output_image_params': 'OutputImageParams', - 'detect_all': 'bool', - 'threshold': 'float', - 'limit': 'int', - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'create_person': 'createPerson', - 'group_ids': 'groupIds', - 'filter': 'filter', - 'tag': 'tag', - 'image': 'image', - 'output_image_params': 'outputImageParams', - 'detect_all': 'detectAll', - 'threshold': 'threshold', - 'limit': 'limit', - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, create_person=None, group_ids=None, filter=None, tag=None, image=None, output_image_params=None, detect_all=False, threshold=None, limit=None, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """SearchRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._create_person = None - self._group_ids = None - self._filter = None - self._tag = None - self._image = None - self._output_image_params = None - self._detect_all = None - self._threshold = None - self._limit = None - self._tenant = None - self._env = None - self.discriminator = None - - if create_person is not None: - self.create_person = create_person - if group_ids is not None: - self.group_ids = group_ids - if filter is not None: - self.filter = filter - if tag is not None: - self.tag = tag - if image is not None: - self.image = image - if output_image_params is not None: - self.output_image_params = output_image_params - if detect_all is not None: - self.detect_all = detect_all - if threshold is not None: - self.threshold = threshold - if limit is not None: - self.limit = limit - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def create_person(self): - """Gets the create_person of this SearchRequest. # noqa: E501 - - - :return: The create_person of this SearchRequest. # noqa: E501 - :rtype: SearchParametersCreatePerson - """ - return self._create_person - - @create_person.setter - def create_person(self, create_person): - """Sets the create_person of this SearchRequest. - - - :param create_person: The create_person of this SearchRequest. # noqa: E501 - :type create_person: SearchParametersCreatePerson - """ - - self._create_person = create_person - - @property - def group_ids(self): - """Gets the group_ids of this SearchRequest. # noqa: E501 - - IDs of the groups in which the search is performed. # noqa: E501 - - :return: The group_ids of this SearchRequest. # noqa: E501 - :rtype: [str] - """ - return self._group_ids - - @group_ids.setter - def group_ids(self, group_ids): - """Sets the group_ids of this SearchRequest. - - IDs of the groups in which the search is performed. # noqa: E501 - - :param group_ids: The group_ids of this SearchRequest. # noqa: E501 - :type group_ids: [str] - """ - - self._group_ids = group_ids - - @property - def filter(self): - """Gets the filter of this SearchRequest. # noqa: E501 - - - :return: The filter of this SearchRequest. # noqa: E501 - :rtype: FilterSearchRequest - """ - return self._filter - - @filter.setter - def filter(self, filter): - """Sets the filter of this SearchRequest. - - - :param filter: The filter of this SearchRequest. # noqa: E501 - :type filter: FilterSearchRequest - """ - - self._filter = filter - - @property - def tag(self): - """Gets the tag of this SearchRequest. # noqa: E501 - - Session identificator, should be unique for each session. # noqa: E501 - - :return: The tag of this SearchRequest. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this SearchRequest. - - Session identificator, should be unique for each session. # noqa: E501 - - :param tag: The tag of this SearchRequest. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def image(self): - """Gets the image of this SearchRequest. # noqa: E501 - - - :return: The image of this SearchRequest. # noqa: E501 - :rtype: AddImageToPersonRequestImage - """ - return self._image - - @image.setter - def image(self, image): - """Sets the image of this SearchRequest. - - - :param image: The image of this SearchRequest. # noqa: E501 - :type image: AddImageToPersonRequestImage - """ - - self._image = image - - @property - def output_image_params(self): - """Gets the output_image_params of this SearchRequest. # noqa: E501 - - - :return: The output_image_params of this SearchRequest. # noqa: E501 - :rtype: OutputImageParams - """ - return self._output_image_params - - @output_image_params.setter - def output_image_params(self, output_image_params): - """Sets the output_image_params of this SearchRequest. - - - :param output_image_params: The output_image_params of this SearchRequest. # noqa: E501 - :type output_image_params: OutputImageParams - """ - - self._output_image_params = output_image_params - - @property - def detect_all(self): - """Gets the detect_all of this SearchRequest. # noqa: E501 - - Whether to detect all faces in the image. If set to `false`, only the most central face is detected. # noqa: E501 - - :return: The detect_all of this SearchRequest. # noqa: E501 - :rtype: bool - """ - return self._detect_all - - @detect_all.setter - def detect_all(self, detect_all): - """Sets the detect_all of this SearchRequest. - - Whether to detect all faces in the image. If set to `false`, only the most central face is detected. # noqa: E501 - - :param detect_all: The detect_all of this SearchRequest. # noqa: E501 - :type detect_all: bool - """ - - self._detect_all = detect_all - - @property - def threshold(self): - """Gets the threshold of this SearchRequest. # noqa: E501 - - The similarity threshold. # noqa: E501 - - :return: The threshold of this SearchRequest. # noqa: E501 - :rtype: float - """ - return self._threshold - - @threshold.setter - def threshold(self, threshold): - """Sets the threshold of this SearchRequest. - - The similarity threshold. # noqa: E501 - - :param threshold: The threshold of this SearchRequest. # noqa: E501 - :type threshold: float - """ - - self._threshold = threshold - - @property - def limit(self): - """Gets the limit of this SearchRequest. # noqa: E501 - - The maximum number of results to be returned. # noqa: E501 - - :return: The limit of this SearchRequest. # noqa: E501 - :rtype: int - """ - return self._limit - - @limit.setter - def limit(self, limit): - """Sets the limit of this SearchRequest. - - The maximum number of results to be returned. # noqa: E501 - - :param limit: The limit of this SearchRequest. # noqa: E501 - :type limit: int - """ - - self._limit = limit - - @property - def tenant(self): - """Gets the tenant of this SearchRequest. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this SearchRequest. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this SearchRequest. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this SearchRequest. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this SearchRequest. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this SearchRequest. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this SearchRequest. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this SearchRequest. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_request_all_of.py b/regula/facesdk/webclient/gen/model/search_request_all_of.py deleted file mode 100644 index d5a3da1..0000000 --- a/regula/facesdk/webclient/gen/model/search_request_all_of.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchRequestAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'tenant': 'str', - 'env': 'str', - } - - attribute_map = { - 'tenant': 'tenant', - 'env': 'env', - } - - def __init__(self, tenant=None, env=None, local_vars_configuration=None): # noqa: E501 - """SearchRequestAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._tenant = None - self._env = None - self.discriminator = None - - if tenant is not None: - self.tenant = tenant - if env is not None: - self.env = env - - @property - def tenant(self): - """Gets the tenant of this SearchRequestAllOf. # noqa: E501 - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :return: The tenant of this SearchRequestAllOf. # noqa: E501 - :rtype: str - """ - return self._tenant - - @tenant.setter - def tenant(self, tenant): - """Sets the tenant of this SearchRequestAllOf. - - A label used to group transactions by customers, applications, or other criteria. # noqa: E501 - - :param tenant: The tenant of this SearchRequestAllOf. # noqa: E501 - :type tenant: str - """ - - self._tenant = tenant - - @property - def env(self): - """Gets the env of this SearchRequestAllOf. # noqa: E501 - - A label used to differentiate transactions by development stages. # noqa: E501 - - :return: The env of this SearchRequestAllOf. # noqa: E501 - :rtype: str - """ - return self._env - - @env.setter - def env(self, env): - """Sets the env of this SearchRequestAllOf. - - A label used to differentiate transactions by development stages. # noqa: E501 - - :param env: The env of this SearchRequestAllOf. # noqa: E501 - :type env: str - """ - - self._env = env - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchRequestAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchRequestAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_result.py b/regula/facesdk/webclient/gen/model/search_result.py deleted file mode 100644 index 9f14716..0000000 --- a/regula/facesdk/webclient/gen/model/search_result.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchResult(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'persons': '[SearchPerson]', - } - - attribute_map = { - 'code': 'code', - 'persons': 'persons', - } - - def __init__(self, code=None, persons=None, local_vars_configuration=None): # noqa: E501 - """SearchResult - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._persons = None - self.discriminator = None - - if code is not None: - self.code = code - if persons is not None: - self.persons = persons - - @property - def code(self): - """Gets the code of this SearchResult. # noqa: E501 - - Result code. It is returned only with response 200. # noqa: E501 - - :return: The code of this SearchResult. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this SearchResult. - - Result code. It is returned only with response 200. # noqa: E501 - - :param code: The code of this SearchResult. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def persons(self): - """Gets the persons of this SearchResult. # noqa: E501 - - Array of Person images. It is returned only with response 200. # noqa: E501 - - :return: The persons of this SearchResult. # noqa: E501 - :rtype: [SearchPerson] - """ - return self._persons - - @persons.setter - def persons(self, persons): - """Sets the persons of this SearchResult. - - Array of Person images. It is returned only with response 200. # noqa: E501 - - :param persons: The persons of this SearchResult. # noqa: E501 - :type persons: [SearchPerson] - """ - - self._persons = persons - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchResult): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchResult): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/search_result_all_of.py b/regula/facesdk/webclient/gen/model/search_result_all_of.py deleted file mode 100644 index bb6f172..0000000 --- a/regula/facesdk/webclient/gen/model/search_result_all_of.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - Regula FaceSDK Web API # noqa: E501 - - The version of the OpenAPI document: 3.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class SearchResultAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - } - - attribute_map = { - 'code': 'code', - } - - def __init__(self, code=None, local_vars_configuration=None): # noqa: E501 - """SearchResultAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self.discriminator = None - - if code is not None: - self.code = code - - @property - def code(self): - """Gets the code of this SearchResultAllOf. # noqa: E501 - - The search result code. # noqa: E501 - - :return: The code of this SearchResultAllOf. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this SearchResultAllOf. - - The search result code. # noqa: E501 - - :param code: The code of this SearchResultAllOf. # noqa: E501 - :type code: int - """ - - self._code = code - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchResultAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SearchResultAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/transaction_config.py b/regula/facesdk/webclient/gen/model/transaction_config.py deleted file mode 100644 index 348af29..0000000 --- a/regula/facesdk/webclient/gen/model/transaction_config.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - Regula FaceSDK Web API - - Regula FaceSDK Web API # Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 4.1.3 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class TransactionConfig(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - } - - attribute_map = { - } - - def __init__(self, local_vars_configuration=None): # noqa: E501 - """TransactionConfig - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TransactionConfig): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, TransactionConfig): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/transaction_info.py b/regula/facesdk/webclient/gen/model/transaction_info.py deleted file mode 100644 index e972bb0..0000000 --- a/regula/facesdk/webclient/gen/model/transaction_info.py +++ /dev/null @@ -1,344 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class TransactionInfo(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'code': 'int', - 'status': 'int', - 'tag': 'str', - 'transaction_id': 'str', - 'video': 'str', - 'age': '[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]', - 'portrait': 'str', - 'metadata': '{str: (bool, date, datetime, dict, float, int, list, str, none_type)}', - 'type': 'LivenessType', - } - - attribute_map = { - 'code': 'code', - 'status': 'status', - 'tag': 'tag', - 'transaction_id': 'transactionId', - 'video': 'video', - 'age': 'age', - 'portrait': 'portrait', - 'metadata': 'metadata', - 'type': 'type', - } - - def __init__(self, code=None, status=None, tag=None, transaction_id=None, video=None, age=None, portrait=None, metadata=None, type=None, local_vars_configuration=None): # noqa: E501 - """TransactionInfo - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._code = None - self._status = None - self._tag = None - self._transaction_id = None - self._video = None - self._age = None - self._portrait = None - self._metadata = None - self._type = None - self.discriminator = None - - if code is not None: - self.code = code - if status is not None: - self.status = status - if tag is not None: - self.tag = tag - if transaction_id is not None: - self.transaction_id = transaction_id - if video is not None: - self.video = video - if age is not None: - self.age = age - if portrait is not None: - self.portrait = portrait - if metadata is not None: - self.metadata = metadata - if type is not None: - self.type = type - - @property - def code(self): - """Gets the code of this TransactionInfo. # noqa: E501 - - Result code, see the [FaceSDKResultCode enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-sdk-result-code/). # noqa: E501 - - :return: The code of this TransactionInfo. # noqa: E501 - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this TransactionInfo. - - Result code, see the [FaceSDKResultCode enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-sdk-result-code/). # noqa: E501 - - :param code: The code of this TransactionInfo. # noqa: E501 - :type code: int - """ - - self._code = code - - @property - def status(self): - """Gets the status of this TransactionInfo. # noqa: E501 - - Whether the liveness detection is confirmed `0` or not `1`. # noqa: E501 - - :return: The status of this TransactionInfo. # noqa: E501 - :rtype: int - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this TransactionInfo. - - Whether the liveness detection is confirmed `0` or not `1`. # noqa: E501 - - :param status: The status of this TransactionInfo. # noqa: E501 - :type status: int - """ - - self._status = status - - @property - def tag(self): - """Gets the tag of this TransactionInfo. # noqa: E501 - - Session identificator, should be unique for each session. # noqa: E501 - - :return: The tag of this TransactionInfo. # noqa: E501 - :rtype: str - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this TransactionInfo. - - Session identificator, should be unique for each session. # noqa: E501 - - :param tag: The tag of this TransactionInfo. # noqa: E501 - :type tag: str - """ - - self._tag = tag - - @property - def transaction_id(self): - """Gets the transaction_id of this TransactionInfo. # noqa: E501 - - Transaction ID, there can be several transactions within one session. # noqa: E501 - - :return: The transaction_id of this TransactionInfo. # noqa: E501 - :rtype: str - """ - return self._transaction_id - - @transaction_id.setter - def transaction_id(self, transaction_id): - """Sets the transaction_id of this TransactionInfo. - - Transaction ID, there can be several transactions within one session. # noqa: E501 - - :param transaction_id: The transaction_id of this TransactionInfo. # noqa: E501 - :type transaction_id: str - """ - - self._transaction_id = transaction_id - - @property - def video(self): - """Gets the video of this TransactionInfo. # noqa: E501 - - Link to the session video, depends on the selected storage type. [Learn more](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/storage/) # noqa: E501 - - :return: The video of this TransactionInfo. # noqa: E501 - :rtype: str - """ - return self._video - - @video.setter - def video(self, video): - """Sets the video of this TransactionInfo. - - Link to the session video, depends on the selected storage type. [Learn more](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/storage/) # noqa: E501 - - :param video: The video of this TransactionInfo. # noqa: E501 - :type video: str - """ - - self._video = video - - @property - def age(self): - """Gets the age of this TransactionInfo. # noqa: E501 - - Approximate age with an accuracy of +/-3 years. # noqa: E501 - - :return: The age of this TransactionInfo. # noqa: E501 - :rtype: [{str: (bool, date, datetime, dict, float, int, list, str, none_type)}] - """ - return self._age - - @age.setter - def age(self, age): - """Sets the age of this TransactionInfo. - - Approximate age with an accuracy of +/-3 years. # noqa: E501 - - :param age: The age of this TransactionInfo. # noqa: E501 - :type age: [{str: (bool, date, datetime, dict, float, int, list, str, none_type)}] - """ - - self._age = age - - @property - def portrait(self): - """Gets the portrait of this TransactionInfo. # noqa: E501 - - Link to the portrait, depends on the selected storage type. [Learn more](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/storage/) # noqa: E501 - - :return: The portrait of this TransactionInfo. # noqa: E501 - :rtype: str - """ - return self._portrait - - @portrait.setter - def portrait(self, portrait): - """Sets the portrait of this TransactionInfo. - - Link to the portrait, depends on the selected storage type. [Learn more](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/storage/) # noqa: E501 - - :param portrait: The portrait of this TransactionInfo. # noqa: E501 - :type portrait: str - """ - - self._portrait = portrait - - @property - def metadata(self): - """Gets the metadata of this TransactionInfo. # noqa: E501 - - A free-form object containing person's extended attributes. # noqa: E501 - - :return: The metadata of this TransactionInfo. # noqa: E501 - :rtype: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this TransactionInfo. - - A free-form object containing person's extended attributes. # noqa: E501 - - :param metadata: The metadata of this TransactionInfo. # noqa: E501 - :type metadata: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - self._metadata = metadata - - @property - def type(self): - """Gets the type of this TransactionInfo. # noqa: E501 - - - :return: The type of this TransactionInfo. # noqa: E501 - :rtype: LivenessType - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this TransactionInfo. - - - :param type: The type of this TransactionInfo. # noqa: E501 - :type type: LivenessType - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TransactionInfo): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, TransactionInfo): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model/update_group.py b/regula/facesdk/webclient/gen/model/update_group.py deleted file mode 100644 index 45d4ae3..0000000 --- a/regula/facesdk/webclient/gen/model/update_group.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from regula.facesdk.webclient.gen.configuration import Configuration - - -class UpdateGroup(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'add_items': '[str]', - 'remove_items': '[str]', - } - - attribute_map = { - 'add_items': 'addItems', - 'remove_items': 'removeItems', - } - - def __init__(self, add_items=None, remove_items=None, local_vars_configuration=None): # noqa: E501 - """UpdateGroup - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._add_items = None - self._remove_items = None - self.discriminator = None - - if add_items is not None: - self.add_items = add_items - if remove_items is not None: - self.remove_items = remove_items - - @property - def add_items(self): - """Gets the add_items of this UpdateGroup. # noqa: E501 - - Add items. # noqa: E501 - - :return: The add_items of this UpdateGroup. # noqa: E501 - :rtype: [str] - """ - return self._add_items - - @add_items.setter - def add_items(self, add_items): - """Sets the add_items of this UpdateGroup. - - Add items. # noqa: E501 - - :param add_items: The add_items of this UpdateGroup. # noqa: E501 - :type add_items: [str] - """ - - self._add_items = add_items - - @property - def remove_items(self): - """Gets the remove_items of this UpdateGroup. # noqa: E501 - - Remove items. # noqa: E501 - - :return: The remove_items of this UpdateGroup. # noqa: E501 - :rtype: [str] - """ - return self._remove_items - - @remove_items.setter - def remove_items(self, remove_items): - """Sets the remove_items of this UpdateGroup. - - Remove items. # noqa: E501 - - :param remove_items: The remove_items of this UpdateGroup. # noqa: E501 - :type remove_items: [str] - """ - - self._remove_items = remove_items - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UpdateGroup): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, UpdateGroup): - return True - - return self.to_dict() != other.to_dict() diff --git a/regula/facesdk/webclient/gen/model_utils.py b/regula/facesdk/webclient/gen/model_utils.py deleted file mode 100644 index 4ca56f8..0000000 --- a/regula/facesdk/webclient/gen/model_utils.py +++ /dev/null @@ -1,2037 +0,0 @@ -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 - - The version of the OpenAPI document: 7.2.0 - Generated by: https://openapi-generator.tech -""" - - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile - -from dateutil.parser import parse - -from regula.facesdk.webclient.gen.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return new_cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if configuration: - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - res.append(v) - elif isinstance(v, ModelSimple): - res.append(v.value) - elif isinstance(v, dict): - res.append(dict(map( - extract_item, - v.items() - ))) - else: - res.append(model_to_dict(v, serialize=serialize)) - result[attr] = res - elif isinstance(value, dict): - result[attr] = dict(map( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(**model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + composed_instances - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] diff --git a/regula/facesdk/webclient/gen/models/__init__.py b/regula/facesdk/webclient/gen/models/__init__.py index 194e2f5..f1c1c25 100644 --- a/regula/facesdk/webclient/gen/models/__init__.py +++ b/regula/facesdk/webclient/gen/models/__init__.py @@ -1,98 +1,205 @@ +# coding: utf-8 + # flake8: noqa +""" + Generated by: https://openapi-generator.tech +""" + +if __import__("typing").TYPE_CHECKING: + # import models into model package + from regula.facesdk.webclient.gen.models.add_image_to_person_request import AddImageToPersonRequest + from regula.facesdk.webclient.gen.models.add_image_to_person_request_data import AddImageToPersonRequestData + from regula.facesdk.webclient.gen.models.add_image_to_person_request_image import AddImageToPersonRequestImage + from regula.facesdk.webclient.gen.models.add_image_to_person_response import AddImageToPersonResponse + from regula.facesdk.webclient.gen.models.attribute_config import AttributeConfig + from regula.facesdk.webclient.gen.models.attributes_data import AttributesData + from regula.facesdk.webclient.gen.models.crop import Crop + from regula.facesdk.webclient.gen.models.detail_item import DetailItem + from regula.facesdk.webclient.gen.models.detect_attributes_details import DetectAttributesDetails + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_meta_data import DetectMetaData + from regula.facesdk.webclient.gen.models.detect_request import DetectRequest + from regula.facesdk.webclient.gen.models.detect_request_data import DetectRequestData + from regula.facesdk.webclient.gen.models.detect_response import DetectResponse + from regula.facesdk.webclient.gen.models.detect_response_results import DetectResponseResults + from regula.facesdk.webclient.gen.models.detect_result import DetectResult + from regula.facesdk.webclient.gen.models.detection import Detection + from regula.facesdk.webclient.gen.models.detection_attributes import DetectionAttributes + from regula.facesdk.webclient.gen.models.detection_attributes_details_inner import DetectionAttributesDetailsInner + from regula.facesdk.webclient.gen.models.detection_face import DetectionFace + from regula.facesdk.webclient.gen.models.detection_quality import DetectionQuality + from regula.facesdk.webclient.gen.models.device_info import DeviceInfo + from regula.facesdk.webclient.gen.models.face_attribute import FaceAttribute + from regula.facesdk.webclient.gen.models.face_image_quality_align_type import FaceImageQualityAlignType + from regula.facesdk.webclient.gen.models.face_image_quality_groups import FaceImageQualityGroups + from regula.facesdk.webclient.gen.models.face_image_quality_groups_strings import FaceImageQualityGroupsStrings + from regula.facesdk.webclient.gen.models.face_image_quality_status import FaceImageQualityStatus + from regula.facesdk.webclient.gen.models.face_quality_config_name import FaceQualityConfigName + from regula.facesdk.webclient.gen.models.face_quality_scenarios import FaceQualityScenarios + from regula.facesdk.webclient.gen.models.face_sdk_result import FaceSDKResult + from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode + from regula.facesdk.webclient.gen.models.faces_response import FacesResponse + from regula.facesdk.webclient.gen.models.faces_response_data import FacesResponseData + from regula.facesdk.webclient.gen.models.filter_op import FilterOp + from regula.facesdk.webclient.gen.models.filter_search_request import FilterSearchRequest + from regula.facesdk.webclient.gen.models.group import Group + from regula.facesdk.webclient.gen.models.group_data import GroupData + from regula.facesdk.webclient.gen.models.group_page import GroupPage + from regula.facesdk.webclient.gen.models.group_page_items import GroupPageItems + from regula.facesdk.webclient.gen.models.group_response import GroupResponse + from regula.facesdk.webclient.gen.models.group_to_create import GroupToCreate + from regula.facesdk.webclient.gen.models.image import Image + from regula.facesdk.webclient.gen.models.image_fields import ImageFields + from regula.facesdk.webclient.gen.models.image_fields_image import ImageFieldsImage + from regula.facesdk.webclient.gen.models.image_page import ImagePage + from regula.facesdk.webclient.gen.models.image_page_items import ImagePageItems + from regula.facesdk.webclient.gen.models.image_source import ImageSource + from regula.facesdk.webclient.gen.models.liveness_type import LivenessType + from regula.facesdk.webclient.gen.models.match_and_search_request import MatchAndSearchRequest + from regula.facesdk.webclient.gen.models.match_and_search_request_images_item import MatchAndSearchRequestImagesItem + from regula.facesdk.webclient.gen.models.match_and_search_response import MatchAndSearchResponse + from regula.facesdk.webclient.gen.models.match_and_search_response_data import MatchAndSearchResponseData + from regula.facesdk.webclient.gen.models.match_and_search_response_data_detections_item import MatchAndSearchResponseDataDetectionsItem + from regula.facesdk.webclient.gen.models.match_image import MatchImage + from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection + from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult + from regula.facesdk.webclient.gen.models.match_request import MatchRequest + from regula.facesdk.webclient.gen.models.match_request_data import MatchRequestData + from regula.facesdk.webclient.gen.models.match_response import MatchResponse + from regula.facesdk.webclient.gen.models.match_response_data import MatchResponseData + from regula.facesdk.webclient.gen.models.operation_log import OperationLog + from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams + from regula.facesdk.webclient.gen.models.page import Page + from regula.facesdk.webclient.gen.models.person import Person + from regula.facesdk.webclient.gen.models.person_data import PersonData + from regula.facesdk.webclient.gen.models.person_fields import PersonFields + from regula.facesdk.webclient.gen.models.person_items import PersonItems + from regula.facesdk.webclient.gen.models.person_to_update_fields import PersonToUpdateFields + from regula.facesdk.webclient.gen.models.person_with_images import PersonWithImages + from regula.facesdk.webclient.gen.models.person_with_images_data import PersonWithImagesData + from regula.facesdk.webclient.gen.models.persons_page import PersonsPage + from regula.facesdk.webclient.gen.models.process_param import ProcessParam + from regula.facesdk.webclient.gen.models.process_param_attributes import ProcessParamAttributes + from regula.facesdk.webclient.gen.models.quality_config import QualityConfig + from regula.facesdk.webclient.gen.models.quality_detail import QualityDetail + from regula.facesdk.webclient.gen.models.quality_details_groups import QualityDetailsGroups + from regula.facesdk.webclient.gen.models.quality_request import QualityRequest + from regula.facesdk.webclient.gen.models.recognize_image import RecognizeImage + from regula.facesdk.webclient.gen.models.recognize_image_data import RecognizeImageData + from regula.facesdk.webclient.gen.models.resize_options import ResizeOptions + from regula.facesdk.webclient.gen.models.search_bad_params import SearchBadParams + from regula.facesdk.webclient.gen.models.search_detection import SearchDetection + from regula.facesdk.webclient.gen.models.search_parameters import SearchParameters + from regula.facesdk.webclient.gen.models.search_parameters_create_person import SearchParametersCreatePerson + from regula.facesdk.webclient.gen.models.search_person import SearchPerson + from regula.facesdk.webclient.gen.models.search_person_data import SearchPersonData + from regula.facesdk.webclient.gen.models.search_request import SearchRequest + from regula.facesdk.webclient.gen.models.search_result import SearchResult + from regula.facesdk.webclient.gen.models.transaction_info import TransactionInfo + from regula.facesdk.webclient.gen.models.transaction_labels import TransactionLabels + from regula.facesdk.webclient.gen.models.update_group import UpdateGroup + +else: + from lazy_imports import LazyModule, as_package, load -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from regula.facesdk.webclient.gen.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) + load( + LazyModule( + *as_package(__file__), + """# import models into model package +from regula.facesdk.webclient.gen.models.add_image_to_person_request import AddImageToPersonRequest +from regula.facesdk.webclient.gen.models.add_image_to_person_request_data import AddImageToPersonRequestData +from regula.facesdk.webclient.gen.models.add_image_to_person_request_image import AddImageToPersonRequestImage +from regula.facesdk.webclient.gen.models.add_image_to_person_response import AddImageToPersonResponse +from regula.facesdk.webclient.gen.models.attribute_config import AttributeConfig +from regula.facesdk.webclient.gen.models.attributes_data import AttributesData +from regula.facesdk.webclient.gen.models.crop import Crop +from regula.facesdk.webclient.gen.models.detail_item import DetailItem +from regula.facesdk.webclient.gen.models.detect_attributes_details import DetectAttributesDetails +from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta +from regula.facesdk.webclient.gen.models.detect_meta_data import DetectMetaData +from regula.facesdk.webclient.gen.models.detect_request import DetectRequest +from regula.facesdk.webclient.gen.models.detect_request_data import DetectRequestData +from regula.facesdk.webclient.gen.models.detect_response import DetectResponse +from regula.facesdk.webclient.gen.models.detect_response_results import DetectResponseResults +from regula.facesdk.webclient.gen.models.detect_result import DetectResult +from regula.facesdk.webclient.gen.models.detection import Detection +from regula.facesdk.webclient.gen.models.detection_attributes import DetectionAttributes +from regula.facesdk.webclient.gen.models.detection_attributes_details_inner import DetectionAttributesDetailsInner +from regula.facesdk.webclient.gen.models.detection_face import DetectionFace +from regula.facesdk.webclient.gen.models.detection_quality import DetectionQuality +from regula.facesdk.webclient.gen.models.device_info import DeviceInfo +from regula.facesdk.webclient.gen.models.face_attribute import FaceAttribute +from regula.facesdk.webclient.gen.models.face_image_quality_align_type import FaceImageQualityAlignType +from regula.facesdk.webclient.gen.models.face_image_quality_groups import FaceImageQualityGroups +from regula.facesdk.webclient.gen.models.face_image_quality_groups_strings import FaceImageQualityGroupsStrings +from regula.facesdk.webclient.gen.models.face_image_quality_status import FaceImageQualityStatus +from regula.facesdk.webclient.gen.models.face_quality_config_name import FaceQualityConfigName +from regula.facesdk.webclient.gen.models.face_quality_scenarios import FaceQualityScenarios +from regula.facesdk.webclient.gen.models.face_sdk_result import FaceSDKResult +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode +from regula.facesdk.webclient.gen.models.faces_response import FacesResponse +from regula.facesdk.webclient.gen.models.faces_response_data import FacesResponseData +from regula.facesdk.webclient.gen.models.filter_op import FilterOp +from regula.facesdk.webclient.gen.models.filter_search_request import FilterSearchRequest +from regula.facesdk.webclient.gen.models.group import Group +from regula.facesdk.webclient.gen.models.group_data import GroupData +from regula.facesdk.webclient.gen.models.group_page import GroupPage +from regula.facesdk.webclient.gen.models.group_page_items import GroupPageItems +from regula.facesdk.webclient.gen.models.group_response import GroupResponse +from regula.facesdk.webclient.gen.models.group_to_create import GroupToCreate +from regula.facesdk.webclient.gen.models.image import Image +from regula.facesdk.webclient.gen.models.image_fields import ImageFields +from regula.facesdk.webclient.gen.models.image_fields_image import ImageFieldsImage +from regula.facesdk.webclient.gen.models.image_page import ImagePage +from regula.facesdk.webclient.gen.models.image_page_items import ImagePageItems +from regula.facesdk.webclient.gen.models.image_source import ImageSource +from regula.facesdk.webclient.gen.models.liveness_type import LivenessType +from regula.facesdk.webclient.gen.models.match_and_search_request import MatchAndSearchRequest +from regula.facesdk.webclient.gen.models.match_and_search_request_images_item import MatchAndSearchRequestImagesItem +from regula.facesdk.webclient.gen.models.match_and_search_response import MatchAndSearchResponse +from regula.facesdk.webclient.gen.models.match_and_search_response_data import MatchAndSearchResponseData +from regula.facesdk.webclient.gen.models.match_and_search_response_data_detections_item import MatchAndSearchResponseDataDetectionsItem +from regula.facesdk.webclient.gen.models.match_image import MatchImage +from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection +from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult +from regula.facesdk.webclient.gen.models.match_request import MatchRequest +from regula.facesdk.webclient.gen.models.match_request_data import MatchRequestData +from regula.facesdk.webclient.gen.models.match_response import MatchResponse +from regula.facesdk.webclient.gen.models.match_response_data import MatchResponseData +from regula.facesdk.webclient.gen.models.operation_log import OperationLog +from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams +from regula.facesdk.webclient.gen.models.page import Page +from regula.facesdk.webclient.gen.models.person import Person +from regula.facesdk.webclient.gen.models.person_data import PersonData +from regula.facesdk.webclient.gen.models.person_fields import PersonFields +from regula.facesdk.webclient.gen.models.person_items import PersonItems +from regula.facesdk.webclient.gen.models.person_to_update_fields import PersonToUpdateFields +from regula.facesdk.webclient.gen.models.person_with_images import PersonWithImages +from regula.facesdk.webclient.gen.models.person_with_images_data import PersonWithImagesData +from regula.facesdk.webclient.gen.models.persons_page import PersonsPage +from regula.facesdk.webclient.gen.models.process_param import ProcessParam +from regula.facesdk.webclient.gen.models.process_param_attributes import ProcessParamAttributes +from regula.facesdk.webclient.gen.models.quality_config import QualityConfig +from regula.facesdk.webclient.gen.models.quality_detail import QualityDetail +from regula.facesdk.webclient.gen.models.quality_details_groups import QualityDetailsGroups +from regula.facesdk.webclient.gen.models.quality_request import QualityRequest +from regula.facesdk.webclient.gen.models.recognize_image import RecognizeImage +from regula.facesdk.webclient.gen.models.recognize_image_data import RecognizeImageData +from regula.facesdk.webclient.gen.models.resize_options import ResizeOptions +from regula.facesdk.webclient.gen.models.search_bad_params import SearchBadParams +from regula.facesdk.webclient.gen.models.search_detection import SearchDetection +from regula.facesdk.webclient.gen.models.search_parameters import SearchParameters +from regula.facesdk.webclient.gen.models.search_parameters_create_person import SearchParametersCreatePerson +from regula.facesdk.webclient.gen.models.search_person import SearchPerson +from regula.facesdk.webclient.gen.models.search_person_data import SearchPersonData +from regula.facesdk.webclient.gen.models.search_request import SearchRequest +from regula.facesdk.webclient.gen.models.search_result import SearchResult +from regula.facesdk.webclient.gen.models.transaction_info import TransactionInfo +from regula.facesdk.webclient.gen.models.transaction_labels import TransactionLabels +from regula.facesdk.webclient.gen.models.update_group import UpdateGroup -from regula.facesdk.webclient.gen.model.add_image_to_person_request import AddImageToPersonRequest -from regula.facesdk.webclient.gen.model.add_image_to_person_request_image import AddImageToPersonRequestImage -from regula.facesdk.webclient.gen.model.add_image_to_person_response import AddImageToPersonResponse -from regula.facesdk.webclient.gen.model.attribute_config import AttributeConfig -from regula.facesdk.webclient.gen.model.attribute_config_list import AttributeConfigList -from regula.facesdk.webclient.gen.model.crop import Crop -from regula.facesdk.webclient.gen.model.detect_attributes_details import DetectAttributesDetails -from regula.facesdk.webclient.gen.model.detect_details_meta import DetectDetailsMeta -from regula.facesdk.webclient.gen.model.detect_request import DetectRequest -from regula.facesdk.webclient.gen.model.detect_response import DetectResponse -from regula.facesdk.webclient.gen.model.detect_response_all_of import DetectResponseAllOf -from regula.facesdk.webclient.gen.model.detect_result import DetectResult -from regula.facesdk.webclient.gen.model.detection import Detection -from regula.facesdk.webclient.gen.model.detection_attributes import DetectionAttributes -from regula.facesdk.webclient.gen.model.detection_face import DetectionFace -from regula.facesdk.webclient.gen.model.detection_quality import DetectionQuality -from regula.facesdk.webclient.gen.model.device_info import DeviceInfo -from regula.facesdk.webclient.gen.model.face_attribute import FaceAttribute -from regula.facesdk.webclient.gen.model.face_image_quality_align_type import FaceImageQualityAlignType -from regula.facesdk.webclient.gen.model.face_image_quality_groups import FaceImageQualityGroups -from regula.facesdk.webclient.gen.model.face_image_quality_groups_strings import FaceImageQualityGroupsStrings -from regula.facesdk.webclient.gen.model.face_image_quality_status import FaceImageQualityStatus -from regula.facesdk.webclient.gen.model.face_quality_config_name import FaceQualityConfigName -from regula.facesdk.webclient.gen.model.face_quality_scenarios import FaceQualityScenarios -from regula.facesdk.webclient.gen.model.face_rectangular import FaceRectangular -from regula.facesdk.webclient.gen.model.face_sdk_result import FaceSDKResult -from regula.facesdk.webclient.gen.model.face_sdk_result_code import FaceSDKResultCode -from regula.facesdk.webclient.gen.model.faces_response import FacesResponse -from regula.facesdk.webclient.gen.model.faces_response_all_of import FacesResponseAllOf -from regula.facesdk.webclient.gen.model.filter_op import FilterOp -from regula.facesdk.webclient.gen.model.filter_search_request import FilterSearchRequest -from regula.facesdk.webclient.gen.model.group import Group -from regula.facesdk.webclient.gen.model.group_all_of import GroupAllOf -from regula.facesdk.webclient.gen.model.group_page import GroupPage -from regula.facesdk.webclient.gen.model.group_page_all_of import GroupPageAllOf -from regula.facesdk.webclient.gen.model.group_response import GroupResponse -from regula.facesdk.webclient.gen.model.group_to_create import GroupToCreate -from regula.facesdk.webclient.gen.model.image import Image -from regula.facesdk.webclient.gen.model.image_fields import ImageFields -from regula.facesdk.webclient.gen.model.image_page import ImagePage -from regula.facesdk.webclient.gen.model.image_page_all_of import ImagePageAllOf -from regula.facesdk.webclient.gen.model.image_source import ImageSource -from regula.facesdk.webclient.gen.model.liveness_type import LivenessType -from regula.facesdk.webclient.gen.model.match_and_search_request import MatchAndSearchRequest -from regula.facesdk.webclient.gen.model.match_and_search_request_images import MatchAndSearchRequestImages -from regula.facesdk.webclient.gen.model.match_and_search_response import MatchAndSearchResponse -from regula.facesdk.webclient.gen.model.match_and_search_response_all_of import MatchAndSearchResponseAllOf -from regula.facesdk.webclient.gen.model.match_and_search_response_all_of_detections import MatchAndSearchResponseAllOfDetections -from regula.facesdk.webclient.gen.model.match_image import MatchImage -from regula.facesdk.webclient.gen.model.match_image_detection import MatchImageDetection -from regula.facesdk.webclient.gen.model.match_image_result import MatchImageResult -from regula.facesdk.webclient.gen.model.match_request import MatchRequest -from regula.facesdk.webclient.gen.model.match_response import MatchResponse -from regula.facesdk.webclient.gen.model.match_response_all_of import MatchResponseAllOf -from regula.facesdk.webclient.gen.model.operation_log import OperationLog -from regula.facesdk.webclient.gen.model.output_image_params import OutputImageParams -from regula.facesdk.webclient.gen.model.page import Page -from regula.facesdk.webclient.gen.model.person import Person -from regula.facesdk.webclient.gen.model.person_all_of import PersonAllOf -from regula.facesdk.webclient.gen.model.person_fields import PersonFields -from regula.facesdk.webclient.gen.model.person_to_update_fields import PersonToUpdateFields -from regula.facesdk.webclient.gen.model.person_with_images import PersonWithImages -from regula.facesdk.webclient.gen.model.person_with_images_all_of import PersonWithImagesAllOf -from regula.facesdk.webclient.gen.model.persons_page import PersonsPage -from regula.facesdk.webclient.gen.model.persons_page_all_of import PersonsPageAllOf -from regula.facesdk.webclient.gen.model.process_param import ProcessParam -from regula.facesdk.webclient.gen.model.process_param_attributes import ProcessParamAttributes -from regula.facesdk.webclient.gen.model.quality_config import QualityConfig -from regula.facesdk.webclient.gen.model.quality_config_list import QualityConfigList -from regula.facesdk.webclient.gen.model.quality_detail import QualityDetail -from regula.facesdk.webclient.gen.model.quality_details_groups import QualityDetailsGroups -from regula.facesdk.webclient.gen.model.quality_request import QualityRequest -from regula.facesdk.webclient.gen.model.rgb import RGB -from regula.facesdk.webclient.gen.model.recognize_image import RecognizeImage -from regula.facesdk.webclient.gen.model.recognize_image_all_of import RecognizeImageAllOf -from regula.facesdk.webclient.gen.model.resize_options import ResizeOptions -from regula.facesdk.webclient.gen.model.search_bad_params import SearchBadParams -from regula.facesdk.webclient.gen.model.search_detection import SearchDetection -from regula.facesdk.webclient.gen.model.search_parameters import SearchParameters -from regula.facesdk.webclient.gen.model.search_parameters_create_person import SearchParametersCreatePerson -from regula.facesdk.webclient.gen.model.search_person import SearchPerson -from regula.facesdk.webclient.gen.model.search_person_all_of import SearchPersonAllOf -from regula.facesdk.webclient.gen.model.search_request import SearchRequest -from regula.facesdk.webclient.gen.model.search_request_all_of import SearchRequestAllOf -from regula.facesdk.webclient.gen.model.search_result import SearchResult -from regula.facesdk.webclient.gen.model.transaction_info import TransactionInfo -from regula.facesdk.webclient.gen.model.update_group import UpdateGroup +""", + name=__name__, + doc=__doc__, + ) + ) diff --git a/regula/facesdk/webclient/gen/models/add_image_to_person_request.py b/regula/facesdk/webclient/gen/models/add_image_to_person_request.py new file mode 100644 index 0000000..24da472 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/add_image_to_person_request.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.add_image_to_person_request_image import AddImageToPersonRequestImage +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class AddImageToPersonRequest(BaseModel): + """ + Image in the request data, includes image and contentType. + """ # noqa: E501 + tenant: SkipValidation[Optional[str]] = Field(alias="tenant", default=None, description="A label used to group transactions by customers, applications, or other criteria.") + env: SkipValidation[Optional[str]] = Field(alias="env", default=None, description="A label used to differentiate transactions by development stages.") + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator.") + image: SkipValidation[AddImageToPersonRequestImage] = Field(alias="image") + threshold: SkipValidation[Optional[float]] = Field(alias="threshold", default=None, description="The similarity threshold.") + limit: SkipValidation[Optional[int]] = Field(alias="limit", default=None, description="The maximum number of results to be returned.") + __properties: ClassVar[List[str]] = ["tenant", "env", "tag", "image", "threshold", "limit"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddImageToPersonRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of image + if self.image: + _dict['image'] = self.image.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddImageToPersonRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenant": obj.get("tenant"), + "env": obj.get("env"), + "tag": obj.get("tag"), + "image": AddImageToPersonRequestImage.from_dict(obj["image"]) if obj.get("image") is not None else None, + "threshold": obj.get("threshold"), + "limit": obj.get("limit") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/add_image_to_person_request_data.py b/regula/facesdk/webclient/gen/models/add_image_to_person_request_data.py new file mode 100644 index 0000000..c0e3b21 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/add_image_to_person_request_data.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.add_image_to_person_request_image import AddImageToPersonRequestImage +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class AddImageToPersonRequestData(BaseModel): + """ + AddImageToPersonRequestData + """ # noqa: E501 + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator.") + image: SkipValidation[AddImageToPersonRequestImage] = Field(alias="image") + threshold: SkipValidation[Optional[float]] = Field(alias="threshold", default=None, description="The similarity threshold.") + limit: SkipValidation[Optional[int]] = Field(alias="limit", default=None, description="The maximum number of results to be returned.") + __properties: ClassVar[List[str]] = ["tag", "image", "threshold", "limit"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddImageToPersonRequestData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of image + if self.image: + _dict['image'] = self.image.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddImageToPersonRequestData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tag": obj.get("tag"), + "image": AddImageToPersonRequestImage.from_dict(obj["image"]) if obj.get("image") is not None else None, + "threshold": obj.get("threshold"), + "limit": obj.get("limit") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/add_image_to_person_request_image.py b/regula/facesdk/webclient/gen/models/add_image_to_person_request_image.py new file mode 100644 index 0000000..87c41d0 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/add_image_to_person_request_image.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.resize_options import ResizeOptions +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class AddImageToPersonRequestImage(BaseModel): + """ + Uploaded image. + """ # noqa: E501 + content_type: SkipValidation[Optional[str]] = Field(alias="contentType", default=None, description="Original media type of the uploaded image.") + content: SkipValidation[Optional[bytearray]] = Field(alias="content", default=None, description="Base64-encoded image.") + image_url: SkipValidation[Optional[str]] = Field(alias="imageUrl", default=None, description="Image URL.") + resize_options: SkipValidation[Optional[ResizeOptions]] = Field(alias="resizeOptions", default=None) + __properties: ClassVar[List[str]] = ["contentType", "content", "imageUrl", "resizeOptions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddImageToPersonRequestImage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of resize_options + if self.resize_options: + _dict['resizeOptions'] = self.resize_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddImageToPersonRequestImage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "contentType": obj.get("contentType"), + "content": obj.get("content"), + "imageUrl": obj.get("imageUrl"), + "resizeOptions": ResizeOptions.from_dict(obj["resizeOptions"]) if obj.get("resizeOptions") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/add_image_to_person_response.py b/regula/facesdk/webclient/gen/models/add_image_to_person_response.py new file mode 100644 index 0000000..1c2fbaf --- /dev/null +++ b/regula/facesdk/webclient/gen/models/add_image_to_person_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class AddImageToPersonResponse(BaseModel): + """ + Image in the response. + """ # noqa: E501 + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Response image ID. The list is sorted by decreasing ID value.") + content_type: SkipValidation[Optional[str]] = Field(alias="contentType", default=None, description="Original media type of the returned image.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Returned image creation date.") + path: SkipValidation[Optional[str]] = Field(alias="path", default=None, description="Returned image path.") + url: SkipValidation[Optional[str]] = Field(alias="url", default=None, description="Returned image URL.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + __properties: ClassVar[List[str]] = ["id", "contentType", "createdAt", "path", "url", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddImageToPersonResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddImageToPersonResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "contentType": obj.get("contentType"), + "createdAt": obj.get("createdAt"), + "path": obj.get("path"), + "url": obj.get("url"), + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/attribute_config.py b/regula/facesdk/webclient/gen/models/attribute_config.py new file mode 100644 index 0000000..ef91cc5 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/attribute_config.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.face_attribute import FaceAttribute +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class AttributeConfig(BaseModel): + """ + The configuration that defines the list of returned attribute check characteristics. + """ # noqa: E501 + name: SkipValidation[Optional[FaceAttribute]] = Field(alias="name", default=None) + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttributeConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttributeConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/attributes_data.py b/regula/facesdk/webclient/gen/models/attributes_data.py new file mode 100644 index 0000000..c6fbd5c --- /dev/null +++ b/regula/facesdk/webclient/gen/models/attributes_data.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class AttributesData(BaseModel): + """ + AttributesData + """ # noqa: E501 + value: SkipValidation[Optional[List[int]]] = Field(alias="value", default=None, description="The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/).") + __properties: ClassVar[List[str]] = ["value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttributesData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttributesData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/crop.py b/regula/facesdk/webclient/gen/models/crop.py new file mode 100644 index 0000000..d265fa9 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/crop.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from regula.facesdk.webclient.gen.models.face_image_quality_align_type import FaceImageQualityAlignType +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class Crop(BaseModel): + """ + Whether to return a Base64-encoded image of each aligned and cropped portrait in the `crop` field. Faces are aligned to a straight vertical line based on the value in the `crop.type` field, correcting any tilt present in the original image. If the image contains multiple faces, the system will detect and process each face separately, returning individual portraits. For example, if there are five people in the photo, five processed portraits will be returned. Each portrait is available for download. + """ # noqa: E501 + type: SkipValidation[Optional[FaceImageQualityAlignType]] = Field(alias="type", default=None) + pad_color: SkipValidation[Optional[List[int]]] = Field(alias="padColor", default=None, description="The RGB value of a color for filling background behind a person's silhouette and for aligning the image.") + size: SkipValidation[Optional[List[int]]] = Field(alias="size", default=None, description="The resize value in case `type` matches this value. If it doesn't, no resize is performed.") + __properties: ClassVar[List[str]] = ["type", "padColor", "size"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Crop from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Crop from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "padColor": obj.get("padColor"), + "size": obj.get("size") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detail_item.py b/regula/facesdk/webclient/gen/models/detail_item.py new file mode 100644 index 0000000..a6a9297 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detail_item.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from regula.facesdk.webclient.gen.models.detect_attributes_details import DetectAttributesDetails + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta + +class DetailItem(BaseModel): + """ + DetailItem + """ # noqa: E501 + name: SkipValidation[Optional[str]] = Field(alias="name", default=None, description="The name of the attribute.") + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'name' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'Age': 'DetectAttributesDetails','Emotion': 'DetectDetailsMeta','EyeLeft': 'DetectDetailsMeta','EyeRight': 'DetectDetailsMeta','ForeheadCovering': 'DetectDetailsMeta','Glasses': 'DetectDetailsMeta','HeadCovering': 'DetectDetailsMeta','Headphones': 'DetectDetailsMeta','MedicalMask': 'DetectDetailsMeta','Mouth': 'DetectDetailsMeta','Occlusion': 'DetectDetailsMeta','Smile': 'DetectDetailsMeta','StrongMakeup': 'DetectDetailsMeta' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[DetectAttributesDetails, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta]]: + """Create an instance of DetailItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DetectAttributesDetails, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta, DetectDetailsMeta]]: + """Create an instance of DetailItem from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'DetectAttributesDetails': + return import_module("regula.facesdk.webclient.gen.models.detect_attributes_details").DetectAttributesDetails.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + if object_type == 'DetectDetailsMeta': + return import_module("regula.facesdk.webclient.gen.models.detect_details_meta").DetectDetailsMeta.from_dict(obj) + + return None + + diff --git a/regula/facesdk/webclient/gen/models/detect_attributes_details.py b/regula/facesdk/webclient/gen/models/detect_attributes_details.py new file mode 100644 index 0000000..a6f5914 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detect_attributes_details.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.detail_item import DetailItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectAttributesDetails(DetailItem): + """ + DetectAttributesDetails + """ # noqa: E501 + value: SkipValidation[Optional[List[int]]] = Field(alias="value", default=None, description="The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/).") + __properties: ClassVar[List[str]] = ["name", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectAttributesDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectAttributesDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detect_details_meta.py b/regula/facesdk/webclient/gen/models/detect_details_meta.py new file mode 100644 index 0000000..644bf85 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detect_details_meta.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.detail_item import DetailItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectDetailsMeta(DetailItem): + """ + DetectDetailsMeta + """ # noqa: E501 + confidence: SkipValidation[Optional[float]] = Field(alias="confidence", default=None, description="The confidence in the estimated value, `1.0` is for 100% confidence.") + value: SkipValidation[Optional[str]] = Field(alias="value", default=None, description="The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/).") + __properties: ClassVar[List[str]] = ["name", "confidence", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectDetailsMeta from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectDetailsMeta from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "confidence": obj.get("confidence"), + "value": obj.get("value") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detect_meta_data.py b/regula/facesdk/webclient/gen/models/detect_meta_data.py new file mode 100644 index 0000000..157f1f6 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detect_meta_data.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectMetaData(BaseModel): + """ + DetectMetaData + """ # noqa: E501 + confidence: SkipValidation[Optional[float]] = Field(alias="confidence", default=None, description="The confidence in the estimated value, `1.0` is for 100% confidence.") + value: SkipValidation[Optional[str]] = Field(alias="value", default=None, description="The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/).") + __properties: ClassVar[List[str]] = ["confidence", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectMetaData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectMetaData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "confidence": obj.get("confidence"), + "value": obj.get("value") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detect_request.py b/regula/facesdk/webclient/gen/models/detect_request.py new file mode 100644 index 0000000..a1a9c02 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detect_request.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.process_param import ProcessParam +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectRequest(BaseModel): + """ + DetectRequest + """ # noqa: E501 + tenant: SkipValidation[Optional[str]] = Field(alias="tenant", default=None, description="A label used to group transactions by customers, applications, or other criteria.") + env: SkipValidation[Optional[str]] = Field(alias="env", default=None, description="A label used to differentiate transactions by development stages.") + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.") + process_param: SkipValidation[Optional[ProcessParam]] = Field(alias="processParam", default=None) + image: SkipValidation[Optional[bytearray]] = Field(alias="image", default=None, description="Base64-encoded image.") + __properties: ClassVar[List[str]] = ["tenant", "env", "tag", "processParam", "image"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of process_param + if self.process_param: + _dict['processParam'] = self.process_param.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenant": obj.get("tenant"), + "env": obj.get("env"), + "tag": obj.get("tag"), + "processParam": ProcessParam.from_dict(obj["processParam"]) if obj.get("processParam") is not None else None, + "image": obj.get("image") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detect_request_data.py b/regula/facesdk/webclient/gen/models/detect_request_data.py new file mode 100644 index 0000000..fdc2699 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detect_request_data.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.process_param import ProcessParam +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectRequestData(BaseModel): + """ + DetectRequestData + """ # noqa: E501 + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.") + process_param: SkipValidation[Optional[ProcessParam]] = Field(alias="processParam", default=None) + image: SkipValidation[Optional[bytearray]] = Field(alias="image", default=None, description="Base64-encoded image.") + __properties: ClassVar[List[str]] = ["tag", "processParam", "image"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectRequestData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of process_param + if self.process_param: + _dict['processParam'] = self.process_param.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectRequestData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tag": obj.get("tag"), + "processParam": ProcessParam.from_dict(obj["processParam"]) if obj.get("processParam") is not None else None, + "image": obj.get("image") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detect_response.py b/regula/facesdk/webclient/gen/models/detect_response.py new file mode 100644 index 0000000..6303a0c --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detect_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.detect_result import DetectResult +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectResponse(BaseModel): + """ + DetectResponse + """ # noqa: E501 + code: SkipValidation[FaceSDKResultCode] = Field(alias="code") + results: SkipValidation[Optional[DetectResult]] = Field(alias="results", default=None) + __properties: ClassVar[List[str]] = ["code", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of results + if self.results: + _dict['results'] = self.results.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "results": DetectResult.from_dict(obj["results"]) if obj.get("results") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detect_response_results.py b/regula/facesdk/webclient/gen/models/detect_response_results.py new file mode 100644 index 0000000..58a2300 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detect_response_results.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.detect_result import DetectResult +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectResponseResults(BaseModel): + """ + DetectResponseResults + """ # noqa: E501 + results: SkipValidation[Optional[DetectResult]] = Field(alias="results", default=None) + __properties: ClassVar[List[str]] = ["results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectResponseResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of results + if self.results: + _dict['results'] = self.results.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectResponseResults from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": DetectResult.from_dict(obj["results"]) if obj.get("results") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detect_result.py b/regula/facesdk/webclient/gen/models/detect_result.py new file mode 100644 index 0000000..c0ca440 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detect_result.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.detection import Detection +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectResult(BaseModel): + """ + The detection results. + """ # noqa: E501 + detections: SkipValidation[List[Detection]] = Field(alias="detections", description="The array of performed checks.") + detector_type: SkipValidation[Optional[int]] = Field(alias="detectorType", default=None, description="Internal.") + landmarks_type: SkipValidation[Optional[int]] = Field(alias="landmarksType", default=None, description="Internal.") + scenario: SkipValidation[Optional[str]] = Field(alias="scenario", default=None, description="The face detection scenario that was set in the `processParam.scenario` field of the request.") + elapsed_time: SkipValidation[Optional[float]] = Field(alias="elapsedTime", default=None, description="Server processing time, ms. Does not include the time taken to receive the request or deliver the response.") + __properties: ClassVar[List[str]] = ["detections", "detectorType", "landmarksType", "scenario", "elapsedTime"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in detections (list) + _items = [] + if self.detections: + for _item_detections in self.detections: + if _item_detections: + _items.append(_item_detections.to_dict()) + _dict['detections'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "detections": [Detection.from_dict(_item) for _item in obj.get("detections", []) if Detection.from_dict(_item) is not None], + "detectorType": obj.get("detectorType"), + "landmarksType": obj.get("landmarksType"), + "scenario": obj.get("scenario"), + "elapsedTime": obj.get("elapsedTime") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detection.py b/regula/facesdk/webclient/gen/models/detection.py new file mode 100644 index 0000000..d317e69 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detection.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.detection_attributes import DetectionAttributes +from regula.facesdk.webclient.gen.models.detection_quality import DetectionQuality +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class Detection(BaseModel): + """ + Detection + """ # noqa: E501 + crop: SkipValidation[Optional[bytearray]] = Field(alias="crop", default=None, description="Base64-encoded image.") + attributes: SkipValidation[Optional[DetectionAttributes]] = Field(alias="attributes", default=None) + landmarks: SkipValidation[List[List[int]]] = Field(alias="landmarks", description="Absolute coordinates (X,Y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips.") + quality: SkipValidation[Optional[DetectionQuality]] = Field(alias="quality", default=None) + roi: SkipValidation[List[float]] = Field(alias="roi", description="The rectangular area of a detected face that is represented by a set of four elements: the X and Y coordinates of the top-left point, and the width and height dimensions of the rectangle.") + __properties: ClassVar[List[str]] = ["crop", "attributes", "landmarks", "quality", "roi"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Detection from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of attributes + if self.attributes: + _dict['attributes'] = self.attributes.to_dict() + # override the default output from pydantic by calling `to_dict()` of quality + if self.quality: + _dict['quality'] = self.quality.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Detection from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "crop": obj.get("crop"), + "attributes": DetectionAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None, + "landmarks": obj.get("landmarks"), + "quality": DetectionQuality.from_dict(obj["quality"]) if obj.get("quality") is not None else None, + "roi": obj.get("roi") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detection_attributes.py b/regula/facesdk/webclient/gen/models/detection_attributes.py new file mode 100644 index 0000000..dcf73fa --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detection_attributes.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.detail_item import DetailItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectionAttributes(BaseModel): + """ + The evaluated attributes, see the [Attributes List](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/) for details. + """ # noqa: E501 + details: SkipValidation[Optional[List[DetailItem]]] = Field(alias="details", default=None, description="Attributes assessment details. Returns `DetectDetailsMeta` or `DetectAttributesDetails`.") + elapsed_time: SkipValidation[Optional[float]] = Field(alias="elapsedTime", default=None, description="Server processing time for attribute detection, ms.") + __properties: ClassVar[List[str]] = ["details", "elapsedTime"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectionAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in details (list) + _items = [] + if self.details: + for _item_details in self.details: + if _item_details: + _items.append(_item_details.to_dict()) + _dict['details'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectionAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "details": [DetailItem.from_dict(_item) for _item in obj.get("details", []) if DetailItem.from_dict(_item) is not None], + "elapsedTime": obj.get("elapsedTime") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detection_attributes_details_inner.py b/regula/facesdk/webclient/gen/models/detection_attributes_details_inner.py new file mode 100644 index 0000000..ff42d35 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detection_attributes_details_inner.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from regula.facesdk.webclient.gen.models.detect_attributes_details import DetectAttributesDetails +from regula.facesdk.webclient.gen.models.detect_details_meta import DetectDetailsMeta +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +DETECTIONATTRIBUTESDETAILSINNER_ONE_OF_SCHEMAS = ["DetectAttributesDetails", "DetectDetailsMeta"] + +class DetectionAttributesDetailsInner(BaseModel): + """ + DetectionAttributesDetailsInner + """ + # data type: DetectAttributesDetails + oneof_schema_1_validator: Optional[DetectAttributesDetails] = None + # data type: DetectDetailsMeta + oneof_schema_2_validator: Optional[DetectDetailsMeta] = None + actual_instance: Optional[Union[DetectAttributesDetails, DetectDetailsMeta]] = None + one_of_schemas: Set[str] = { "DetectAttributesDetails", "DetectDetailsMeta" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = DetectionAttributesDetailsInner.model_construct() + error_messages = [] + match = 0 + # validate data type: DetectAttributesDetails + if not isinstance(v, DetectAttributesDetails): + error_messages.append(f"Error! Input type `{type(v)}` is not `DetectAttributesDetails`") + else: + match += 1 + # validate data type: DetectDetailsMeta + if not isinstance(v, DetectDetailsMeta): + error_messages.append(f"Error! Input type `{type(v)}` is not `DetectDetailsMeta`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in DetectionAttributesDetailsInner with oneOf schemas: DetectAttributesDetails, DetectDetailsMeta. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in DetectionAttributesDetailsInner with oneOf schemas: DetectAttributesDetails, DetectDetailsMeta. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into DetectAttributesDetails + try: + instance.actual_instance = DetectAttributesDetails.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DetectDetailsMeta + try: + instance.actual_instance = DetectDetailsMeta.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into DetectionAttributesDetailsInner with oneOf schemas: DetectAttributesDetails, DetectDetailsMeta. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into DetectionAttributesDetailsInner with oneOf schemas: DetectAttributesDetails, DetectDetailsMeta. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DetectAttributesDetails, DetectDetailsMeta]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/regula/facesdk/webclient/gen/models/detection_face.py b/regula/facesdk/webclient/gen/models/detection_face.py new file mode 100644 index 0000000..0b53202 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detection_face.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectionFace(BaseModel): + """ + DetectionFace + """ # noqa: E501 + face_index: SkipValidation[Optional[float]] = Field(alias="faceIndex", default=None, description="The detected face index number.") + landmarks: SkipValidation[Optional[List[List[float]]]] = Field(alias="landmarks", default=None, description="Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips.") + rotation_angle: SkipValidation[Optional[float]] = Field(alias="rotationAngle", default=None, description="Angle of rotation of the face from the vertical axis, degrees.") + roi: SkipValidation[Optional[List[float]]] = Field(alias="roi", default=None, description="The rectangular area of a detected face that is represented by a set of four elements: the X and Y coordinates of the top-left point, and the width and height dimensions of the rectangle.") + crop: SkipValidation[Optional[bytearray]] = Field(alias="crop", default=None, description="Base64-encoded aligned and cropped portrait.") + __properties: ClassVar[List[str]] = ["faceIndex", "landmarks", "rotationAngle", "roi", "crop"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectionFace from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectionFace from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "faceIndex": obj.get("faceIndex"), + "landmarks": obj.get("landmarks"), + "rotationAngle": obj.get("rotationAngle"), + "roi": obj.get("roi"), + "crop": obj.get("crop") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/detection_quality.py b/regula/facesdk/webclient/gen/models/detection_quality.py new file mode 100644 index 0000000..ce6861c --- /dev/null +++ b/regula/facesdk/webclient/gen/models/detection_quality.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.face_quality_config_name import FaceQualityConfigName +from regula.facesdk.webclient.gen.models.quality_detail import QualityDetail +from regula.facesdk.webclient.gen.models.quality_details_groups import QualityDetailsGroups +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DetectionQuality(BaseModel): + """ + The portrait quality assessment results, see [Face Image Quality Characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). If not set in request, no quality check is performed. + """ # noqa: E501 + non_compliant: SkipValidation[Optional[List[FaceQualityConfigName]]] = Field(alias="nonCompliant", default=None, description="Non-compliant assessment characteristics.") + details_groups: SkipValidation[Optional[List[QualityDetailsGroups]]] = Field(alias="detailsGroups", default=None, description="Assessment results for each [group of characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/).") + details: SkipValidation[Optional[List[QualityDetail]]] = Field(alias="details", default=None, description="Assessment characteristics that were set in the request.") + score: SkipValidation[Optional[float]] = Field(alias="score", default=None, description="Returns the estimated portrait quality assessment result, a number from `0` to `1`, where `1` is for absolute compliance.") + elapsed_time: SkipValidation[Optional[float]] = Field(alias="elapsedTime", default=None, description="Server processing time for quality assessment, ms.") + __properties: ClassVar[List[str]] = ["nonCompliant", "detailsGroups", "details", "score", "elapsedTime"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DetectionQuality from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in details_groups (list) + _items = [] + if self.details_groups: + for _item_details_groups in self.details_groups: + if _item_details_groups: + _items.append(_item_details_groups.to_dict()) + _dict['detailsGroups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in details (list) + _items = [] + if self.details: + for _item_details in self.details: + if _item_details: + _items.append(_item_details.to_dict()) + _dict['details'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DetectionQuality from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "nonCompliant": obj.get("nonCompliant"), + "detailsGroups": [QualityDetailsGroups.from_dict(_item) for _item in obj.get("detailsGroups", []) if QualityDetailsGroups.from_dict(_item) is not None], + "details": [QualityDetail.from_dict(_item) for _item in obj.get("details", []) if QualityDetail.from_dict(_item) is not None], + "score": obj.get("score"), + "elapsedTime": obj.get("elapsedTime") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/device_info.py b/regula/facesdk/webclient/gen/models/device_info.py new file mode 100644 index 0000000..af999ef --- /dev/null +++ b/regula/facesdk/webclient/gen/models/device_info.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class DeviceInfo(BaseModel): + """ + DeviceInfo + """ # noqa: E501 + app: SkipValidation[str] = Field(alias="app", description="Application name.") + license_id: SkipValidation[str] = Field(alias="licenseId", description="Unique license identifier.") + license_serial: SkipValidation[str] = Field(alias="licenseSerial", description="License serial number.") + license_valid_until: SkipValidation[datetime] = Field(alias="licenseValidUntil", description="License validity date.") + version: SkipValidation[str] = Field(alias="version", description="Product version.") + __properties: ClassVar[List[str]] = ["app", "licenseId", "licenseSerial", "licenseValidUntil", "version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DeviceInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if license_id (nullable) is None + # and model_fields_set contains the field + if self.license_id is None and "license_id" in self.model_fields_set: + _dict['licenseId'] = None + + # set to None if license_serial (nullable) is None + # and model_fields_set contains the field + if self.license_serial is None and "license_serial" in self.model_fields_set: + _dict['licenseSerial'] = None + + # set to None if license_valid_until (nullable) is None + # and model_fields_set contains the field + if self.license_valid_until is None and "license_valid_until" in self.model_fields_set: + _dict['licenseValidUntil'] = None + + # set to None if version (nullable) is None + # and model_fields_set contains the field + if self.version is None and "version" in self.model_fields_set: + _dict['version'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "app": obj.get("app"), + "licenseId": obj.get("licenseId"), + "licenseSerial": obj.get("licenseSerial"), + "licenseValidUntil": obj.get("licenseValidUntil"), + "version": obj.get("version") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/face_attribute.py b/regula/facesdk/webclient/gen/models/face_attribute.py new file mode 100644 index 0000000..f338ecd --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_attribute.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaceAttribute(str, Enum): + """ + The name of the attribute. For definitions, see the [FaceAttribute enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-attribute/). + """ + + """ + allowed enum values + """ + AGE = 'Age' + EMOTION = 'Emotion' + EYE_LEFT = 'EyeLeft' + EYE_RIGHT = 'EyeRight' + SMILE = 'Smile' + GLASSES = 'Glasses' + HEAD_COVERING = 'HeadCovering' + FOREHEAD_COVERING = 'ForeheadCovering' + MOUTH = 'Mouth' + MEDICAL_MASK = 'MedicalMask' + OCCLUSION = 'Occlusion' + STRONG_MAKEUP = 'StrongMakeup' + HEADPHONES = 'Headphones' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaceAttribute from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/face_image_quality_align_type.py b/regula/facesdk/webclient/gen/models/face_image_quality_align_type.py new file mode 100644 index 0000000..bf5ab80 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_image_quality_align_type.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaceImageQualityAlignType(int, Enum): + """ + The aspect ratio according to which face alignment is performed. See the [FaceImageQualityAlignType enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-align-type/). To get a thumbnail with aspect ratio 3:4, set `0`. + """ + + """ + allowed enum values + """ + ALIGN_3x4 = 0 + ALIGN_4x5 = 1 + ALIGN_2x3 = 2 + ALIGN_1x1 = 3 + ALIGN_7x9 = 4 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaceImageQualityAlignType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/face_image_quality_groups.py b/regula/facesdk/webclient/gen/models/face_image_quality_groups.py new file mode 100644 index 0000000..2e2ea3f --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_image_quality_groups.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaceImageQualityGroups(int, Enum): + """ + The group ID of the characteristic, see the [FaceImageQualityGroups enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/) for details. + """ + + """ + allowed enum values + """ + IMAGE_CHARACTERISTICS = 1 + HEAD_SIZE_AND_POSITIONS = 2 + FACE_QUALITY = 3 + EYES_CHARACTERISTICS = 4 + SHADOWS_AND_LIGHTNING = 5 + POSE_AND_EXPRESSION = 6 + HEAD_OCCLUSION = 7 + BACKGROUND = 8 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaceImageQualityGroups from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/face_image_quality_groups_strings.py b/regula/facesdk/webclient/gen/models/face_image_quality_groups_strings.py new file mode 100644 index 0000000..59c0399 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_image_quality_groups_strings.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaceImageQualityGroupsStrings(str, Enum): + """ + Face image quality assessment group name, see [FaceImageQualityGroups](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/). + """ + + """ + allowed enum values + """ + IMAGE_CHARACTERISTICS = 'ImageCharacteristics' + HEAD_SIZE_AND_POSITIONS = 'HeadSizeAndPosition' + FACE_QUALITY = 'FaceQuality' + EYES_CHARACTERISTICS = 'EyesCharacteristics' + SHADOWS_AND_LIGHTNING = 'ShadowsAndLightning' + POSE_AND_EXPRESSION = 'PoseAndExpression' + HEAD_OCCLUSION = 'HeadOcclusion' + BACKGROUND = 'Background' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaceImageQualityGroupsStrings from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/face_image_quality_status.py b/regula/facesdk/webclient/gen/models/face_image_quality_status.py new file mode 100644 index 0000000..d2ab6d8 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_image_quality_status.py @@ -0,0 +1,30 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaceImageQualityStatus(int, Enum): + """ + The processing status returned for each quality characteristic, see the [FaceImageQualityStatus enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-status/). + """ + + """ + allowed enum values + """ + QUALITY_STATUS_FALSE = 0 + QUALITY_STATUS_TRUE = 1 + QUALITY_STATUS_UNDETERMINED = 2 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaceImageQualityStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/face_quality_config_name.py b/regula/facesdk/webclient/gen/models/face_quality_config_name.py new file mode 100644 index 0000000..fb3ff3c --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_quality_config_name.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaceQualityConfigName(str, Enum): + """ + The name of the characteristic. For definitions, see the [FaceQualityConfigName enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-quality-config-name/). + """ + + """ + allowed enum values + """ + IMAGE_WIDTH = 'ImageWidth' + IMAGE_HEIGHT = 'ImageHeight' + IMAGE_WIDTH_TO_HEIGHT = 'ImageWidthToHeight' + IMAGE_CHANNELS_NUMBER = 'ImageChannelsNumber' + PADDING_RATIO = 'PaddingRatio' + FACE_MID_POINT_HORIZONTAL_POSITION = 'FaceMidPointHorizontalPosition' + FACE_MID_POINT_VERTICAL_POSITION = 'FaceMidPointVerticalPosition' + HEAD_WIDTH_RATIO = 'HeadWidthRatio' + HEAD_HEIGHT_RATIO = 'HeadHeightRatio' + EYES_DISTANCE = 'EyesDistance' + YAW = 'Yaw' + PITCH = 'Pitch' + ROLL = 'Roll' + BLUR_LEVEL = 'BlurLevel' + NOISE_LEVEL = 'NoiseLevel' + EYE_RIGHT_CLOSED = 'EyeRightClosed' + EYE_LEFT_CLOSED = 'EyeLeftClosed' + EYE_RIGHT_OCCLUDED = 'EyeRightOccluded' + EYE_LEFT_OCCLUDED = 'EyeLeftOccluded' + EYES_RED = 'EyesRed' + EYE_RIGHT_COVERED_WITH_HAIR = 'EyeRightCoveredWithHair' + EYE_LEFT_COVERED_WITH_HAIR = 'EyeLeftCoveredWithHair' + OFF_GAZE = 'OffGaze' + FACE_DYNAMIC_RANGE = 'FaceDynamicRange' + UNNATURAL_SKIN_TONE = 'UnnaturalSkinTone' + TOO_DARK = 'TooDark' + TOO_LIGHT = 'TooLight' + FACE_GLARE = 'FaceGlare' + SHADOWS_ON_FACE = 'ShadowsOnFace' + DARK_GLASSES = 'DarkGlasses' + REFLECTION_ON_GLASSES = 'ReflectionOnGlasses' + FRAMES_TOO_HEAVY = 'FramesTooHeavy' + FACE_OCCLUDED = 'FaceOccluded' + HEAD_COVERING = 'HeadCovering' + BACKGROUND_UNIFORMITY = 'BackgroundUniformity' + SHADOWS_ON_BACKGROUND = 'ShadowsOnBackground' + OTHER_FACES = 'OtherFaces' + SHOULDERS_POSE = 'ShouldersPose' + EXPRESSION_LEVEL = 'ExpressionLevel' + MOUTH_OPEN = 'MouthOpen' + FOREHEAD_COVERING = 'ForeheadCovering' + SMILE = 'Smile' + STRONG_MAKEUP = 'StrongMakeup' + HEADPHONES = 'Headphones' + MEDICAL_MASK = 'MedicalMask' + BACKGROUND_COLOR_MATCH = 'BackgroundColorMatch' + ART_FACE = 'ArtFace' + CONTACT_LENSES = 'ContactLenses' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaceQualityConfigName from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/face_quality_scenarios.py b/regula/facesdk/webclient/gen/models/face_quality_scenarios.py new file mode 100644 index 0000000..1b461d2 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_quality_scenarios.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaceQualityScenarios(str, Enum): + """ + Face detection scenario. If set and the scenario is found, it automatically applies the relevant parameters, overriding any other parameters specified in the request. If the scenario is not set, is empty, or the name is not recognized, processing will follow the parameters directly set in the request. For detailed descriptions of available scenarios, refer to the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/). + """ + + """ + allowed enum values + """ + OLD_MODE = 'OldMode' + QUALITY_FULL = 'QualityFull' + QUALITY_ICAO = 'QualityICAO' + QUALITY_VISA_SCHENGEN = 'QualityVisaSchengen' + QUALITY_VISA_USA = 'QualityVisaUSA' + CROP_CENTRAL_FACE = 'CropCentralFace' + CROP_ALL_FACES = 'CropAllFaces' + THUMBNAIL = 'Thumbnail' + ATTRIBUTES_ALL = 'AttributesAll' + EMPTY = '' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaceQualityScenarios from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/face_sdk_result.py b/regula/facesdk/webclient/gen/models/face_sdk_result.py new file mode 100644 index 0000000..b95ac08 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_sdk_result.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class FaceSDKResult(BaseModel): + """ + FaceSDKResult + """ # noqa: E501 + code: SkipValidation[FaceSDKResultCode] = Field(alias="code") + __properties: ClassVar[List[str]] = ["code"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaceSDKResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaceSDKResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/face_sdk_result_code.py b/regula/facesdk/webclient/gen/models/face_sdk_result_code.py new file mode 100644 index 0000000..ee60a59 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/face_sdk_result_code.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaceSDKResultCode(int, Enum): + """ + The result code, see the [FaceSDKResultCode enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-sdk-result-code/). + """ + + """ + allowed enum values + """ + FACER_OK = 0 + FR_IMAGE_EMPTY = 1 + FR_FACE_NOT_DETECTED = 2 + FR_LANDMARKS_NOT_DETECTED = 3 + FR_FACE_ALIGHNER_FAILED = 4 + FR_DESCRIPTOR_EXTRACTOR_ERROR = 5 + FR_IMAGE_DECODE_ERROR = 6 + FR_INTERNAL_ERROR = 7 + FACER_CONFIG_ERROR = 199 + FACER_NO_LICENSE = 200 + FACER_IS_NOT_INITIALIZED = 201 + FACER_COMMAND_IS_NOT_SUPPORTED = 202 + FACER_COMMAND_PARAMS_READ_ERROR = 203 + FACER_LESS_THAN_TWO_IMAGES_IN_REQUEST = 224 + FACER_VIDEO_DECODE_ERROR = 227 + FACER_NOT_ENOUGH_FRAMES = 228 + FACER_OUTPUT_IS_NOT_DEFINED = 229 + FACER_CLOSED_EYES_DETECTED = 230 + FACER_LOW_QUALITY = 231 + FACER_HIGH_ASYMMETRY = 232 + FACER_FACE_OVER_EMOTIONAL = 233 + FACER_SUNGLASSES_DETECTED = 234 + FACER_SMALL_AGE = 235 + FACER_HEADDRESS_DETECTED = 236 + FACER_FACES_NOT_MATCHED = 237 + FACER_IMAGES_COUNT_LIMIT_EXCEEDED = 238 + FACER_MEDICINE_MASK_DETECTED = 239 + FACER_OCCLUSION_DETECTED = 240 + FACER_FOREHEAD_GLASSES_DETECTED = 242 + FACER_MOUTH_OPENED = 243 + FACER_ART_MASK_DETECTED = 244 + FACER_ELECTRONIC_DEVICE_DETECTED = 245 + FACER_TRACK_BREAK = 246 + FACER_WRONG_GEO = 247 + FACER_WRONG_OF = 248 + FACER_WRONG_VIEW = 249 + FACER_TIMEOUT_LIVENESS_TRANSACTION = 250 + FACER_FAILED_LIVENESS_TRANSACTION = 251 + FACER_ABORTED_LIVENESS_TRANSACTION = 252 + FACER_GENERAL_ERROR = 253 + FACER_PASSIVE_LIVENESS_FAIL = 254 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaceSDKResultCode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/faces_response.py b/regula/facesdk/webclient/gen/models/faces_response.py new file mode 100644 index 0000000..dea29b8 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/faces_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.person_with_images import PersonWithImages +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class FacesResponse(BaseModel): + """ + FacesResponse + """ # noqa: E501 + face_index: SkipValidation[Optional[float]] = Field(alias="faceIndex", default=None, description="The detected face index number.") + landmarks: SkipValidation[Optional[List[List[float]]]] = Field(alias="landmarks", default=None, description="Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips.") + rotation_angle: SkipValidation[Optional[float]] = Field(alias="rotationAngle", default=None, description="Angle of rotation of the face from the vertical axis, degrees.") + roi: SkipValidation[Optional[List[float]]] = Field(alias="roi", default=None, description="The rectangular area of a detected face that is represented by a set of four elements: the X and Y coordinates of the top-left point, and the width and height dimensions of the rectangle.") + crop: SkipValidation[Optional[bytearray]] = Field(alias="crop", default=None, description="Base64-encoded aligned and cropped portrait.") + persons: SkipValidation[Optional[List[PersonWithImages]]] = Field(alias="persons", default=None, description="Detected Persons.") + __properties: ClassVar[List[str]] = ["faceIndex", "landmarks", "rotationAngle", "roi", "crop", "persons"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FacesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in persons (list) + _items = [] + if self.persons: + for _item_persons in self.persons: + if _item_persons: + _items.append(_item_persons.to_dict()) + _dict['persons'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FacesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "faceIndex": obj.get("faceIndex"), + "landmarks": obj.get("landmarks"), + "rotationAngle": obj.get("rotationAngle"), + "roi": obj.get("roi"), + "crop": obj.get("crop"), + "persons": [PersonWithImages.from_dict(_item) for _item in obj.get("persons", []) if PersonWithImages.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/faces_response_data.py b/regula/facesdk/webclient/gen/models/faces_response_data.py new file mode 100644 index 0000000..95495d5 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/faces_response_data.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.person_with_images import PersonWithImages +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class FacesResponseData(BaseModel): + """ + FacesResponseData + """ # noqa: E501 + persons: SkipValidation[Optional[List[PersonWithImages]]] = Field(alias="persons", default=None, description="Detected Persons.") + __properties: ClassVar[List[str]] = ["persons"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FacesResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in persons (list) + _items = [] + if self.persons: + for _item_persons in self.persons: + if _item_persons: + _items.append(_item_persons.to_dict()) + _dict['persons'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FacesResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "persons": [PersonWithImages.from_dict(_item) for _item in obj.get("persons", []) if PersonWithImages.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/filter_op.py b/regula/facesdk/webclient/gen/models/filter_op.py new file mode 100644 index 0000000..c8b2984 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/filter_op.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FilterOp(str, Enum): + """ + The filter condition, determines the type of comparison to be performed on the `name` values of the Person entity.

When set to `in`, the `name` values of the Person should match any of the values specified in the `value` list.

When set to `nin`, the `name` values of the Person should not match any of the values specified in the `value` list. + """ + + """ + allowed enum values + """ + IN = 'in' + NOT_IN = 'nin' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FilterOp from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/filter_search_request.py b/regula/facesdk/webclient/gen/models/filter_search_request.py new file mode 100644 index 0000000..10eb150 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/filter_search_request.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.filter_op import FilterOp +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class FilterSearchRequest(BaseModel): + """ + Allows to filter the search results based on the Person's `name`. If enabled, only the search results that meet the filter condition will be returned. + """ # noqa: E501 + op: SkipValidation[Optional[FilterOp]] = Field(alias="op", default=None) + var_field: SkipValidation[Optional[str]] = Field(alias="field", default=None, description="`name` of the Person.") + value: SkipValidation[Optional[List[str]]] = Field(alias="value", default=None, description="The list of `name` values against which the `field` is compared.") + __properties: ClassVar[List[str]] = ["op", "field", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FilterSearchRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FilterSearchRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "op": obj.get("op"), + "field": obj.get("field"), + "value": obj.get("value") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/group.py b/regula/facesdk/webclient/gen/models/group.py new file mode 100644 index 0000000..03ceeea --- /dev/null +++ b/regula/facesdk/webclient/gen/models/group.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class Group(BaseModel): + """ + Group + """ # noqa: E501 + name: SkipValidation[Optional[str]] = Field(alias="name", default=None, description="Group to create name.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing group's extended attributes.") + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Group ID.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Group creation date.") + __properties: ClassVar[List[str]] = ["name", "metadata", "id", "createdAt"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Group from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Group from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "metadata": obj.get("metadata"), + "id": obj.get("id"), + "createdAt": obj.get("createdAt") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/group_data.py b/regula/facesdk/webclient/gen/models/group_data.py new file mode 100644 index 0000000..916197a --- /dev/null +++ b/regula/facesdk/webclient/gen/models/group_data.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class GroupData(BaseModel): + """ + Additional group data in the response, includes id and createdAt. + """ # noqa: E501 + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Group ID.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Group creation date.") + __properties: ClassVar[List[str]] = ["id", "createdAt"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "createdAt": obj.get("createdAt") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/group_page.py b/regula/facesdk/webclient/gen/models/group_page.py new file mode 100644 index 0000000..c6b049d --- /dev/null +++ b/regula/facesdk/webclient/gen/models/group_page.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.group import Group +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class GroupPage(BaseModel): + """ + GroupPage + """ # noqa: E501 + items: SkipValidation[Optional[List[Group]]] = Field(alias="items", default=None, description="Array of Groups that are found during the search.") + page: SkipValidation[Optional[int]] = Field(alias="page", default=None, description="Current page number.") + total_pages: SkipValidation[Optional[int]] = Field(alias="totalPages", default=None, description="Total number of pages.") + __properties: ClassVar[List[str]] = ["items", "page", "totalPages"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupPage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupPage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [Group.from_dict(_item) for _item in obj.get("items", []) if Group.from_dict(_item) is not None], + "page": obj.get("page"), + "totalPages": obj.get("totalPages") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/group_page_items.py b/regula/facesdk/webclient/gen/models/group_page_items.py new file mode 100644 index 0000000..63ef851 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/group_page_items.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.group import Group +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class GroupPageItems(BaseModel): + """ + GroupPageItems + """ # noqa: E501 + items: SkipValidation[Optional[List[Group]]] = Field(alias="items", default=None, description="Array of Groups that are found during the search.") + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupPageItems from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupPageItems from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [Group.from_dict(_item) for _item in obj.get("items", []) if Group.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/group_response.py b/regula/facesdk/webclient/gen/models/group_response.py new file mode 100644 index 0000000..eea65f4 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/group_response.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class GroupResponse(BaseModel): + """ + Response group create data, includes name and metadata. + """ # noqa: E501 + name: SkipValidation[Optional[str]] = Field(alias="name", default=None, description="Group to create name.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing group's extended attributes.") + __properties: ClassVar[List[str]] = ["name", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/group_to_create.py b/regula/facesdk/webclient/gen/models/group_to_create.py new file mode 100644 index 0000000..74e49d6 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/group_to_create.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class GroupToCreate(BaseModel): + """ + Request body of the group to create data, includes name and metadata. + """ # noqa: E501 + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator.") + name: SkipValidation[str] = Field(alias="name", description="Group to create name.") + metadata: SkipValidation[Dict[str, object]] = Field(alias="metadata", description="A free-form object containing group's extended attributes.") + __properties: ClassVar[List[str]] = ["tag", "name", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupToCreate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupToCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tag": obj.get("tag"), + "name": obj.get("name"), + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/image.py b/regula/facesdk/webclient/gen/models/image.py new file mode 100644 index 0000000..6bfce58 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/image.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class Image(BaseModel): + """ + Image in the response. + """ # noqa: E501 + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Response image ID. The list is sorted by decreasing ID value.") + content: SkipValidation[Optional[str]] = Field(alias="content", default=None, description="Base64-encoded image. Returned only if `withImages` is set to true in the request.") + content_type: SkipValidation[Optional[str]] = Field(alias="contentType", default=None, description="Original media type of the returned image.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Returned image creation date.") + updated_at: SkipValidation[Optional[str]] = Field(alias="updatedAt", default=None, description="Returned image update date.") + path: SkipValidation[Optional[str]] = Field(alias="path", default=None, description="Returned image path.") + url: SkipValidation[Optional[str]] = Field(alias="url", default=None, description="Returned image URL.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + __properties: ClassVar[List[str]] = ["id", "content", "contentType", "createdAt", "updatedAt", "path", "url", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Image from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Image from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "content": obj.get("content"), + "contentType": obj.get("contentType"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt"), + "path": obj.get("path"), + "url": obj.get("url"), + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/image_fields.py b/regula/facesdk/webclient/gen/models/image_fields.py new file mode 100644 index 0000000..ea456f3 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/image_fields.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.image_fields_image import ImageFieldsImage +from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class ImageFields(BaseModel): + """ + Image in the request data, includes image and contentType. + """ # noqa: E501 + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.") + image: SkipValidation[Optional[ImageFieldsImage]] = Field(alias="image", default=None) + output_image_params: SkipValidation[Optional[OutputImageParams]] = Field(alias="outputImageParams", default=None) + detect_all: SkipValidation[Optional[bool]] = Field(alias="detectAll", default=None, description="Whether to detect all faces in the image. If set to `false`, only the most central face is detected.") + threshold: SkipValidation[Optional[float]] = Field(alias="threshold", default=None, description="The similarity threshold.") + limit: SkipValidation[Optional[int]] = Field(alias="limit", default=None, description="The maximum number of results to be returned.") + __properties: ClassVar[List[str]] = ["tag", "image", "outputImageParams", "detectAll", "threshold", "limit"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImageFields from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of image + if self.image: + _dict['image'] = self.image.to_dict() + # override the default output from pydantic by calling `to_dict()` of output_image_params + if self.output_image_params: + _dict['outputImageParams'] = self.output_image_params.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImageFields from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tag": obj.get("tag"), + "image": ImageFieldsImage.from_dict(obj["image"]) if obj.get("image") is not None else None, + "outputImageParams": OutputImageParams.from_dict(obj["outputImageParams"]) if obj.get("outputImageParams") is not None else None, + "detectAll": obj.get("detectAll") if obj.get("detectAll") is not None else False, + "threshold": obj.get("threshold"), + "limit": obj.get("limit") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/image_fields_image.py b/regula/facesdk/webclient/gen/models/image_fields_image.py new file mode 100644 index 0000000..da450ea --- /dev/null +++ b/regula/facesdk/webclient/gen/models/image_fields_image.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.resize_options import ResizeOptions +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class ImageFieldsImage(BaseModel): + """ + Uploaded image. + """ # noqa: E501 + content_type: SkipValidation[Optional[str]] = Field(alias="contentType", default=None, description="Original media type of the uploaded image.") + content: SkipValidation[Optional[bytearray]] = Field(alias="content", default=None, description="Base64-encoded image.") + image_url: SkipValidation[Optional[str]] = Field(alias="imageUrl", default=None, description="Image URL.") + resize_options: SkipValidation[Optional[ResizeOptions]] = Field(alias="resizeOptions", default=None) + __properties: ClassVar[List[str]] = ["contentType", "content", "imageUrl", "resizeOptions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImageFieldsImage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of resize_options + if self.resize_options: + _dict['resizeOptions'] = self.resize_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImageFieldsImage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "contentType": obj.get("contentType"), + "content": obj.get("content"), + "imageUrl": obj.get("imageUrl"), + "resizeOptions": ResizeOptions.from_dict(obj["resizeOptions"]) if obj.get("resizeOptions") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/image_page.py b/regula/facesdk/webclient/gen/models/image_page.py new file mode 100644 index 0000000..2332342 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/image_page.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.image import Image +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class ImagePage(BaseModel): + """ + ImagePage + """ # noqa: E501 + page: SkipValidation[Optional[int]] = Field(alias="page", default=None, description="Current page number.") + total_pages: SkipValidation[Optional[int]] = Field(alias="totalPages", default=None, description="Total number of pages.") + items: SkipValidation[Optional[List[Image]]] = Field(alias="items", default=None) + __properties: ClassVar[List[str]] = ["page", "totalPages", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImagePage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImagePage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "totalPages": obj.get("totalPages"), + "items": [Image.from_dict(_item) for _item in obj.get("items", []) if Image.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/image_page_items.py b/regula/facesdk/webclient/gen/models/image_page_items.py new file mode 100644 index 0000000..a7852ce --- /dev/null +++ b/regula/facesdk/webclient/gen/models/image_page_items.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.image import Image +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class ImagePageItems(BaseModel): + """ + ImagePageItems + """ # noqa: E501 + items: SkipValidation[Optional[List[Image]]] = Field(alias="items", default=None) + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ImagePageItems from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImagePageItems from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [Image.from_dict(_item) for _item in obj.get("items", []) if Image.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/image_source.py b/regula/facesdk/webclient/gen/models/image_source.py new file mode 100644 index 0000000..024b04b --- /dev/null +++ b/regula/facesdk/webclient/gen/models/image_source.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ImageSource(int, Enum): + """ + Face photo image source types: https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/image-source/ + """ + + """ + allowed enum values + """ + DOCUMENT_PRINTED = 1 + DOCUMENT_RFID = 2 + LIVE = 3 + DOCUMENT_WITH_LIVE = 4 + EXTERNAL = 5 + GHOST = 6 + BARCODE = 7 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ImageSource from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/liveness_type.py b/regula/facesdk/webclient/gen/models/liveness_type.py new file mode 100644 index 0000000..194c3d9 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/liveness_type.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class LivenessType(int, Enum): + """ + Liveness detection can be performed in two modes: active `0` and passive `1`. [Learn more](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/liveness/#active-and-passive-modes) + """ + + """ + allowed enum values + """ + ACTIVE = 0 + PASSIVE = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of LivenessType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/regula/facesdk/webclient/gen/models/match_and_search_request.py b/regula/facesdk/webclient/gen/models/match_and_search_request.py new file mode 100644 index 0000000..c78b163 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_and_search_request.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from uuid import UUID +from regula.facesdk.webclient.gen.models.match_and_search_request_images_item import MatchAndSearchRequestImagesItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchAndSearchRequest(BaseModel): + """ + MatchAndSearchRequest + """ # noqa: E501 + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.") + images: SkipValidation[Optional[List[MatchAndSearchRequestImagesItem]]] = Field(alias="images", default=None, description="An array of images to be processed. At least two images must be provided.") + group_ids: SkipValidation[Optional[List[str]]] = Field(alias="groupIds", default=None, description="IDs of the groups in which the search is performed.") + threshold: SkipValidation[Optional[float]] = Field(alias="threshold", default=None, description="The similarity threshold.") + limit: SkipValidation[Optional[int]] = Field(alias="limit", default=None, description="The maximum number of results to be returned.") + tenant: SkipValidation[Optional[str]] = Field(alias="tenant", default=None, description="A label used to group transactions by customers, applications, or other criteria.") + env: SkipValidation[Optional[str]] = Field(alias="env", default=None, description="A label used to differentiate transactions by development stages.") + __properties: ClassVar[List[str]] = ["tag", "images", "groupIds", "threshold", "limit", "tenant", "env"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchAndSearchRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in images (list) + _items = [] + if self.images: + for _item_images in self.images: + if _item_images: + _items.append(_item_images.to_dict()) + _dict['images'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchAndSearchRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tag": obj.get("tag"), + "images": [MatchAndSearchRequestImagesItem.from_dict(_item) for _item in obj.get("images", []) if MatchAndSearchRequestImagesItem.from_dict(_item) is not None], + "groupIds": obj.get("groupIds"), + "threshold": obj.get("threshold"), + "limit": obj.get("limit"), + "tenant": obj.get("tenant"), + "env": obj.get("env") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_and_search_request_images_item.py b/regula/facesdk/webclient/gen/models/match_and_search_request_images_item.py new file mode 100644 index 0000000..a19d312 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_and_search_request_images_item.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.image_source import ImageSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchAndSearchRequestImagesItem(BaseModel): + """ + MatchAndSearchRequestImagesItem + """ # noqa: E501 + content: SkipValidation[Optional[bytearray]] = Field(alias="content", default=None, description="Base64-encoded image.") + image_url: SkipValidation[Optional[str]] = Field(alias="imageUrl", default=None, description="Image URL.") + type: SkipValidation[Optional[ImageSource]] = Field(alias="type", default=None) + __properties: ClassVar[List[str]] = ["content", "imageUrl", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchAndSearchRequestImagesItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchAndSearchRequestImagesItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": obj.get("content"), + "imageUrl": obj.get("imageUrl"), + "type": obj.get("type") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_and_search_response.py b/regula/facesdk/webclient/gen/models/match_and_search_response.py new file mode 100644 index 0000000..b4dca43 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_and_search_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode +from regula.facesdk.webclient.gen.models.match_and_search_response_data_detections_item import MatchAndSearchResponseDataDetectionsItem +from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchAndSearchResponse(BaseModel): + """ + MatchAndSearchResponse + """ # noqa: E501 + code: SkipValidation[FaceSDKResultCode] = Field(alias="code") + results: SkipValidation[Optional[List[MatchImageResult]]] = Field(alias="results", default=None, description="The match and search results.") + elapsed_time: SkipValidation[Optional[float]] = Field(alias="elapsedTime", default=None, description="Server processing time, ms. Does not include the time taken to receive the request or deliver the response.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + detections: SkipValidation[Optional[List[MatchAndSearchResponseDataDetectionsItem]]] = Field(alias="detections", default=None, description="The detection results.") + __properties: ClassVar[List[str]] = ["code", "results", "elapsedTime", "metadata", "detections"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchAndSearchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in detections (list) + _items = [] + if self.detections: + for _item_detections in self.detections: + if _item_detections: + _items.append(_item_detections.to_dict()) + _dict['detections'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchAndSearchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "results": [MatchImageResult.from_dict(_item) for _item in obj.get("results", []) if MatchImageResult.from_dict(_item) is not None], + "elapsedTime": obj.get("elapsedTime"), + "metadata": obj.get("metadata"), + "detections": [MatchAndSearchResponseDataDetectionsItem.from_dict(_item) for _item in obj.get("detections", []) if MatchAndSearchResponseDataDetectionsItem.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_and_search_response_data.py b/regula/facesdk/webclient/gen/models/match_and_search_response_data.py new file mode 100644 index 0000000..fddc2da --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_and_search_response_data.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.match_and_search_response_data_detections_item import MatchAndSearchResponseDataDetectionsItem +from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchAndSearchResponseData(BaseModel): + """ + MatchAndSearchResponseData + """ # noqa: E501 + results: SkipValidation[Optional[List[MatchImageResult]]] = Field(alias="results", default=None, description="The match and search results.") + elapsed_time: SkipValidation[Optional[float]] = Field(alias="elapsedTime", default=None, description="Server processing time, ms. Does not include the time taken to receive the request or deliver the response.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + detections: SkipValidation[Optional[List[MatchAndSearchResponseDataDetectionsItem]]] = Field(alias="detections", default=None, description="The detection results.") + __properties: ClassVar[List[str]] = ["results", "elapsedTime", "metadata", "detections"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchAndSearchResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in detections (list) + _items = [] + if self.detections: + for _item_detections in self.detections: + if _item_detections: + _items.append(_item_detections.to_dict()) + _dict['detections'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchAndSearchResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [MatchImageResult.from_dict(_item) for _item in obj.get("results", []) if MatchImageResult.from_dict(_item) is not None], + "elapsedTime": obj.get("elapsedTime"), + "metadata": obj.get("metadata"), + "detections": [MatchAndSearchResponseDataDetectionsItem.from_dict(_item) for _item in obj.get("detections", []) if MatchAndSearchResponseDataDetectionsItem.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_and_search_response_data_detections_item.py b/regula/facesdk/webclient/gen/models/match_and_search_response_data_detections_item.py new file mode 100644 index 0000000..9a39675 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_and_search_response_data_detections_item.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode +from regula.facesdk.webclient.gen.models.faces_response import FacesResponse +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchAndSearchResponseDataDetectionsItem(BaseModel): + """ + MatchAndSearchResponseDataDetectionsItem + """ # noqa: E501 + faces: SkipValidation[Optional[List[FacesResponse]]] = Field(alias="faces", default=None, description="Detected faces.") + image_index: SkipValidation[Optional[int]] = Field(alias="imageIndex", default=None, description="The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated.") + status: SkipValidation[Optional[FaceSDKResultCode]] = Field(alias="status", default=None) + __properties: ClassVar[List[str]] = ["faces", "imageIndex", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchAndSearchResponseDataDetectionsItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in faces (list) + _items = [] + if self.faces: + for _item_faces in self.faces: + if _item_faces: + _items.append(_item_faces.to_dict()) + _dict['faces'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchAndSearchResponseDataDetectionsItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "faces": [FacesResponse.from_dict(_item) for _item in obj.get("faces", []) if FacesResponse.from_dict(_item) is not None], + "imageIndex": obj.get("imageIndex"), + "status": obj.get("status") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_image.py b/regula/facesdk/webclient/gen/models/match_image.py new file mode 100644 index 0000000..95097f2 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_image.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.image_source import ImageSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchImage(BaseModel): + """ + MatchImage + """ # noqa: E501 + index: SkipValidation[Optional[int]] = Field(alias="index", default=None, description="The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated.") + type: SkipValidation[Optional[ImageSource]] = Field(alias="type", default=None) + data: SkipValidation[bytearray] = Field(alias="data", description="Base64-encoded image.") + detect_all: SkipValidation[Optional[bool]] = Field(alias="detectAll", default=None, description="Whether to detect all faces in the image. If set to `false`, only the most central face is detected.") + __properties: ClassVar[List[str]] = ["index", "type", "data", "detectAll"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchImage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchImage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index": obj.get("index"), + "type": obj.get("type"), + "data": obj.get("data"), + "detectAll": obj.get("detectAll") if obj.get("detectAll") is not None else False + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_image_detection.py b/regula/facesdk/webclient/gen/models/match_image_detection.py new file mode 100644 index 0000000..31d97f2 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_image_detection.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.detection_face import DetectionFace +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchImageDetection(BaseModel): + """ + MatchImageDetection + """ # noqa: E501 + faces: SkipValidation[Optional[List[DetectionFace]]] = Field(alias="faces", default=None, description="Detected faces.") + image_index: SkipValidation[int] = Field(alias="imageIndex", description="The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated.") + status: SkipValidation[FaceSDKResultCode] = Field(alias="status") + __properties: ClassVar[List[str]] = ["faces", "imageIndex", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchImageDetection from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in faces (list) + _items = [] + if self.faces: + for _item_faces in self.faces: + if _item_faces: + _items.append(_item_faces.to_dict()) + _dict['faces'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchImageDetection from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "faces": [DetectionFace.from_dict(_item) for _item in obj.get("faces", []) if DetectionFace.from_dict(_item) is not None], + "imageIndex": obj.get("imageIndex"), + "status": obj.get("status") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_image_result.py b/regula/facesdk/webclient/gen/models/match_image_result.py new file mode 100644 index 0000000..5f2f297 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_image_result.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from regula.facesdk.webclient.gen.models.image_source import ImageSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchImageResult(BaseModel): + """ + MatchImageResult + """ # noqa: E501 + first_index: SkipValidation[int] = Field(alias="firstIndex", description="The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated.") + first_face_index: SkipValidation[Optional[float]] = Field(alias="firstFaceIndex", default=None, description="The detected face index number.") + first: SkipValidation[Optional[ImageSource]] = Field(alias="first", default=None) + second_index: SkipValidation[int] = Field(alias="secondIndex", description="The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated.") + second_face_index: SkipValidation[Optional[float]] = Field(alias="secondFaceIndex", default=None, description="The detected face index number.") + second: SkipValidation[Optional[ImageSource]] = Field(alias="second", default=None) + score: SkipValidation[Optional[float]] = Field(alias="score", default=None, description="A dimensionless number that shows how similar the compared faces are. 0—absolutely identical faces.") + similarity: SkipValidation[Optional[float]] = Field(alias="similarity", default=None, description="The detected faces similarity, %. 100%—absolutely identical faces, 0%—absolutely not identical.") + __properties: ClassVar[List[str]] = ["firstIndex", "firstFaceIndex", "first", "secondIndex", "secondFaceIndex", "second", "score", "similarity"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchImageResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchImageResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "firstIndex": obj.get("firstIndex"), + "firstFaceIndex": obj.get("firstFaceIndex"), + "first": obj.get("first"), + "secondIndex": obj.get("secondIndex"), + "secondFaceIndex": obj.get("secondFaceIndex"), + "second": obj.get("second"), + "score": obj.get("score"), + "similarity": obj.get("similarity") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_request.py b/regula/facesdk/webclient/gen/models/match_request.py new file mode 100644 index 0000000..e97ca12 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.match_image import MatchImage +from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchRequest(BaseModel): + """ + MatchRequest + """ # noqa: E501 + tenant: SkipValidation[Optional[str]] = Field(alias="tenant", default=None, description="A label used to group transactions by customers, applications, or other criteria.") + env: SkipValidation[Optional[str]] = Field(alias="env", default=None, description="A label used to differentiate transactions by development stages.") + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.") + images: SkipValidation[List[MatchImage]] = Field(alias="images", description="An array of images to be processed. At least two images must be provided.") + output_image_params: SkipValidation[Optional[OutputImageParams]] = Field(alias="outputImageParams", default=None) + __properties: ClassVar[List[str]] = ["tenant", "env", "tag", "images", "outputImageParams"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in images (list) + _items = [] + if self.images: + for _item_images in self.images: + if _item_images: + _items.append(_item_images.to_dict()) + _dict['images'] = _items + # override the default output from pydantic by calling `to_dict()` of output_image_params + if self.output_image_params: + _dict['outputImageParams'] = self.output_image_params.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenant": obj.get("tenant"), + "env": obj.get("env"), + "tag": obj.get("tag"), + "images": [MatchImage.from_dict(_item) for _item in obj.get("images", []) if MatchImage.from_dict(_item) is not None], + "outputImageParams": OutputImageParams.from_dict(obj["outputImageParams"]) if obj.get("outputImageParams") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_request_data.py b/regula/facesdk/webclient/gen/models/match_request_data.py new file mode 100644 index 0000000..01cf435 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_request_data.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.match_image import MatchImage +from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchRequestData(BaseModel): + """ + MatchRequestData + """ # noqa: E501 + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.") + images: SkipValidation[List[MatchImage]] = Field(alias="images", description="An array of images to be processed. At least two images must be provided.") + output_image_params: SkipValidation[Optional[OutputImageParams]] = Field(alias="outputImageParams", default=None) + __properties: ClassVar[List[str]] = ["tag", "images", "outputImageParams"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchRequestData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in images (list) + _items = [] + if self.images: + for _item_images in self.images: + if _item_images: + _items.append(_item_images.to_dict()) + _dict['images'] = _items + # override the default output from pydantic by calling `to_dict()` of output_image_params + if self.output_image_params: + _dict['outputImageParams'] = self.output_image_params.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchRequestData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tag": obj.get("tag"), + "images": [MatchImage.from_dict(_item) for _item in obj.get("images", []) if MatchImage.from_dict(_item) is not None], + "outputImageParams": OutputImageParams.from_dict(obj["outputImageParams"]) if obj.get("outputImageParams") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_response.py b/regula/facesdk/webclient/gen/models/match_response.py new file mode 100644 index 0000000..27464c3 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_response.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.face_sdk_result_code import FaceSDKResultCode +from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection +from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchResponse(BaseModel): + """ + MatchResponse + """ # noqa: E501 + code: SkipValidation[FaceSDKResultCode] = Field(alias="code") + detections: SkipValidation[Optional[List[MatchImageDetection]]] = Field(alias="detections", default=None, description="The detection results.") + results: SkipValidation[Optional[List[MatchImageResult]]] = Field(alias="results", default=None, description="The comparison results.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + __properties: ClassVar[List[str]] = ["code", "detections", "results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in detections (list) + _items = [] + if self.detections: + for _item_detections in self.detections: + if _item_detections: + _items.append(_item_detections.to_dict()) + _dict['detections'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "detections": [MatchImageDetection.from_dict(_item) for _item in obj.get("detections", []) if MatchImageDetection.from_dict(_item) is not None], + "results": [MatchImageResult.from_dict(_item) for _item in obj.get("results", []) if MatchImageResult.from_dict(_item) is not None], + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/match_response_data.py b/regula/facesdk/webclient/gen/models/match_response_data.py new file mode 100644 index 0000000..142be6e --- /dev/null +++ b/regula/facesdk/webclient/gen/models/match_response_data.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.match_image_detection import MatchImageDetection +from regula.facesdk.webclient.gen.models.match_image_result import MatchImageResult +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class MatchResponseData(BaseModel): + """ + MatchResponseData + """ # noqa: E501 + detections: SkipValidation[Optional[List[MatchImageDetection]]] = Field(alias="detections", default=None, description="The detection results.") + results: SkipValidation[Optional[List[MatchImageResult]]] = Field(alias="results", default=None, description="The comparison results.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + __properties: ClassVar[List[str]] = ["detections", "results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in detections (list) + _items = [] + if self.detections: + for _item_detections in self.detections: + if _item_detections: + _items.append(_item_detections.to_dict()) + _dict['detections'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "detections": [MatchImageDetection.from_dict(_item) for _item in obj.get("detections", []) if MatchImageDetection.from_dict(_item) is not None], + "results": [MatchImageResult.from_dict(_item) for _item in obj.get("results", []) if MatchImageResult.from_dict(_item) is not None], + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/operation_log.py b/regula/facesdk/webclient/gen/models/operation_log.py new file mode 100644 index 0000000..19c3a6a --- /dev/null +++ b/regula/facesdk/webclient/gen/models/operation_log.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class OperationLog(BaseModel): + """ + OperationLog + """ # noqa: E501 + status_code: SkipValidation[Optional[int]] = Field(alias="statusCode", default=None, description="Status code.") + type: SkipValidation[Optional[str]] = Field(alias="type", default=None, description="Error type.") + msg: SkipValidation[Optional[str]] = Field(alias="msg", default=None, description="Error message.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing group's extended attributes.") + __properties: ClassVar[List[str]] = ["statusCode", "type", "msg", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OperationLog from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OperationLog from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "statusCode": obj.get("statusCode"), + "type": obj.get("type"), + "msg": obj.get("msg"), + "metadata": obj.get("metadata") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/output_image_params.py b/regula/facesdk/webclient/gen/models/output_image_params.py new file mode 100644 index 0000000..d565c41 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/output_image_params.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from regula.facesdk.webclient.gen.models.crop import Crop +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class OutputImageParams(BaseModel): + """ + Allows to process the uploaded image according to the indicated settings. + """ # noqa: E501 + background_color: SkipValidation[Optional[List[int]]] = Field(alias="backgroundColor", default=None, description="The RGB value of a color for filling background behind a person's silhouette and for aligning the image.") + crop: SkipValidation[Optional[Crop]] = Field(alias="crop", default=None) + __properties: ClassVar[List[str]] = ["backgroundColor", "crop"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OutputImageParams from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of crop + if self.crop: + _dict['crop'] = self.crop.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OutputImageParams from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "backgroundColor": obj.get("backgroundColor"), + "crop": Crop.from_dict(obj["crop"]) if obj.get("crop") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/page.py b/regula/facesdk/webclient/gen/models/page.py new file mode 100644 index 0000000..f8fd92e --- /dev/null +++ b/regula/facesdk/webclient/gen/models/page.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class Page(BaseModel): + """ + Information about current page number and total pages count + """ # noqa: E501 + page: SkipValidation[Optional[int]] = Field(alias="page", default=None, description="Current page number.") + total_pages: SkipValidation[Optional[int]] = Field(alias="totalPages", default=None, description="Total number of pages.") + __properties: ClassVar[List[str]] = ["page", "totalPages"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Page from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Page from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "totalPages": obj.get("totalPages") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/person.py b/regula/facesdk/webclient/gen/models/person.py new file mode 100644 index 0000000..b271469 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/person.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class Person(BaseModel): + """ + Person response body: person ID, creation date, update date if any. + """ # noqa: E501 + name: SkipValidation[str] = Field(alias="name", description="Person's name.") + external_id: SkipValidation[Optional[str]] = Field(alias="externalId", default=None, description="Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + groups: SkipValidation[Optional[List[str]]] = Field(alias="groups", default=None, description="Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it.") + expire_at: SkipValidation[Optional[str]] = Field(alias="expireAt", default=None, description="Person expiration date.") + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Person ID. The list of persons is sorted by decreasing ID value.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Person creation date.") + updated_at: SkipValidation[Optional[str]] = Field(alias="updatedAt", default=None, description="Person update date.") + __properties: ClassVar[List[str]] = ["name", "externalId", "metadata", "groups", "expireAt", "id", "createdAt", "updatedAt"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Person from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Person from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "externalId": obj.get("externalId"), + "metadata": obj.get("metadata"), + "groups": obj.get("groups"), + "expireAt": obj.get("expireAt"), + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/person_data.py b/regula/facesdk/webclient/gen/models/person_data.py new file mode 100644 index 0000000..994ff47 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/person_data.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class PersonData(BaseModel): + """ + PersonData + """ # noqa: E501 + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Person ID. The list of persons is sorted by decreasing ID value.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Person creation date.") + updated_at: SkipValidation[Optional[str]] = Field(alias="updatedAt", default=None, description="Person update date.") + __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PersonData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PersonData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/person_fields.py b/regula/facesdk/webclient/gen/models/person_fields.py new file mode 100644 index 0000000..4010869 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/person_fields.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class PersonFields(BaseModel): + """ + Person Request body: name and metadata. + """ # noqa: E501 + name: SkipValidation[str] = Field(alias="name", description="Person's name.") + external_id: SkipValidation[Optional[str]] = Field(alias="externalId", default=None, description="Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + groups: SkipValidation[Optional[List[str]]] = Field(alias="groups", default=None, description="Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it.") + expire_at: SkipValidation[Optional[str]] = Field(alias="expireAt", default=None, description="Person expiration date.") + __properties: ClassVar[List[str]] = ["name", "externalId", "metadata", "groups", "expireAt"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PersonFields from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PersonFields from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "externalId": obj.get("externalId"), + "metadata": obj.get("metadata"), + "groups": obj.get("groups"), + "expireAt": obj.get("expireAt") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/person_items.py b/regula/facesdk/webclient/gen/models/person_items.py new file mode 100644 index 0000000..9265a5d --- /dev/null +++ b/regula/facesdk/webclient/gen/models/person_items.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.person import Person +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class PersonItems(BaseModel): + """ + PersonItems + """ # noqa: E501 + items: SkipValidation[Optional[List[Person]]] = Field(alias="items", default=None) + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PersonItems from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PersonItems from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [Person.from_dict(_item) for _item in obj.get("items", []) if Person.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/person_to_update_fields.py b/regula/facesdk/webclient/gen/models/person_to_update_fields.py new file mode 100644 index 0000000..002b7f5 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/person_to_update_fields.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class PersonToUpdateFields(BaseModel): + """ + Person Request body: name and metadata. + """ # noqa: E501 + external_id: SkipValidation[Optional[str]] = Field(alias="externalId", default=None, description="Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional.") + name: SkipValidation[Optional[str]] = Field(alias="name", default=None, description="Person's name.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + groups: SkipValidation[Optional[List[str]]] = Field(alias="groups", default=None, description="Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it.") + __properties: ClassVar[List[str]] = ["externalId", "name", "metadata", "groups"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PersonToUpdateFields from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PersonToUpdateFields from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "metadata": obj.get("metadata"), + "groups": obj.get("groups") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/person_with_images.py b/regula/facesdk/webclient/gen/models/person_with_images.py new file mode 100644 index 0000000..a2f5339 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/person_with_images.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from regula.facesdk.webclient.gen.models.recognize_image import RecognizeImage +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class PersonWithImages(BaseModel): + """ + PersonWithImages + """ # noqa: E501 + images: SkipValidation[Optional[List[RecognizeImage]]] = Field(alias="images", default=None, description="Detected Persons.") + name: SkipValidation[str] = Field(alias="name", description="Person's name.") + external_id: SkipValidation[Optional[str]] = Field(alias="externalId", default=None, description="Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + groups: SkipValidation[Optional[List[str]]] = Field(alias="groups", default=None, description="Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it.") + expire_at: SkipValidation[Optional[str]] = Field(alias="expireAt", default=None, description="Person expiration date.") + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Person ID. The list of persons is sorted by decreasing ID value.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Person creation date.") + updated_at: SkipValidation[Optional[str]] = Field(alias="updatedAt", default=None, description="Person update date.") + __properties: ClassVar[List[str]] = ["images", "name", "externalId", "metadata", "groups", "expireAt", "id", "createdAt", "updatedAt"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PersonWithImages from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in images (list) + _items = [] + if self.images: + for _item_images in self.images: + if _item_images: + _items.append(_item_images.to_dict()) + _dict['images'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PersonWithImages from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "images": [RecognizeImage.from_dict(_item) for _item in obj.get("images", []) if RecognizeImage.from_dict(_item) is not None], + "name": obj.get("name"), + "externalId": obj.get("externalId"), + "metadata": obj.get("metadata"), + "groups": obj.get("groups"), + "expireAt": obj.get("expireAt"), + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/person_with_images_data.py b/regula/facesdk/webclient/gen/models/person_with_images_data.py new file mode 100644 index 0000000..0d3a9fd --- /dev/null +++ b/regula/facesdk/webclient/gen/models/person_with_images_data.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.recognize_image import RecognizeImage +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class PersonWithImagesData(BaseModel): + """ + PersonWithImagesData + """ # noqa: E501 + images: SkipValidation[Optional[List[RecognizeImage]]] = Field(alias="images", default=None, description="Detected Persons.") + __properties: ClassVar[List[str]] = ["images"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PersonWithImagesData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in images (list) + _items = [] + if self.images: + for _item_images in self.images: + if _item_images: + _items.append(_item_images.to_dict()) + _dict['images'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PersonWithImagesData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "images": [RecognizeImage.from_dict(_item) for _item in obj.get("images", []) if RecognizeImage.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/persons_page.py b/regula/facesdk/webclient/gen/models/persons_page.py new file mode 100644 index 0000000..1e2b765 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/persons_page.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.person import Person +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class PersonsPage(BaseModel): + """ + PersonsPage + """ # noqa: E501 + items: SkipValidation[Optional[List[Person]]] = Field(alias="items", default=None) + page: SkipValidation[Optional[int]] = Field(alias="page", default=None, description="Current page number.") + total_pages: SkipValidation[Optional[int]] = Field(alias="totalPages", default=None, description="Total number of pages.") + __properties: ClassVar[List[str]] = ["items", "page", "totalPages"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PersonsPage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PersonsPage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [Person.from_dict(_item) for _item in obj.get("items", []) if Person.from_dict(_item) is not None], + "page": obj.get("page"), + "totalPages": obj.get("totalPages") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/process_param.py b/regula/facesdk/webclient/gen/models/process_param.py new file mode 100644 index 0000000..dfdb3ad --- /dev/null +++ b/regula/facesdk/webclient/gen/models/process_param.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.face_quality_scenarios import FaceQualityScenarios +from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams +from regula.facesdk.webclient.gen.models.process_param_attributes import ProcessParamAttributes +from regula.facesdk.webclient.gen.models.quality_request import QualityRequest +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class ProcessParam(BaseModel): + """ + The processing parameters. + """ # noqa: E501 + scenario: SkipValidation[Optional[FaceQualityScenarios]] = Field(alias="scenario", default=None) + only_central_face: SkipValidation[Optional[bool]] = Field(alias="onlyCentralFace", default=None, description="Whether to process only the central face in the image. If set to `false`, all the faces are processed.") + output_image_params: SkipValidation[Optional[OutputImageParams]] = Field(alias="outputImageParams", default=None) + quality: SkipValidation[Optional[QualityRequest]] = Field(alias="quality", default=None) + attributes: SkipValidation[Optional[ProcessParamAttributes]] = Field(alias="attributes", default=None) + __properties: ClassVar[List[str]] = ["scenario", "onlyCentralFace", "outputImageParams", "quality", "attributes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProcessParam from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of output_image_params + if self.output_image_params: + _dict['outputImageParams'] = self.output_image_params.to_dict() + # override the default output from pydantic by calling `to_dict()` of quality + if self.quality: + _dict['quality'] = self.quality.to_dict() + # override the default output from pydantic by calling `to_dict()` of attributes + if self.attributes: + _dict['attributes'] = self.attributes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProcessParam from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scenario": obj.get("scenario"), + "onlyCentralFace": obj.get("onlyCentralFace"), + "outputImageParams": OutputImageParams.from_dict(obj["outputImageParams"]) if obj.get("outputImageParams") is not None else None, + "quality": QualityRequest.from_dict(obj["quality"]) if obj.get("quality") is not None else None, + "attributes": ProcessParamAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/process_param_attributes.py b/regula/facesdk/webclient/gen/models/process_param_attributes.py new file mode 100644 index 0000000..6deb216 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/process_param_attributes.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.attribute_config import AttributeConfig +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class ProcessParamAttributes(BaseModel): + """ + If set, the selected attributes, such as age or emotions, are evaluated. To check all the available attributes, you can set the `AttributesAll` scenario in `processParam.scenario`. + """ # noqa: E501 + config: SkipValidation[Optional[List[AttributeConfig]]] = Field(alias="config", default=None, description="The list of attributes for evaluation.") + __properties: ClassVar[List[str]] = ["config"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProcessParamAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in config (list) + _items = [] + if self.config: + for _item_config in self.config: + if _item_config: + _items.append(_item_config.to_dict()) + _dict['config'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProcessParamAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "config": [AttributeConfig.from_dict(_item) for _item in obj.get("config", []) if AttributeConfig.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/quality_config.py b/regula/facesdk/webclient/gen/models/quality_config.py new file mode 100644 index 0000000..7e149a6 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/quality_config.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from regula.facesdk.webclient.gen.models.face_quality_config_name import FaceQualityConfigName +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class QualityConfig(BaseModel): + """ + The configuration that defines the list of returned quality check characteristics. + """ # noqa: E501 + name: SkipValidation[Optional[FaceQualityConfigName]] = Field(alias="name", default=None) + range: SkipValidation[Optional[List[float]]] = Field(alias="range", default=None, description="The range of applicable values for this characteristic. If the returned in the response value fits this range, the characteristic is identified as compliant with the requirements. For recommended ranges, see [Face Image Quality Assessment](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/).") + __properties: ClassVar[List[str]] = ["name", "range"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of QualityConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of QualityConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "range": obj.get("range") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/quality_detail.py b/regula/facesdk/webclient/gen/models/quality_detail.py new file mode 100644 index 0000000..cc82ba1 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/quality_detail.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from regula.facesdk.webclient.gen.models.face_image_quality_groups import FaceImageQualityGroups +from regula.facesdk.webclient.gen.models.face_image_quality_status import FaceImageQualityStatus +from regula.facesdk.webclient.gen.models.face_quality_config_name import FaceQualityConfigName +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class QualityDetail(BaseModel): + """ + QualityDetail + """ # noqa: E501 + group_id: SkipValidation[Optional[FaceImageQualityGroups]] = Field(alias="groupId", default=None) + name: SkipValidation[Optional[FaceQualityConfigName]] = Field(alias="name", default=None) + range: SkipValidation[Optional[List[float]]] = Field(alias="range", default=None, description="The range of set values for this characteristic, see the [Recommended range column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/).") + status: SkipValidation[Optional[FaceImageQualityStatus]] = Field(alias="status", default=None) + value: SkipValidation[Optional[float]] = Field(alias="value", default=None, description="The result value for the characteristic, returned in set units.") + __properties: ClassVar[List[str]] = ["groupId", "name", "range", "status", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of QualityDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of QualityDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "groupId": obj.get("groupId"), + "name": obj.get("name"), + "range": obj.get("range"), + "status": obj.get("status"), + "value": obj.get("value") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/quality_details_groups.py b/regula/facesdk/webclient/gen/models/quality_details_groups.py new file mode 100644 index 0000000..af05e23 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/quality_details_groups.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.face_image_quality_groups import FaceImageQualityGroups +from regula.facesdk.webclient.gen.models.face_image_quality_groups_strings import FaceImageQualityGroupsStrings +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class QualityDetailsGroups(BaseModel): + """ + QualityDetailsGroups + """ # noqa: E501 + group_id: SkipValidation[Optional[FaceImageQualityGroups]] = Field(alias="groupId", default=None) + name: SkipValidation[Optional[FaceImageQualityGroupsStrings]] = Field(alias="name", default=None) + total_count: SkipValidation[Optional[int]] = Field(alias="totalCount", default=None, description="The total number of characteristics in the group.") + compliant_count: SkipValidation[Optional[int]] = Field(alias="compliantCount", default=None, description="The number of compliant characteristics in the group.") + __properties: ClassVar[List[str]] = ["groupId", "name", "totalCount", "compliantCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of QualityDetailsGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of QualityDetailsGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "groupId": obj.get("groupId"), + "name": obj.get("name"), + "totalCount": obj.get("totalCount"), + "compliantCount": obj.get("compliantCount") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/quality_request.py b/regula/facesdk/webclient/gen/models/quality_request.py new file mode 100644 index 0000000..098279b --- /dev/null +++ b/regula/facesdk/webclient/gen/models/quality_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from regula.facesdk.webclient.gen.models.quality_config import QualityConfig +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class QualityRequest(BaseModel): + """ + If set, the face image quality check is performed according to the given list of [characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/) in `quality.config`. + """ # noqa: E501 + background_match_color: SkipValidation[Optional[List[int]]] = Field(alias="backgroundMatchColor", default=None, description="The RGB value of a color for filling background behind a person's silhouette and for aligning the image.") + config: SkipValidation[Optional[List[QualityConfig]]] = Field(alias="config", default=None, description="The list of quality check characteristics.") + __properties: ClassVar[List[str]] = ["backgroundMatchColor", "config"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of QualityRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in config (list) + _items = [] + if self.config: + for _item_config in self.config: + if _item_config: + _items.append(_item_config.to_dict()) + _dict['config'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of QualityRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "backgroundMatchColor": obj.get("backgroundMatchColor"), + "config": [QualityConfig.from_dict(_item) for _item in obj.get("config", []) if QualityConfig.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/recognize_image.py b/regula/facesdk/webclient/gen/models/recognize_image.py new file mode 100644 index 0000000..53215ca --- /dev/null +++ b/regula/facesdk/webclient/gen/models/recognize_image.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class RecognizeImage(BaseModel): + """ + RecognizeImage + """ # noqa: E501 + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Response image ID. The list is sorted by decreasing ID value.") + content: SkipValidation[Optional[str]] = Field(alias="content", default=None, description="Base64-encoded image. Returned only if `withImages` is set to true in the request.") + content_type: SkipValidation[Optional[str]] = Field(alias="contentType", default=None, description="Original media type of the returned image.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Returned image creation date.") + updated_at: SkipValidation[Optional[str]] = Field(alias="updatedAt", default=None, description="Returned image update date.") + path: SkipValidation[Optional[str]] = Field(alias="path", default=None, description="Returned image path.") + url: SkipValidation[Optional[str]] = Field(alias="url", default=None, description="Returned image URL.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + similarity: SkipValidation[Optional[float]] = Field(alias="similarity", default=None, description="Similarity score.") + distance: SkipValidation[Optional[float]] = Field(alias="distance", default=None, description="Similarity distance score: the lower the distance, the higher the face's similarity.") + __properties: ClassVar[List[str]] = ["id", "content", "contentType", "createdAt", "updatedAt", "path", "url", "metadata", "similarity", "distance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RecognizeImage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RecognizeImage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "content": obj.get("content"), + "contentType": obj.get("contentType"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt"), + "path": obj.get("path"), + "url": obj.get("url"), + "metadata": obj.get("metadata"), + "similarity": obj.get("similarity"), + "distance": obj.get("distance") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/recognize_image_data.py b/regula/facesdk/webclient/gen/models/recognize_image_data.py new file mode 100644 index 0000000..65a0967 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/recognize_image_data.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class RecognizeImageData(BaseModel): + """ + RecognizeImageData + """ # noqa: E501 + similarity: SkipValidation[Optional[float]] = Field(alias="similarity", default=None, description="Similarity score.") + distance: SkipValidation[Optional[float]] = Field(alias="distance", default=None, description="Similarity distance score: the lower the distance, the higher the face's similarity.") + __properties: ClassVar[List[str]] = ["similarity", "distance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RecognizeImageData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RecognizeImageData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "similarity": obj.get("similarity"), + "distance": obj.get("distance") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/resize_options.py b/regula/facesdk/webclient/gen/models/resize_options.py new file mode 100644 index 0000000..ae7940e --- /dev/null +++ b/regula/facesdk/webclient/gen/models/resize_options.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class ResizeOptions(BaseModel): + """ + Set to resize the original image. + """ # noqa: E501 + width: SkipValidation[Optional[int]] = Field(alias="width", default=None, description="Resized image width, px.") + height: SkipValidation[Optional[int]] = Field(alias="height", default=None, description="Resized image height, px.") + quality: SkipValidation[Optional[int]] = Field(alias="quality", default=None, description="Resized image quality, percent.") + __properties: ClassVar[List[str]] = ["width", "height", "quality"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResizeOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResizeOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "width": obj.get("width"), + "height": obj.get("height"), + "quality": obj.get("quality") if obj.get("quality") is not None else 100 + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/search_bad_params.py b/regula/facesdk/webclient/gen/models/search_bad_params.py new file mode 100644 index 0000000..bf98d08 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/search_bad_params.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class SearchBadParams(BaseModel): + """ + SearchBadParams + """ # noqa: E501 + msg: SkipValidation[Optional[str]] = Field(alias="msg", default=None) + status_code: SkipValidation[Optional[int]] = Field(alias="statusCode", default=None) + type: SkipValidation[Optional[str]] = Field(alias="type", default=None) + __properties: ClassVar[List[str]] = ["msg", "statusCode", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchBadParams from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchBadParams from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "msg": obj.get("msg") if obj.get("msg") is not None else 'Descriptor already calculated', + "statusCode": obj.get("statusCode") if obj.get("statusCode") is not None else 400, + "type": obj.get("type") if obj.get("type") is not None else 'BadParamsException' + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/search_detection.py b/regula/facesdk/webclient/gen/models/search_detection.py new file mode 100644 index 0000000..b1d525b --- /dev/null +++ b/regula/facesdk/webclient/gen/models/search_detection.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class SearchDetection(BaseModel): + """ + The array of identified persons. + """ # noqa: E501 + code: SkipValidation[Optional[int]] = Field(alias="code", default=None, description="Internal.") + crop: SkipValidation[Optional[str]] = Field(alias="crop", default=None, description="Base64 of the aligned and cropped portrait.") + detector_type: SkipValidation[Optional[int]] = Field(alias="detectorType", default=None, description="Internal.") + hash: SkipValidation[Optional[str]] = Field(alias="hash", default=None, description="Internal.") + idx: SkipValidation[Optional[int]] = Field(alias="idx", default=None, description="Internal.") + image: SkipValidation[Optional[str]] = Field(alias="image", default=None, description="Internal.") + landmarks: SkipValidation[Optional[List[List[int]]]] = Field(alias="landmarks", default=None, description="Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips.") + landmarks_type: SkipValidation[Optional[int]] = Field(alias="landmarksType", default=None, description="Internal.") + msg: SkipValidation[Optional[str]] = Field(alias="msg", default=None, description="Internal.") + roi: SkipValidation[Optional[List[float]]] = Field(alias="roi", default=None, description="The rectangular area of a detected face that is represented by a set of four elements: the X and Y coordinates of the top-left point, and the width and height dimensions of the rectangle.") + version_sdk: SkipValidation[Optional[str]] = Field(alias="versionSDK", default=None) + __properties: ClassVar[List[str]] = ["code", "crop", "detectorType", "hash", "idx", "image", "landmarks", "landmarksType", "msg", "roi", "versionSDK"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchDetection from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchDetection from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "crop": obj.get("crop"), + "detectorType": obj.get("detectorType"), + "hash": obj.get("hash"), + "idx": obj.get("idx"), + "image": obj.get("image"), + "landmarks": obj.get("landmarks"), + "landmarksType": obj.get("landmarksType"), + "msg": obj.get("msg"), + "roi": obj.get("roi"), + "versionSDK": obj.get("versionSDK") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/search_parameters.py b/regula/facesdk/webclient/gen/models/search_parameters.py new file mode 100644 index 0000000..7fe584f --- /dev/null +++ b/regula/facesdk/webclient/gen/models/search_parameters.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from regula.facesdk.webclient.gen.models.filter_search_request import FilterSearchRequest +from regula.facesdk.webclient.gen.models.search_parameters_create_person import SearchParametersCreatePerson +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class SearchParameters(BaseModel): + """ + Request search data. + """ # noqa: E501 + create_person: SkipValidation[Optional[SearchParametersCreatePerson]] = Field(alias="createPerson", default=None) + group_ids: SkipValidation[Optional[List[str]]] = Field(alias="groupIds", default=None, description="IDs of the groups in which the search is performed.") + filter: SkipValidation[Optional[FilterSearchRequest]] = Field(alias="filter", default=None) + __properties: ClassVar[List[str]] = ["createPerson", "groupIds", "filter"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchParameters from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of create_person + if self.create_person: + _dict['createPerson'] = self.create_person.to_dict() + # override the default output from pydantic by calling `to_dict()` of filter + if self.filter: + _dict['filter'] = self.filter.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchParameters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "createPerson": SearchParametersCreatePerson.from_dict(obj["createPerson"]) if obj.get("createPerson") is not None else None, + "groupIds": obj.get("groupIds"), + "filter": FilterSearchRequest.from_dict(obj["filter"]) if obj.get("filter") is not None else None + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/search_parameters_create_person.py b/regula/facesdk/webclient/gen/models/search_parameters_create_person.py new file mode 100644 index 0000000..c7ac14c --- /dev/null +++ b/regula/facesdk/webclient/gen/models/search_parameters_create_person.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class SearchParametersCreatePerson(BaseModel): + """ + If a person is not found, a new person entry is created using the descriptor calculated while searching. + """ # noqa: E501 + name: SkipValidation[Optional[str]] = Field(alias="name", default=None, description="Person's name.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + ttl: SkipValidation[Optional[int]] = Field(alias="ttl", default=None, description="The lifespan of the Person's records, seconds. Optional.") + __properties: ClassVar[List[str]] = ["name", "metadata", "ttl"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchParametersCreatePerson from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchParametersCreatePerson from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "metadata": obj.get("metadata"), + "ttl": obj.get("ttl") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/search_person.py b/regula/facesdk/webclient/gen/models/search_person.py new file mode 100644 index 0000000..d61c9b4 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/search_person.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from regula.facesdk.webclient.gen.models.recognize_image import RecognizeImage +from regula.facesdk.webclient.gen.models.search_detection import SearchDetection +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class SearchPerson(BaseModel): + """ + SearchPerson + """ # noqa: E501 + name: SkipValidation[str] = Field(alias="name", description="Person's name.") + external_id: SkipValidation[Optional[str]] = Field(alias="externalId", default=None, description="Person's ID, used for linking search results to an ID in an external system. Can be set when creating a Person, stored in the database, and included in the search to return only Persons with the specified ID. Optional.") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + groups: SkipValidation[Optional[List[str]]] = Field(alias="groups", default=None, description="Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it.") + expire_at: SkipValidation[Optional[str]] = Field(alias="expireAt", default=None, description="Person expiration date.") + id: SkipValidation[Optional[str]] = Field(alias="id", default=None, description="Person ID. The list of persons is sorted by decreasing ID value.") + created_at: SkipValidation[Optional[str]] = Field(alias="createdAt", default=None, description="Person creation date.") + updated_at: SkipValidation[Optional[str]] = Field(alias="updatedAt", default=None, description="Person update date.") + detection: SkipValidation[Optional[SearchDetection]] = Field(alias="detection", default=None) + images: SkipValidation[Optional[List[RecognizeImage]]] = Field(alias="images", default=None, description="Array of Person images.") + __properties: ClassVar[List[str]] = ["name", "externalId", "metadata", "groups", "expireAt", "id", "createdAt", "updatedAt", "detection", "images"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchPerson from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of detection + if self.detection: + _dict['detection'] = self.detection.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in images (list) + _items = [] + if self.images: + for _item_images in self.images: + if _item_images: + _items.append(_item_images.to_dict()) + _dict['images'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchPerson from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "externalId": obj.get("externalId"), + "metadata": obj.get("metadata"), + "groups": obj.get("groups"), + "expireAt": obj.get("expireAt"), + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt"), + "detection": SearchDetection.from_dict(obj["detection"]) if obj.get("detection") is not None else None, + "images": [RecognizeImage.from_dict(_item) for _item in obj.get("images", []) if RecognizeImage.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/search_person_data.py b/regula/facesdk/webclient/gen/models/search_person_data.py new file mode 100644 index 0000000..5be408a --- /dev/null +++ b/regula/facesdk/webclient/gen/models/search_person_data.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.recognize_image import RecognizeImage +from regula.facesdk.webclient.gen.models.search_detection import SearchDetection +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class SearchPersonData(BaseModel): + """ + SearchPersonData + """ # noqa: E501 + detection: SkipValidation[Optional[SearchDetection]] = Field(alias="detection", default=None) + images: SkipValidation[Optional[List[RecognizeImage]]] = Field(alias="images", default=None, description="Array of Person images.") + __properties: ClassVar[List[str]] = ["detection", "images"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchPersonData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of detection + if self.detection: + _dict['detection'] = self.detection.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in images (list) + _items = [] + if self.images: + for _item_images in self.images: + if _item_images: + _items.append(_item_images.to_dict()) + _dict['images'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchPersonData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "detection": SearchDetection.from_dict(obj["detection"]) if obj.get("detection") is not None else None, + "images": [RecognizeImage.from_dict(_item) for _item in obj.get("images", []) if RecognizeImage.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/search_request.py b/regula/facesdk/webclient/gen/models/search_request.py new file mode 100644 index 0000000..2b1a6ab --- /dev/null +++ b/regula/facesdk/webclient/gen/models/search_request.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from uuid import UUID +from regula.facesdk.webclient.gen.models.filter_search_request import FilterSearchRequest +from regula.facesdk.webclient.gen.models.image_fields_image import ImageFieldsImage +from regula.facesdk.webclient.gen.models.output_image_params import OutputImageParams +from regula.facesdk.webclient.gen.models.search_parameters_create_person import SearchParametersCreatePerson +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class SearchRequest(BaseModel): + """ + SearchRequest + """ # noqa: E501 + tenant: SkipValidation[Optional[str]] = Field(alias="tenant", default=None, description="A label used to group transactions by customers, applications, or other criteria.") + env: SkipValidation[Optional[str]] = Field(alias="env", default=None, description="A label used to differentiate transactions by development stages.") + create_person: SkipValidation[Optional[SearchParametersCreatePerson]] = Field(alias="createPerson", default=None) + group_ids: SkipValidation[Optional[List[str]]] = Field(alias="groupIds", default=None, description="IDs of the groups in which the search is performed.") + filter: SkipValidation[Optional[FilterSearchRequest]] = Field(alias="filter", default=None) + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.") + image: SkipValidation[Optional[ImageFieldsImage]] = Field(alias="image", default=None) + output_image_params: SkipValidation[Optional[OutputImageParams]] = Field(alias="outputImageParams", default=None) + detect_all: SkipValidation[Optional[bool]] = Field(alias="detectAll", default=None, description="Whether to detect all faces in the image. If set to `false`, only the most central face is detected.") + threshold: SkipValidation[Optional[float]] = Field(alias="threshold", default=None, description="The similarity threshold.") + limit: SkipValidation[Optional[int]] = Field(alias="limit", default=None, description="The maximum number of results to be returned.") + __properties: ClassVar[List[str]] = ["tenant", "env", "createPerson", "groupIds", "filter", "tag", "image", "outputImageParams", "detectAll", "threshold", "limit"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of create_person + if self.create_person: + _dict['createPerson'] = self.create_person.to_dict() + # override the default output from pydantic by calling `to_dict()` of filter + if self.filter: + _dict['filter'] = self.filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of image + if self.image: + _dict['image'] = self.image.to_dict() + # override the default output from pydantic by calling `to_dict()` of output_image_params + if self.output_image_params: + _dict['outputImageParams'] = self.output_image_params.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenant": obj.get("tenant"), + "env": obj.get("env"), + "createPerson": SearchParametersCreatePerson.from_dict(obj["createPerson"]) if obj.get("createPerson") is not None else None, + "groupIds": obj.get("groupIds"), + "filter": FilterSearchRequest.from_dict(obj["filter"]) if obj.get("filter") is not None else None, + "tag": obj.get("tag"), + "image": ImageFieldsImage.from_dict(obj["image"]) if obj.get("image") is not None else None, + "outputImageParams": OutputImageParams.from_dict(obj["outputImageParams"]) if obj.get("outputImageParams") is not None else None, + "detectAll": obj.get("detectAll") if obj.get("detectAll") is not None else False, + "threshold": obj.get("threshold"), + "limit": obj.get("limit") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/search_result.py b/regula/facesdk/webclient/gen/models/search_result.py new file mode 100644 index 0000000..b621957 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/search_result.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.search_person import SearchPerson +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class SearchResult(BaseModel): + """ + SearchResult + """ # noqa: E501 + code: SkipValidation[Optional[int]] = Field(alias="code", default=None, description="Result code. It is returned only with response 200.") + persons: SkipValidation[Optional[List[SearchPerson]]] = Field(alias="persons", default=None, description="Array of Person images. It is returned only with response 200.") + __properties: ClassVar[List[str]] = ["code", "persons"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in persons (list) + _items = [] + if self.persons: + for _item_persons in self.persons: + if _item_persons: + _items.append(_item_persons.to_dict()) + _dict['persons'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "persons": [SearchPerson.from_dict(_item) for _item in obj.get("persons", []) if SearchPerson.from_dict(_item) is not None] + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/transaction_info.py b/regula/facesdk/webclient/gen/models/transaction_info.py new file mode 100644 index 0000000..f19ba6b --- /dev/null +++ b/regula/facesdk/webclient/gen/models/transaction_info.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from regula.facesdk.webclient.gen.models.liveness_type import LivenessType +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class TransactionInfo(BaseModel): + """ + TransactionInfo + """ # noqa: E501 + code: SkipValidation[Optional[int]] = Field(alias="code", default=None, description="Result code, see the [FaceSDKResultCode enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-sdk-result-code/).") + status: SkipValidation[Optional[int]] = Field(alias="status", default=None, description="Whether the liveness detection is confirmed `0` or not `1`.") + tag: SkipValidation[Optional[str]] = Field(alias="tag", default=None, description="Session identificator, should be unique for each session.") + transaction_id: SkipValidation[Optional[str]] = Field(alias="transactionId", default=None, description="Transaction ID, there can be several transactions within one session.") + video: SkipValidation[Optional[str]] = Field(alias="video", default=None, description="Link to the session video, depends on the selected storage type. [Learn more](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/storage/)") + age: SkipValidation[Optional[List[Dict[str, object]]]] = Field(alias="age", default=None, description="Approximate age with an accuracy of +/-3 years.") + portrait: SkipValidation[Optional[str]] = Field(alias="portrait", default=None, description="Link to the portrait, depends on the selected storage type. [Learn more](https://docs.regulaforensics.com/develop/face-sdk/web-service/administration/storage/)") + metadata: SkipValidation[Optional[Dict[str, object]]] = Field(alias="metadata", default=None, description="A free-form object containing person's extended attributes.") + type: SkipValidation[Optional[LivenessType]] = Field(alias="type", default=None) + __properties: ClassVar[List[str]] = ["code", "status", "tag", "transactionId", "video", "age", "portrait", "metadata", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TransactionInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TransactionInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "status": obj.get("status"), + "tag": obj.get("tag"), + "transactionId": obj.get("transactionId"), + "video": obj.get("video"), + "age": obj.get("age"), + "portrait": obj.get("portrait"), + "metadata": obj.get("metadata"), + "type": obj.get("type") if obj.get("type") is not None else LivenessType.NUMBER_ACTIVE + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/transaction_labels.py b/regula/facesdk/webclient/gen/models/transaction_labels.py new file mode 100644 index 0000000..9be0ef2 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/transaction_labels.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class TransactionLabels(BaseModel): + """ + TransactionLabels + """ # noqa: E501 + tenant: SkipValidation[Optional[str]] = Field(alias="tenant", default=None, description="A label used to group transactions by customers, applications, or other criteria.") + env: SkipValidation[Optional[str]] = Field(alias="env", default=None, description="A label used to differentiate transactions by development stages.") + __properties: ClassVar[List[str]] = ["tenant", "env"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TransactionLabels from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TransactionLabels from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenant": obj.get("tenant"), + "env": obj.get("env") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/models/update_group.py b/regula/facesdk/webclient/gen/models/update_group.py new file mode 100644 index 0000000..fbdac69 --- /dev/null +++ b/regula/facesdk/webclient/gen/models/update_group.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Generated by: https://openapi-generator.tech +""" + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self +from pydantic import SkipValidation, Field + +class UpdateGroup(BaseModel): + """ + Update group. + """ # noqa: E501 + add_items: SkipValidation[Optional[List[str]]] = Field(alias="addItems", default=None, description="Add items.") + remove_items: SkipValidation[Optional[List[str]]] = Field(alias="removeItems", default=None, description="Remove items.") + __properties: ClassVar[List[str]] = ["addItems", "removeItems"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + use_enum_values=True + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "addItems": obj.get("addItems"), + "removeItems": obj.get("removeItems") + }) + return _obj + + diff --git a/regula/facesdk/webclient/gen/py.typed b/regula/facesdk/webclient/gen/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/regula/facesdk/webclient/gen/rest.py b/regula/facesdk/webclient/gen/rest.py index 6571ea1..fbe6935 100644 --- a/regula/facesdk/webclient/gen/rest.py +++ b/regula/facesdk/webclient/gen/rest.py @@ -1,54 +1,60 @@ -""" - Regula Face SDK Web API - - Regula Face SDK is a cross-platform biometric verification solution for a digital identity verification process and image quality assurance. The SDK enables convenient and reliable face capture on the client side (mobile, web, and desktop) and further processing on the client or server side. The Face SDK includes the following features: * Face detection and image quality assessment * Face match (1:1) * Face search (1:N) * Liveness detection Here is the OpenAPI specification on GitHub. ### Clients * [JavaScript](https://github.com/regulaforensics/FaceSDK-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core # noqa: E501 +# coding: utf-8 - The version of the OpenAPI document: 7.2.0 +""" Generated by: https://openapi-generator.tech """ - import io import json -import logging import re import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment + import urllib3 -import ipaddress -from regula.facesdk.webclient.gen.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from regula.facesdk.webclient.gen.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -57,70 +63,80 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager - if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -132,60 +148,83 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', headers['Content-Type'], re.IGNORECASE)): + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -196,151 +235,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None , '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ',''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) + return RESTResponse(r) diff --git a/setup.py b/setup.py index 3618512..3605e32 100644 --- a/setup.py +++ b/setup.py @@ -20,11 +20,14 @@ install_requires=[ "certifi>=2024.07.04", "six>=1.10", - "python-dateutil>=2.5.3", - "urllib3>=2.2.2", + "python-dateutil>=2.8.2", + "urllib3>=1.25.3, <3.0.0", "vistir>=0.4.0, <=0.6.1", "idna==3.7", "requests>=2.32.3", + "pydantic>=2", + "typing-extensions>=4.7.1", + "lazy-imports==1.0.1", ], packages=find_packages(exclude=["test", "tests", "example"]), include_package_data=True, diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..3afcfc9 --- /dev/null +++ b/setup.sh @@ -0,0 +1,9 @@ +python3 -m venv venv + +source venv/bin/activate + +pip install -e ./ + +cd example || exit + +python3 example.py diff --git a/update-models.sh b/update-models.sh index 64471c3..1f02982 100755 --- a/update-models.sh +++ b/update-models.sh @@ -1,6 +1,19 @@ #!/bin/sh -docker run --rm --user "$(id -u):$(id -g)" -v "${PWD}:/client" -v "${PWD}/../FaceSDK-web-openapi:/definitions" \ -openapitools/openapi-generator-cli:v5.4.0 generate -g python \ --i /definitions/index.yml -o /client -c /client/generator-config.json \ --t /client/generator-templates +MODE="$1" +FACE_DEFINITION_FOLDER="${PWD}/../FaceSDK-web-openapi" +TEMPLATE_PATH="/client/generator-templates/lenient" + +if [ "$MODE" = "strict" ]; then + TEMPLATE_PATH="/client/generator-templates/strict" +fi + +docker run --user "$(id -u):$(id -g)" --rm \ +-v "${PWD}:/client" \ +-v "$FACE_DEFINITION_FOLDER:/definitions" \ +openapitools/openapi-generator-cli:v7.15.0 generate \ +-g python \ +-i /definitions/index.yml \ +-o /client \ +-t $TEMPLATE_PATH \ +-c /client/generator-config.json || exit 1 From 080bbffb2c7e7bd6ea94e48fdeed9524fb9692cc Mon Sep 17 00:00:00 2001 From: Artsiom Tsybulko Date: Fri, 26 Sep 2025 15:54:21 +0300 Subject: [PATCH 2/2] 41044 - fix samples --- example/example_identification_module.py | 31 ++++++++++--------- .../webclient/ext/models/detect_request.py | 9 +++--- .../webclient/ext/models/match_image.py | 4 +-- .../webclient/ext/models/match_request.py | 12 ++++--- 4 files changed, 31 insertions(+), 25 deletions(-) diff --git a/example/example_identification_module.py b/example/example_identification_module.py index 4f98950..3e285f4 100644 --- a/example/example_identification_module.py +++ b/example/example_identification_module.py @@ -2,14 +2,15 @@ import os from regula.facesdk.webclient.ext import FaceSdk -from regula.facesdk.webclient.gen.model.image_fields_image import ImageFieldsImage -from regula.facesdk.webclient.gen.model.image_source import ImageSource -from regula.facesdk.webclient.gen.model.match_and_search_request_all_of_images import MatchAndSearchRequestAllOfImages -from regula.facesdk.webclient.gen.model.person_fields import PersonFields -from regula.facesdk.webclient.gen.model.search_request import SearchRequest -from regula.facesdk.webclient.gen.model.update_group import UpdateGroup +from regula.facesdk.webclient.gen.models.image_fields_image import ImageFieldsImage +from regula.facesdk.webclient.gen.models.image_source import ImageSource +from regula.facesdk.webclient.gen.models.match_and_search_request_images_item import MatchAndSearchRequestImagesItem +from regula.facesdk.webclient.gen.models.person_fields import PersonFields +from regula.facesdk.webclient.gen.models.search_request import SearchRequest +from regula.facesdk.webclient.gen.models.update_group import UpdateGroup +from regula.facesdk.webclient.gen.models.match_and_search_request import MatchAndSearchRequest -api_base_path = os.getenv("API_BASE_PATH", "http://127.0.0.1:41101") +api_base_path = os.getenv("API_BASE_PATH", "http://nightly-faceapi.regula.local") with open("face1.jpg", "rb") as f: face_1_bytes = f.read() @@ -28,15 +29,15 @@ person1 = sdk.person_api.get_person(person1_id) person2 = sdk.person_api.get_person(person2_id) -group = sdk.group_api.create_group("group1") +group = sdk.group_api.create_group("group13233") -sdk.group_api.update_persons_in_group(group.id, UpdateGroup([person1.id, person2.id])) +sdk.group_api.update_persons_in_group(group.id, UpdateGroup(addItems=[person1.id, person2.id])) result = sdk.search_api.search( SearchRequest( - group_ids=[], + groupIds=[], image=ImageFieldsImage( - content_type="", + contentType="", content=face_1_bytes ), limit=10, @@ -50,9 +51,11 @@ print(result) match_and_search = sdk.match_api.match_and_search( - images=[MatchAndSearchRequestAllOfImages(base64.b64encode(face_1_bytes).decode("UTF-8"), ImageSource.LIVE), - MatchAndSearchRequestAllOfImages(base64.b64encode(face_2_bytes).decode("UTF-8"), ImageSource.LIVE)], - group_ids=[group.id] + MatchAndSearchRequest( + images=[MatchAndSearchRequestImagesItem(content=base64.b64encode(face_1_bytes).decode("UTF-8"), type=ImageSource.LIVE), + MatchAndSearchRequestImagesItem(content=base64.b64encode(face_2_bytes).decode("UTF-8"), type=ImageSource.LIVE)], + groupIds=[group.id] + ), ) print(f"{match_and_search}") diff --git a/regula/facesdk/webclient/ext/models/detect_request.py b/regula/facesdk/webclient/ext/models/detect_request.py index 430041c..b389e9c 100755 --- a/regula/facesdk/webclient/ext/models/detect_request.py +++ b/regula/facesdk/webclient/ext/models/detect_request.py @@ -11,9 +11,9 @@ def __init__( self, image: Union[Base64String, bytes], process_param: ProcessParam = None, - local_vars_configuration=None, tag=None, - + env=None, + tenant=None ): if not image: raise ApiValueError(f"image: expected - obtained <{image}>", "image") @@ -23,7 +23,8 @@ def __init__( super().__init__( image=image, - local_vars_configuration=local_vars_configuration, tag=tag, - process_param=process_param + process_param=process_param, + env=env, + tenant=tenant ) diff --git a/regula/facesdk/webclient/ext/models/match_image.py b/regula/facesdk/webclient/ext/models/match_image.py index 6fe9101..f3c2423 100755 --- a/regula/facesdk/webclient/ext/models/match_image.py +++ b/regula/facesdk/webclient/ext/models/match_image.py @@ -7,7 +7,7 @@ class MatchImage(GenMatchImage): - def __init__(self, index=None, type=None, data: Union[Base64String, bytes] = None, local_vars_configuration=None): + def __init__(self, index=None, type=None, data: Union[Base64String, bytes] = None, detect_all=None): if not data: raise ApiValueError(f"compare image {index} data: expected ") @@ -16,4 +16,4 @@ def __init__(self, index=None, type=None, data: Union[Base64String, bytes] = Non if isinstance(data, bytes): data = bytes_to_base64(data) - super().__init__(index=index, type=type, data=data, local_vars_configuration) + super().__init__(index=index, type=type, data=data, detectAll=detect_all) diff --git a/regula/facesdk/webclient/ext/models/match_request.py b/regula/facesdk/webclient/ext/models/match_request.py index bcdb099..77c853a 100755 --- a/regula/facesdk/webclient/ext/models/match_request.py +++ b/regula/facesdk/webclient/ext/models/match_request.py @@ -10,9 +10,10 @@ class MatchRequest(GenMatchRequest): def __init__( self, images: List[Union[MatchImage, Base64String, bytes]], - local_vars_configuration=None, output_image_params=None, - tag=None + tag=None, + env=None, + tenant=None ): if not images: raise ApiValueError(f"compare request images: expected size ") @@ -22,11 +23,12 @@ def __init__( if isinstance(item, MatchImage): input_images.append(item) else: - input_images.append(MatchImage(index, None, item, local_vars_configuration)) + input_images.append(MatchImage(index, None, item)) super().__init__( images=input_images, - local_vars_configuration=local_vars_configuration, output_image_params=output_image_params, - tag=tag + tag=tag, + env=env, + tenant=tenant )