onfido 2.9.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -4
- data/Gemfile +5 -4
- data/LICENSE +5 -7
- data/README.md +69 -51
- data/Rakefile +10 -0
- data/lib/onfido/api/default_api.rb +4233 -0
- data/lib/onfido/api_client.rb +431 -0
- data/lib/onfido/api_error.rb +58 -0
- data/lib/onfido/configuration.rb +420 -0
- data/lib/onfido/models/address.rb +422 -0
- data/lib/onfido/models/address_builder.rb +422 -0
- data/lib/onfido/models/address_shared.rb +415 -0
- data/lib/onfido/models/addresses_list.rb +216 -0
- data/lib/onfido/models/applicant.rb +390 -0
- data/lib/onfido/models/applicant_builder.rb +358 -0
- data/lib/onfido/models/applicant_create.rb +281 -0
- data/lib/onfido/models/applicant_request.rb +232 -0
- data/lib/onfido/models/applicant_response.rb +341 -0
- data/lib/onfido/models/applicant_shared.rb +246 -0
- data/lib/onfido/models/applicant_update.rb +267 -0
- data/lib/onfido/models/applicant_updater.rb +344 -0
- data/lib/onfido/models/applicants_list.rb +223 -0
- data/lib/onfido/models/check.rb +419 -0
- data/lib/onfido/models/check_builder.rb +360 -0
- data/lib/onfido/models/check_request.rb +301 -0
- data/lib/onfido/models/check_response.rb +350 -0
- data/lib/onfido/models/check_shared.rb +266 -0
- data/lib/onfido/models/checks_list.rb +223 -0
- data/lib/onfido/models/complete_task_builder.rb +221 -0
- data/lib/onfido/models/complete_task_data_builder.rb +106 -0
- data/lib/onfido/models/consent_item.rb +272 -0
- data/lib/onfido/models/consents_builder.rb +205 -0
- data/lib/onfido/models/country_codes.rb +289 -0
- data/lib/onfido/models/device_intelligence_breakdown.rb +223 -0
- data/lib/onfido/models/device_intelligence_breakdown_breakdown.rb +214 -0
- data/lib/onfido/models/device_intelligence_breakdown_breakdown_device.rb +215 -0
- data/lib/onfido/models/device_intelligence_breakdown_breakdown_device_breakdown.rb +232 -0
- data/lib/onfido/models/device_intelligence_breakdown_properties.rb +232 -0
- data/lib/onfido/models/device_intelligence_breakdown_properties_device.rb +468 -0
- data/lib/onfido/models/device_intelligence_breakdown_properties_geolocation.rb +257 -0
- data/lib/onfido/models/device_intelligence_breakdown_properties_ip.rb +245 -0
- data/lib/onfido/models/device_intelligence_report.rb +345 -0
- data/lib/onfido/models/document.rb +376 -0
- data/lib/onfido/models/document_breakdown.rb +286 -0
- data/lib/onfido/models/document_breakdown_age_validation.rb +224 -0
- data/lib/onfido/models/document_breakdown_age_validation_breakdown.rb +214 -0
- data/lib/onfido/models/document_breakdown_compromised_document.rb +224 -0
- data/lib/onfido/models/document_breakdown_compromised_document_breakdown.rb +223 -0
- data/lib/onfido/models/document_breakdown_data_comparison.rb +224 -0
- data/lib/onfido/models/document_breakdown_data_comparison_breakdown.rb +277 -0
- data/lib/onfido/models/document_breakdown_data_comparison_breakdown_issuing_country.rb +223 -0
- data/lib/onfido/models/document_breakdown_data_consistency.rb +224 -0
- data/lib/onfido/models/document_breakdown_data_consistency_breakdown.rb +295 -0
- data/lib/onfido/models/document_breakdown_data_validation.rb +224 -0
- data/lib/onfido/models/document_breakdown_data_validation_breakdown.rb +268 -0
- data/lib/onfido/models/document_breakdown_data_validation_breakdown_document_expiration.rb +224 -0
- data/lib/onfido/models/document_breakdown_data_validation_breakdown_expiry_date.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown.rb +241 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown_colour_picture.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown_conclusive_document_quality.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown_image_quality.rb +224 -0
- data/lib/onfido/models/document_breakdown_image_integrity_breakdown_supported_document.rb +224 -0
- data/lib/onfido/models/document_breakdown_issuing_authority.rb +224 -0
- data/lib/onfido/models/document_breakdown_issuing_authority_breakdown.rb +223 -0
- data/lib/onfido/models/document_breakdown_issuing_authority_breakdown_nfc_active_authentication.rb +224 -0
- data/lib/onfido/models/document_breakdown_issuing_authority_breakdown_nfc_passive_authentication.rb +224 -0
- data/lib/onfido/models/document_breakdown_police_record.rb +215 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown.rb +277 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_digital_tampering.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_face_detection.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_fonts.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_original_document_present.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_other.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_picture_face_integrity.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_security_features.rb +224 -0
- data/lib/onfido/models/document_breakdown_visual_authenticity_breakdown_template.rb +224 -0
- data/lib/onfido/models/document_cdq_reasons.rb +285 -0
- data/lib/onfido/models/document_iq_reasons.rb +305 -0
- data/lib/onfido/models/document_odp_reasons.rb +245 -0
- data/lib/onfido/models/document_properties.rb +663 -0
- data/lib/onfido/models/document_properties_address_lines.rb +259 -0
- data/lib/onfido/models/document_properties_barcode_inner.rb +367 -0
- data/lib/onfido/models/document_properties_document_classification.rb +232 -0
- data/lib/onfido/models/document_properties_document_numbers_inner.rb +223 -0
- data/lib/onfido/models/document_properties_driving_licence_information.rb +241 -0
- data/lib/onfido/models/document_properties_extracted_data.rb +394 -0
- data/lib/onfido/models/document_properties_nfc.rb +322 -0
- data/lib/onfido/models/document_report.rb +354 -0
- data/lib/onfido/models/document_response.rb +272 -0
- data/lib/onfido/models/document_shared.rb +301 -0
- data/lib/onfido/models/document_types.rb +64 -0
- data/lib/onfido/models/document_video_report.rb +354 -0
- data/lib/onfido/models/document_video_with_address_information_report.rb +354 -0
- data/lib/onfido/models/document_with_address_information_report.rb +354 -0
- data/lib/onfido/models/document_with_driver_verification_report.rb +354 -0
- data/lib/onfido/models/document_with_driver_verification_report_all_of_properties.rb +731 -0
- data/lib/onfido/models/document_with_driver_verification_report_all_of_properties_all_of_passenger_vehicle.rb +236 -0
- data/lib/onfido/models/document_with_driver_verification_report_all_of_properties_all_of_vehicle_class_details_inner.rb +245 -0
- data/lib/onfido/models/document_with_driving_licence_information_report.rb +354 -0
- data/lib/onfido/models/documents_list.rb +223 -0
- data/lib/onfido/models/error.rb +214 -0
- data/lib/onfido/models/error1.rb +224 -0
- data/lib/onfido/models/error_properties.rb +234 -0
- data/lib/onfido/models/error_properties1.rb +223 -0
- data/lib/onfido/models/extract_request.rb +222 -0
- data/lib/onfido/models/extraction.rb +233 -0
- data/lib/onfido/models/extraction_document_classification.rb +289 -0
- data/lib/onfido/models/extraction_extracted_data.rb +530 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown.rb +232 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_face_comparison.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_face_detected.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_image_integrity_breakdown_source_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_motion_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +224 -0
- data/lib/onfido/models/facial_similarity_motion_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_motion_report.rb +354 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown.rb +232 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown.rb +214 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_face_comparison_breakdown_face_match_properties.rb +225 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_face_detected.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_image_integrity_breakdown_source_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown.rb +214 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_breakdown_visual_authenticity_breakdown_spoofing_detection_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown.rb +232 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_breakdown_image_integrity_breakdown_source_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_photo_fully_auto_report.rb +354 -0
- data/lib/onfido/models/facial_similarity_photo_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_photo_report.rb +354 -0
- data/lib/onfido/models/facial_similarity_video_breakdown.rb +232 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_face_comparison.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_face_detected.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_image_integrity_breakdown_source_integrity.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown.rb +223 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_liveness_detected.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_breakdown_visual_authenticity_breakdown_spoofing_detection.rb +224 -0
- data/lib/onfido/models/facial_similarity_video_properties.rb +215 -0
- data/lib/onfido/models/facial_similarity_video_report.rb +354 -0
- data/lib/onfido/models/id_number.rb +269 -0
- data/lib/onfido/models/id_photo.rb +289 -0
- data/lib/onfido/models/id_photo_response.rb +282 -0
- data/lib/onfido/models/id_photos_list.rb +223 -0
- data/lib/onfido/models/identity_enhanced_breakdown.rb +241 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown.rb +232 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_credit_agencies_properties.rb +214 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_telephone_database.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_address_breakdown_voting_register.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown.rb +223 -0
- data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_credit_agencies.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_date_of_birth_breakdown_voting_register.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_mortality.rb +215 -0
- data/lib/onfido/models/identity_enhanced_breakdown_sources.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown.rb +214 -0
- data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources.rb +224 -0
- data/lib/onfido/models/identity_enhanced_breakdown_sources_breakdown_total_sources_properties.rb +214 -0
- data/lib/onfido/models/identity_enhanced_properties.rb +227 -0
- data/lib/onfido/models/identity_enhanced_properties_matched_addresses_inner.rb +227 -0
- data/lib/onfido/models/identity_enhanced_report.rb +354 -0
- data/lib/onfido/models/india_pan_report.rb +354 -0
- data/lib/onfido/models/india_pan_report_all_of_breakdown.rb +214 -0
- data/lib/onfido/models/india_pan_report_all_of_breakdown_device.rb +214 -0
- data/lib/onfido/models/india_pan_report_all_of_breakdown_device_breakdown.rb +223 -0
- data/lib/onfido/models/india_pan_report_all_of_breakdown_device_breakdown_pan_valid.rb +214 -0
- data/lib/onfido/models/india_pan_report_all_of_properties.rb +214 -0
- data/lib/onfido/models/india_pan_report_all_of_properties_device.rb +225 -0
- data/lib/onfido/models/known_faces_breakdown.rb +223 -0
- data/lib/onfido/models/known_faces_breakdown_image_integrity.rb +215 -0
- data/lib/onfido/models/known_faces_breakdown_previously_seen_faces.rb +215 -0
- data/lib/onfido/models/known_faces_properties.rb +217 -0
- data/lib/onfido/models/known_faces_properties_matches_inner.rb +255 -0
- data/lib/onfido/models/known_faces_report.rb +354 -0
- data/lib/onfido/models/live_photo.rb +289 -0
- data/lib/onfido/models/live_photo_response.rb +282 -0
- data/lib/onfido/models/live_photos_list.rb +223 -0
- data/lib/onfido/models/live_video.rb +287 -0
- data/lib/onfido/models/live_videos_list.rb +223 -0
- data/lib/onfido/models/location.rb +254 -0
- data/lib/onfido/models/location_builder.rb +254 -0
- data/lib/onfido/models/location_shared.rb +247 -0
- data/lib/onfido/models/motion_capture.rb +275 -0
- data/lib/onfido/models/motion_captures_list.rb +223 -0
- data/lib/onfido/models/photo_auto_reasons.rb +255 -0
- data/lib/onfido/models/photo_reasons.rb +255 -0
- data/lib/onfido/models/proof_of_address_breakdown.rb +232 -0
- data/lib/onfido/models/proof_of_address_breakdown_data_comparison.rb +224 -0
- data/lib/onfido/models/proof_of_address_breakdown_data_comparison_breakdown.rb +232 -0
- data/lib/onfido/models/proof_of_address_breakdown_document_classification.rb +224 -0
- data/lib/onfido/models/proof_of_address_breakdown_document_classification_breakdown.rb +214 -0
- data/lib/onfido/models/proof_of_address_breakdown_image_integrity.rb +224 -0
- data/lib/onfido/models/proof_of_address_breakdown_image_integrity_breakdown.rb +214 -0
- data/lib/onfido/models/proof_of_address_properties.rb +319 -0
- data/lib/onfido/models/proof_of_address_report.rb +354 -0
- data/lib/onfido/models/repeat_attempts_list.rb +292 -0
- data/lib/onfido/models/repeat_attempts_list_repeat_attempts_inner.rb +333 -0
- data/lib/onfido/models/report.rb +93 -0
- data/lib/onfido/models/report_document.rb +222 -0
- data/lib/onfido/models/report_name.rb +60 -0
- data/lib/onfido/models/report_result.rb +42 -0
- data/lib/onfido/models/report_shared.rb +329 -0
- data/lib/onfido/models/report_status.rb +44 -0
- data/lib/onfido/models/report_sub_result.rb +43 -0
- data/lib/onfido/models/reports_list.rb +223 -0
- data/lib/onfido/models/results_feedback.rb +279 -0
- data/lib/onfido/models/sdk_token.rb +229 -0
- data/lib/onfido/models/sdk_token_builder.rb +259 -0
- data/lib/onfido/models/sdk_token_request.rb +252 -0
- data/lib/onfido/models/sdk_token_response.rb +222 -0
- data/lib/onfido/models/task.rb +329 -0
- data/lib/onfido/models/task_item.rb +287 -0
- data/lib/onfido/models/timeline_file_reference.rb +239 -0
- data/lib/onfido/models/us_driving_licence_breakdown.rb +232 -0
- data/lib/onfido/models/us_driving_licence_breakdown_address.rb +224 -0
- data/lib/onfido/models/us_driving_licence_breakdown_address_breakdown.rb +259 -0
- data/lib/onfido/models/us_driving_licence_breakdown_document.rb +224 -0
- data/lib/onfido/models/us_driving_licence_breakdown_document_breakdown.rb +241 -0
- data/lib/onfido/models/us_driving_licence_breakdown_personal.rb +224 -0
- data/lib/onfido/models/us_driving_licence_breakdown_personal_breakdown.rb +322 -0
- data/lib/onfido/models/us_driving_licence_builder.rb +505 -0
- data/lib/onfido/models/us_driving_licence_report.rb +354 -0
- data/lib/onfido/models/us_driving_licence_shared.rb +499 -0
- data/lib/onfido/models/video_reasons.rb +245 -0
- data/lib/onfido/models/watchlist_aml_breakdown.rb +241 -0
- data/lib/onfido/models/watchlist_aml_breakdown_adverse_media.rb +215 -0
- data/lib/onfido/models/watchlist_aml_breakdown_legal_and_regulatory_warnings.rb +215 -0
- data/lib/onfido/models/watchlist_aml_breakdown_politically_exposed_person.rb +215 -0
- data/lib/onfido/models/watchlist_aml_breakdown_sanction.rb +215 -0
- data/lib/onfido/models/watchlist_aml_properties.rb +217 -0
- data/lib/onfido/models/watchlist_aml_report.rb +354 -0
- data/lib/onfido/models/watchlist_enhanced_breakdown.rb +241 -0
- data/lib/onfido/models/watchlist_enhanced_properties.rb +217 -0
- data/lib/onfido/models/watchlist_enhanced_report.rb +354 -0
- data/lib/onfido/models/watchlist_monitor.rb +342 -0
- data/lib/onfido/models/watchlist_monitor_builder.rb +292 -0
- data/lib/onfido/models/watchlist_monitor_match.rb +225 -0
- data/lib/onfido/models/watchlist_monitor_matches_list.rb +223 -0
- data/lib/onfido/models/watchlist_monitor_matches_updater.rb +227 -0
- data/lib/onfido/models/watchlist_monitor_response.rb +254 -0
- data/lib/onfido/models/watchlist_monitor_shared.rb +285 -0
- data/lib/onfido/models/watchlist_monitors_list.rb +223 -0
- data/lib/onfido/models/watchlist_peps_only_report.rb +354 -0
- data/lib/onfido/models/watchlist_sanctions_only_report.rb +354 -0
- data/lib/onfido/models/watchlist_standard_breakdown.rb +232 -0
- data/lib/onfido/models/watchlist_standard_properties.rb +217 -0
- data/lib/onfido/models/watchlist_standard_report.rb +354 -0
- data/lib/onfido/models/webhook.rb +304 -0
- data/lib/onfido/models/webhook_builder.rb +274 -0
- data/lib/onfido/models/webhook_create.rb +222 -0
- data/lib/onfido/models/webhook_event.rb +214 -0
- data/lib/onfido/models/webhook_event_payload.rb +273 -0
- data/lib/onfido/models/webhook_event_payload_object.rb +260 -0
- data/lib/onfido/models/webhook_event_type.rb +56 -0
- data/lib/onfido/models/webhook_resend.rb +216 -0
- data/lib/onfido/models/webhook_response.rb +252 -0
- data/lib/onfido/models/webhook_shared.rb +249 -0
- data/lib/onfido/models/webhook_update.rb +215 -0
- data/lib/onfido/models/webhook_updater.rb +267 -0
- data/lib/onfido/models/webhooks_list.rb +223 -0
- data/lib/onfido/models/webhooks_resend_item.rb +261 -0
- data/lib/onfido/models/workflow_run.rb +416 -0
- data/lib/onfido/models/workflow_run_builder.rb +316 -0
- data/lib/onfido/models/workflow_run_request.rb +217 -0
- data/lib/onfido/models/workflow_run_response.rb +317 -0
- data/lib/onfido/models/workflow_run_response_error.rb +226 -0
- data/lib/onfido/models/workflow_run_shared.rb +296 -0
- data/lib/onfido/models/workflow_run_shared_link.rb +290 -0
- data/lib/onfido/version.rb +12 -2
- data/lib/onfido/webhook_event_verifier.rb +20 -0
- data/lib/onfido.rb +309 -25
- data/onfido.gemspec +42 -33
- data/spec/integrations/address_picker_spec.rb +16 -0
- data/spec/integrations/applicant_spec.rb +73 -95
- data/spec/integrations/check_spec.rb +60 -41
- data/spec/integrations/document_spec.rb +28 -57
- data/spec/integrations/extraction_spec.rb +27 -12
- data/spec/integrations/id_photo_spec.rb +55 -0
- data/spec/integrations/live_photo_spec.rb +28 -45
- data/spec/integrations/live_video_spec.rb +33 -19
- data/spec/integrations/media/sample_driving_licence.png +0 -0
- data/spec/integrations/media/sample_photo.png +0 -0
- data/spec/integrations/motion_capture_spec.rb +30 -24
- data/spec/integrations/report_schema_spec.rb +45 -0
- data/spec/integrations/report_spec.rb +34 -25
- data/spec/integrations/sdk_token_spec.rb +12 -10
- data/spec/integrations/tasks_spec.rb +45 -0
- data/spec/integrations/watchlist_monitor_spec.rb +73 -0
- data/spec/integrations/webhook_spec.rb +40 -88
- data/spec/integrations/workflow_run_output_spec.rb +117 -0
- data/spec/integrations/workflow_run_spec.rb +64 -34
- data/spec/shared_contexts/with_applicant.rb +24 -0
- data/spec/shared_contexts/with_check.rb +18 -0
- data/spec/shared_contexts/with_document.rb +13 -0
- data/spec/shared_contexts/with_live_photo.rb +18 -0
- data/spec/shared_contexts/with_onfido.rb +14 -0
- data/spec/shared_contexts/with_workflow_run.rb +19 -0
- data/spec/spec_helper.rb +73 -11
- data/spec/webhook_event_verifier_spec.rb +29 -0
- metadata +367 -157
- data/.github/workflows/gem-push.yml +0 -31
- data/.github/workflows/ruby.yml +0 -25
- data/.gitignore +0 -19
- data/.rspec +0 -2
- data/.rubocop.yml +0 -13
- data/lib/onfido/api.rb +0 -65
- data/lib/onfido/errors/connection_error.rb +0 -6
- data/lib/onfido/errors/onfido_error.rb +0 -30
- data/lib/onfido/errors/request_error.rb +0 -6
- data/lib/onfido/errors/server_error.rb +0 -6
- data/lib/onfido/options.rb +0 -38
- data/lib/onfido/resource.rb +0 -153
- data/lib/onfido/resources/address.rb +0 -9
- data/lib/onfido/resources/applicant.rb +0 -29
- data/lib/onfido/resources/check.rb +0 -28
- data/lib/onfido/resources/document.rb +0 -28
- data/lib/onfido/resources/extraction.rb +0 -11
- data/lib/onfido/resources/live_photo.rb +0 -27
- data/lib/onfido/resources/live_video.rb +0 -17
- data/lib/onfido/resources/monitor.rb +0 -32
- data/lib/onfido/resources/motion_capture.rb +0 -21
- data/lib/onfido/resources/report.rb +0 -21
- data/lib/onfido/resources/sdk_token.rb +0 -10
- data/lib/onfido/resources/webhook.rb +0 -40
- data/lib/onfido/resources/workflow_run.rb +0 -21
- data/spec/integrations/address_spec.rb +0 -13
- data/spec/integrations/monitor_spec.rb +0 -100
- data/spec/integrations/resource_spec.rb +0 -106
- data/spec/onfido/api_spec.rb +0 -22
- data/spec/onfido/connection_error_spec.rb +0 -20
- data/spec/onfido/options_spec.rb +0 -39
- data/spec/onfido/request_error_spec.rb +0 -36
- data/spec/support/fake_onfido_api.rb +0 -295
- data/spec/support/fixtures/4xx_response.json +0 -14
- data/spec/support/fixtures/addresses.json +0 -24
- data/spec/support/fixtures/applicant.json +0 -28
- data/spec/support/fixtures/applicants.json +0 -12
- data/spec/support/fixtures/check.json +0 -12
- data/spec/support/fixtures/checks.json +0 -16
- data/spec/support/fixtures/document.json +0 -10
- data/spec/support/fixtures/documents.json +0 -23
- data/spec/support/fixtures/extraction.json +0 -23
- data/spec/support/fixtures/live_photo.json +0 -9
- data/spec/support/fixtures/live_photos.json +0 -22
- data/spec/support/fixtures/live_video.json +0 -23
- data/spec/support/fixtures/live_videos.json +0 -27
- data/spec/support/fixtures/monitor.json +0 -8
- data/spec/support/fixtures/monitor_matches.json +0 -12
- data/spec/support/fixtures/monitors.json +0 -12
- data/spec/support/fixtures/motion_capture.json +0 -9
- data/spec/support/fixtures/motion_captures.json +0 -13
- data/spec/support/fixtures/not_scheduled_for_deletion_error.json +0 -7
- data/spec/support/fixtures/report.json +0 -10
- data/spec/support/fixtures/reports.json +0 -24
- data/spec/support/fixtures/sdk_token.json +0 -3
- data/spec/support/fixtures/signed_workflow_run.pdf +0 -0
- data/spec/support/fixtures/unexpected_error_format.json +0 -3
- data/spec/support/fixtures/webhook.json +0 -14
- data/spec/support/fixtures/webhooks.json +0 -31
- data/spec/support/fixtures/workflow_run.json +0 -20
- data/spec/support/fixtures/workflow_runs.json +0 -42
@@ -0,0 +1,232 @@
|
|
1
|
+
=begin
|
2
|
+
#Onfido API v3.6
|
3
|
+
|
4
|
+
#The Onfido API (v3.6)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3.6
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.6.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Onfido
|
17
|
+
class DeviceIntelligenceBreakdownProperties
|
18
|
+
attr_accessor :device
|
19
|
+
|
20
|
+
attr_accessor :ip
|
21
|
+
|
22
|
+
attr_accessor :geolocation
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'device' => :'device',
|
28
|
+
:'ip' => :'ip',
|
29
|
+
:'geolocation' => :'geolocation'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'device' => :'DeviceIntelligenceBreakdownPropertiesDevice',
|
42
|
+
:'ip' => :'DeviceIntelligenceBreakdownPropertiesIp',
|
43
|
+
:'geolocation' => :'DeviceIntelligenceBreakdownPropertiesGeolocation'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# List of attributes with nullable: true
|
48
|
+
def self.openapi_nullable
|
49
|
+
Set.new([
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::DeviceIntelligenceBreakdownProperties` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::DeviceIntelligenceBreakdownProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:'device')
|
69
|
+
self.device = attributes[:'device']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'ip')
|
73
|
+
self.ip = attributes[:'ip']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'geolocation')
|
77
|
+
self.geolocation = attributes[:'geolocation']
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
82
|
+
# @return Array for valid properties with the reasons
|
83
|
+
def list_invalid_properties
|
84
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
85
|
+
invalid_properties = Array.new
|
86
|
+
invalid_properties
|
87
|
+
end
|
88
|
+
|
89
|
+
# Check to see if the all the properties in the model are valid
|
90
|
+
# @return true if the model is valid
|
91
|
+
def valid?
|
92
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
device == o.device &&
|
102
|
+
ip == o.ip &&
|
103
|
+
geolocation == o.geolocation
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(o)
|
109
|
+
self == o
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Integer] Hash code
|
114
|
+
def hash
|
115
|
+
[device, ip, geolocation].hash
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def self.build_from_hash(attributes)
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
123
|
+
attributes = attributes.transform_keys(&:to_sym)
|
124
|
+
transformed_hash = {}
|
125
|
+
openapi_types.each_pair do |key, type|
|
126
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
127
|
+
transformed_hash["#{key}"] = nil
|
128
|
+
elsif type =~ /\AArray<(.*)>/i
|
129
|
+
# check to ensure the input is an array given that the attribute
|
130
|
+
# is documented as an array but the input is not
|
131
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
132
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
133
|
+
end
|
134
|
+
elsif !attributes[attribute_map[key]].nil?
|
135
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
136
|
+
end
|
137
|
+
end
|
138
|
+
new(transformed_hash)
|
139
|
+
end
|
140
|
+
|
141
|
+
# Deserializes the data based on type
|
142
|
+
# @param string type Data type
|
143
|
+
# @param string value Value to be deserialized
|
144
|
+
# @return [Object] Deserialized data
|
145
|
+
def self._deserialize(type, value)
|
146
|
+
case type.to_sym
|
147
|
+
when :Time
|
148
|
+
Time.parse(value)
|
149
|
+
when :Date
|
150
|
+
Date.parse(value)
|
151
|
+
when :String
|
152
|
+
value.to_s
|
153
|
+
when :Integer
|
154
|
+
value.to_i
|
155
|
+
when :Float
|
156
|
+
value.to_f
|
157
|
+
when :Boolean
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
159
|
+
true
|
160
|
+
else
|
161
|
+
false
|
162
|
+
end
|
163
|
+
when :Object
|
164
|
+
# generic object (usually a Hash), return directly
|
165
|
+
value
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
172
|
+
{}.tap do |hash|
|
173
|
+
value.each do |k, v|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
else # model
|
178
|
+
# models (e.g. Pet) or oneOf
|
179
|
+
klass = Onfido.const_get(type)
|
180
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the string representation of the object
|
185
|
+
# @return [String] String presentation of the object
|
186
|
+
def to_s
|
187
|
+
to_hash.to_s
|
188
|
+
end
|
189
|
+
|
190
|
+
# to_body is an alias to to_hash (backward compatibility)
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_body
|
193
|
+
to_hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the object in the form of hash
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_hash
|
199
|
+
hash = {}
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
201
|
+
value = self.send(attr)
|
202
|
+
if value.nil?
|
203
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
204
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
205
|
+
end
|
206
|
+
|
207
|
+
hash[param] = _to_hash(value)
|
208
|
+
end
|
209
|
+
hash
|
210
|
+
end
|
211
|
+
|
212
|
+
# Outputs non-array value in the form of hash
|
213
|
+
# For object, use to_hash. Otherwise, just return the value
|
214
|
+
# @param [Object] value Any valid value
|
215
|
+
# @return [Hash] Returns the value in the form of hash
|
216
|
+
def _to_hash(value)
|
217
|
+
if value.is_a?(Array)
|
218
|
+
value.compact.map { |v| _to_hash(v) }
|
219
|
+
elsif value.is_a?(Hash)
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
222
|
+
end
|
223
|
+
elsif value.respond_to? :to_hash
|
224
|
+
value.to_hash
|
225
|
+
else
|
226
|
+
value
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
@@ -0,0 +1,468 @@
|
|
1
|
+
=begin
|
2
|
+
#Onfido API v3.6
|
3
|
+
|
4
|
+
#The Onfido API (v3.6)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3.6
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.6.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Onfido
|
17
|
+
class DeviceIntelligenceBreakdownPropertiesDevice
|
18
|
+
# The SDK version that was used.
|
19
|
+
attr_accessor :sdk_version
|
20
|
+
|
21
|
+
# The SDK used to upload the media.
|
22
|
+
attr_accessor :sdk_source
|
23
|
+
|
24
|
+
# The token used to authenticate the request.
|
25
|
+
attr_accessor :authentication_type
|
26
|
+
|
27
|
+
# The model as set by the phone manufacturer (for Android and iOS) or the browser manufacturer (for Web). The model can be presented in name or number form depending on each manufacturer implementation.
|
28
|
+
attr_accessor :raw_model
|
29
|
+
|
30
|
+
# The operating system of the device. The value came from manufacturer implementation (for Android and iOS) or browser's user agent (for Web).
|
31
|
+
attr_accessor :os
|
32
|
+
|
33
|
+
# The browser name reported by the browser's user agent.
|
34
|
+
attr_accessor :browser
|
35
|
+
|
36
|
+
# Whether the device is an emulator.
|
37
|
+
attr_accessor :emulator
|
38
|
+
|
39
|
+
# Whether the device is providing false randomized device and network information.
|
40
|
+
attr_accessor :randomized_device
|
41
|
+
|
42
|
+
# Whether device is using stolen security tokens to send the network information.
|
43
|
+
attr_accessor :fake_network_request
|
44
|
+
|
45
|
+
# The true operating system of the device.
|
46
|
+
attr_accessor :true_os
|
47
|
+
|
48
|
+
# The likelihood of an operating system anomaly between the true OS and the OS sent by the device.
|
49
|
+
attr_accessor :os_anomaly
|
50
|
+
|
51
|
+
# Whether the device is rooted.
|
52
|
+
attr_accessor :rooted
|
53
|
+
|
54
|
+
# Whether the device is controlled via remote software.
|
55
|
+
attr_accessor :remote_software
|
56
|
+
|
57
|
+
# Whether there is highly suspicious traffic related to the IP address. The risk depends on the overall ratio of clear checks on a given IP.
|
58
|
+
attr_accessor :ip_reputation
|
59
|
+
|
60
|
+
# The number of times the device was used to create a report for a new applicant. A value greater than 1 indicates potential device reuse.
|
61
|
+
attr_accessor :device_fingerprint_reuse
|
62
|
+
|
63
|
+
# Whether the document or biometric media were uploaded from a single device.
|
64
|
+
attr_accessor :single_device_used
|
65
|
+
|
66
|
+
# Whether the document media were live captured from the device camera.
|
67
|
+
attr_accessor :document_capture
|
68
|
+
|
69
|
+
# Whether the biometric media were live captured from the device camera.
|
70
|
+
attr_accessor :biometric_capture
|
71
|
+
|
72
|
+
class EnumAttributeValidator
|
73
|
+
attr_reader :datatype
|
74
|
+
attr_reader :allowable_values
|
75
|
+
|
76
|
+
def initialize(datatype, allowable_values)
|
77
|
+
@allowable_values = allowable_values.map do |value|
|
78
|
+
case datatype.to_s
|
79
|
+
when /Integer/i
|
80
|
+
value.to_i
|
81
|
+
when /Float/i
|
82
|
+
value.to_f
|
83
|
+
else
|
84
|
+
value
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def valid?(value)
|
90
|
+
!value || allowable_values.include?(value)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
95
|
+
def self.attribute_map
|
96
|
+
{
|
97
|
+
:'sdk_version' => :'sdk_version',
|
98
|
+
:'sdk_source' => :'sdk_source',
|
99
|
+
:'authentication_type' => :'authentication_type',
|
100
|
+
:'raw_model' => :'raw_model',
|
101
|
+
:'os' => :'os',
|
102
|
+
:'browser' => :'browser',
|
103
|
+
:'emulator' => :'emulator',
|
104
|
+
:'randomized_device' => :'randomized_device',
|
105
|
+
:'fake_network_request' => :'fake_network_request',
|
106
|
+
:'true_os' => :'true_os',
|
107
|
+
:'os_anomaly' => :'os_anomaly',
|
108
|
+
:'rooted' => :'rooted',
|
109
|
+
:'remote_software' => :'remote_software',
|
110
|
+
:'ip_reputation' => :'ip_reputation',
|
111
|
+
:'device_fingerprint_reuse' => :'device_fingerprint_reuse',
|
112
|
+
:'single_device_used' => :'single_device_used',
|
113
|
+
:'document_capture' => :'document_capture',
|
114
|
+
:'biometric_capture' => :'biometric_capture'
|
115
|
+
}
|
116
|
+
end
|
117
|
+
|
118
|
+
# Returns all the JSON keys this model knows about
|
119
|
+
def self.acceptable_attributes
|
120
|
+
attribute_map.values
|
121
|
+
end
|
122
|
+
|
123
|
+
# Attribute type mapping.
|
124
|
+
def self.openapi_types
|
125
|
+
{
|
126
|
+
:'sdk_version' => :'String',
|
127
|
+
:'sdk_source' => :'String',
|
128
|
+
:'authentication_type' => :'String',
|
129
|
+
:'raw_model' => :'String',
|
130
|
+
:'os' => :'String',
|
131
|
+
:'browser' => :'String',
|
132
|
+
:'emulator' => :'Boolean',
|
133
|
+
:'randomized_device' => :'Boolean',
|
134
|
+
:'fake_network_request' => :'Boolean',
|
135
|
+
:'true_os' => :'String',
|
136
|
+
:'os_anomaly' => :'String',
|
137
|
+
:'rooted' => :'Boolean',
|
138
|
+
:'remote_software' => :'Boolean',
|
139
|
+
:'ip_reputation' => :'String',
|
140
|
+
:'device_fingerprint_reuse' => :'Integer',
|
141
|
+
:'single_device_used' => :'Boolean',
|
142
|
+
:'document_capture' => :'String',
|
143
|
+
:'biometric_capture' => :'String'
|
144
|
+
}
|
145
|
+
end
|
146
|
+
|
147
|
+
# List of attributes with nullable: true
|
148
|
+
def self.openapi_nullable
|
149
|
+
Set.new([
|
150
|
+
:'single_device_used',
|
151
|
+
])
|
152
|
+
end
|
153
|
+
|
154
|
+
# Initializes the object
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
def initialize(attributes = {})
|
157
|
+
if (!attributes.is_a?(Hash))
|
158
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Onfido::DeviceIntelligenceBreakdownPropertiesDevice` initialize method"
|
159
|
+
end
|
160
|
+
|
161
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
162
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
163
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
164
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Onfido::DeviceIntelligenceBreakdownPropertiesDevice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
165
|
+
end
|
166
|
+
h[k.to_sym] = v
|
167
|
+
}
|
168
|
+
|
169
|
+
if attributes.key?(:'sdk_version')
|
170
|
+
self.sdk_version = attributes[:'sdk_version']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.key?(:'sdk_source')
|
174
|
+
self.sdk_source = attributes[:'sdk_source']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.key?(:'authentication_type')
|
178
|
+
self.authentication_type = attributes[:'authentication_type']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.key?(:'raw_model')
|
182
|
+
self.raw_model = attributes[:'raw_model']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.key?(:'os')
|
186
|
+
self.os = attributes[:'os']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.key?(:'browser')
|
190
|
+
self.browser = attributes[:'browser']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.key?(:'emulator')
|
194
|
+
self.emulator = attributes[:'emulator']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.key?(:'randomized_device')
|
198
|
+
self.randomized_device = attributes[:'randomized_device']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.key?(:'fake_network_request')
|
202
|
+
self.fake_network_request = attributes[:'fake_network_request']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'true_os')
|
206
|
+
self.true_os = attributes[:'true_os']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'os_anomaly')
|
210
|
+
self.os_anomaly = attributes[:'os_anomaly']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.key?(:'rooted')
|
214
|
+
self.rooted = attributes[:'rooted']
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'remote_software')
|
218
|
+
self.remote_software = attributes[:'remote_software']
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'ip_reputation')
|
222
|
+
self.ip_reputation = attributes[:'ip_reputation']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'device_fingerprint_reuse')
|
226
|
+
self.device_fingerprint_reuse = attributes[:'device_fingerprint_reuse']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'single_device_used')
|
230
|
+
self.single_device_used = attributes[:'single_device_used']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'document_capture')
|
234
|
+
self.document_capture = attributes[:'document_capture']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'biometric_capture')
|
238
|
+
self.biometric_capture = attributes[:'biometric_capture']
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
243
|
+
# @return Array for valid properties with the reasons
|
244
|
+
def list_invalid_properties
|
245
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
246
|
+
invalid_properties = Array.new
|
247
|
+
invalid_properties
|
248
|
+
end
|
249
|
+
|
250
|
+
# Check to see if the all the properties in the model are valid
|
251
|
+
# @return true if the model is valid
|
252
|
+
def valid?
|
253
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
254
|
+
sdk_source_validator = EnumAttributeValidator.new('String', ["onfido-android-sdk", "onfido-ios-sdk", "onfido-web-sdk", "unknown_default_open_api"])
|
255
|
+
return false unless sdk_source_validator.valid?(@sdk_source)
|
256
|
+
authentication_type_validator = EnumAttributeValidator.new('String', ["sdk_token", "mobile_token", "api_token", "unknown_default_open_api"])
|
257
|
+
return false unless authentication_type_validator.valid?(@authentication_type)
|
258
|
+
ip_reputation_validator = EnumAttributeValidator.new('String', ["NOT_ENOUGH_DATA", "HIGH_RISK", "LOW_RISK", "unknown_default_open_api"])
|
259
|
+
return false unless ip_reputation_validator.valid?(@ip_reputation)
|
260
|
+
document_capture_validator = EnumAttributeValidator.new('String', ["live", "unknown_method", "unknown_default_open_api"])
|
261
|
+
return false unless document_capture_validator.valid?(@document_capture)
|
262
|
+
biometric_capture_validator = EnumAttributeValidator.new('String', ["live", "unknown_method", "unknown_default_open_api"])
|
263
|
+
return false unless biometric_capture_validator.valid?(@biometric_capture)
|
264
|
+
true
|
265
|
+
end
|
266
|
+
|
267
|
+
# Custom attribute writer method checking allowed values (enum).
|
268
|
+
# @param [Object] sdk_source Object to be assigned
|
269
|
+
def sdk_source=(sdk_source)
|
270
|
+
validator = EnumAttributeValidator.new('String', ["onfido-android-sdk", "onfido-ios-sdk", "onfido-web-sdk", "unknown_default_open_api"])
|
271
|
+
unless validator.valid?(sdk_source)
|
272
|
+
fail ArgumentError, "invalid value for \"sdk_source\", must be one of #{validator.allowable_values}."
|
273
|
+
end
|
274
|
+
@sdk_source = sdk_source
|
275
|
+
end
|
276
|
+
|
277
|
+
# Custom attribute writer method checking allowed values (enum).
|
278
|
+
# @param [Object] authentication_type Object to be assigned
|
279
|
+
def authentication_type=(authentication_type)
|
280
|
+
validator = EnumAttributeValidator.new('String', ["sdk_token", "mobile_token", "api_token", "unknown_default_open_api"])
|
281
|
+
unless validator.valid?(authentication_type)
|
282
|
+
fail ArgumentError, "invalid value for \"authentication_type\", must be one of #{validator.allowable_values}."
|
283
|
+
end
|
284
|
+
@authentication_type = authentication_type
|
285
|
+
end
|
286
|
+
|
287
|
+
# Custom attribute writer method checking allowed values (enum).
|
288
|
+
# @param [Object] ip_reputation Object to be assigned
|
289
|
+
def ip_reputation=(ip_reputation)
|
290
|
+
validator = EnumAttributeValidator.new('String', ["NOT_ENOUGH_DATA", "HIGH_RISK", "LOW_RISK", "unknown_default_open_api"])
|
291
|
+
unless validator.valid?(ip_reputation)
|
292
|
+
fail ArgumentError, "invalid value for \"ip_reputation\", must be one of #{validator.allowable_values}."
|
293
|
+
end
|
294
|
+
@ip_reputation = ip_reputation
|
295
|
+
end
|
296
|
+
|
297
|
+
# Custom attribute writer method checking allowed values (enum).
|
298
|
+
# @param [Object] document_capture Object to be assigned
|
299
|
+
def document_capture=(document_capture)
|
300
|
+
validator = EnumAttributeValidator.new('String', ["live", "unknown_method", "unknown_default_open_api"])
|
301
|
+
unless validator.valid?(document_capture)
|
302
|
+
fail ArgumentError, "invalid value for \"document_capture\", must be one of #{validator.allowable_values}."
|
303
|
+
end
|
304
|
+
@document_capture = document_capture
|
305
|
+
end
|
306
|
+
|
307
|
+
# Custom attribute writer method checking allowed values (enum).
|
308
|
+
# @param [Object] biometric_capture Object to be assigned
|
309
|
+
def biometric_capture=(biometric_capture)
|
310
|
+
validator = EnumAttributeValidator.new('String', ["live", "unknown_method", "unknown_default_open_api"])
|
311
|
+
unless validator.valid?(biometric_capture)
|
312
|
+
fail ArgumentError, "invalid value for \"biometric_capture\", must be one of #{validator.allowable_values}."
|
313
|
+
end
|
314
|
+
@biometric_capture = biometric_capture
|
315
|
+
end
|
316
|
+
|
317
|
+
# Checks equality by comparing each attribute.
|
318
|
+
# @param [Object] Object to be compared
|
319
|
+
def ==(o)
|
320
|
+
return true if self.equal?(o)
|
321
|
+
self.class == o.class &&
|
322
|
+
sdk_version == o.sdk_version &&
|
323
|
+
sdk_source == o.sdk_source &&
|
324
|
+
authentication_type == o.authentication_type &&
|
325
|
+
raw_model == o.raw_model &&
|
326
|
+
os == o.os &&
|
327
|
+
browser == o.browser &&
|
328
|
+
emulator == o.emulator &&
|
329
|
+
randomized_device == o.randomized_device &&
|
330
|
+
fake_network_request == o.fake_network_request &&
|
331
|
+
true_os == o.true_os &&
|
332
|
+
os_anomaly == o.os_anomaly &&
|
333
|
+
rooted == o.rooted &&
|
334
|
+
remote_software == o.remote_software &&
|
335
|
+
ip_reputation == o.ip_reputation &&
|
336
|
+
device_fingerprint_reuse == o.device_fingerprint_reuse &&
|
337
|
+
single_device_used == o.single_device_used &&
|
338
|
+
document_capture == o.document_capture &&
|
339
|
+
biometric_capture == o.biometric_capture
|
340
|
+
end
|
341
|
+
|
342
|
+
# @see the `==` method
|
343
|
+
# @param [Object] Object to be compared
|
344
|
+
def eql?(o)
|
345
|
+
self == o
|
346
|
+
end
|
347
|
+
|
348
|
+
# Calculates hash code according to all attributes.
|
349
|
+
# @return [Integer] Hash code
|
350
|
+
def hash
|
351
|
+
[sdk_version, sdk_source, authentication_type, raw_model, os, browser, emulator, randomized_device, fake_network_request, true_os, os_anomaly, rooted, remote_software, ip_reputation, device_fingerprint_reuse, single_device_used, document_capture, biometric_capture].hash
|
352
|
+
end
|
353
|
+
|
354
|
+
# Builds the object from hash
|
355
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
356
|
+
# @return [Object] Returns the model itself
|
357
|
+
def self.build_from_hash(attributes)
|
358
|
+
return nil unless attributes.is_a?(Hash)
|
359
|
+
attributes = attributes.transform_keys(&:to_sym)
|
360
|
+
transformed_hash = {}
|
361
|
+
openapi_types.each_pair do |key, type|
|
362
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
363
|
+
transformed_hash["#{key}"] = nil
|
364
|
+
elsif type =~ /\AArray<(.*)>/i
|
365
|
+
# check to ensure the input is an array given that the attribute
|
366
|
+
# is documented as an array but the input is not
|
367
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
368
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
369
|
+
end
|
370
|
+
elsif !attributes[attribute_map[key]].nil?
|
371
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
372
|
+
end
|
373
|
+
end
|
374
|
+
new(transformed_hash)
|
375
|
+
end
|
376
|
+
|
377
|
+
# Deserializes the data based on type
|
378
|
+
# @param string type Data type
|
379
|
+
# @param string value Value to be deserialized
|
380
|
+
# @return [Object] Deserialized data
|
381
|
+
def self._deserialize(type, value)
|
382
|
+
case type.to_sym
|
383
|
+
when :Time
|
384
|
+
Time.parse(value)
|
385
|
+
when :Date
|
386
|
+
Date.parse(value)
|
387
|
+
when :String
|
388
|
+
value.to_s
|
389
|
+
when :Integer
|
390
|
+
value.to_i
|
391
|
+
when :Float
|
392
|
+
value.to_f
|
393
|
+
when :Boolean
|
394
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
395
|
+
true
|
396
|
+
else
|
397
|
+
false
|
398
|
+
end
|
399
|
+
when :Object
|
400
|
+
# generic object (usually a Hash), return directly
|
401
|
+
value
|
402
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
403
|
+
inner_type = Regexp.last_match[:inner_type]
|
404
|
+
value.map { |v| _deserialize(inner_type, v) }
|
405
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
406
|
+
k_type = Regexp.last_match[:k_type]
|
407
|
+
v_type = Regexp.last_match[:v_type]
|
408
|
+
{}.tap do |hash|
|
409
|
+
value.each do |k, v|
|
410
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
411
|
+
end
|
412
|
+
end
|
413
|
+
else # model
|
414
|
+
# models (e.g. Pet) or oneOf
|
415
|
+
klass = Onfido.const_get(type)
|
416
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
417
|
+
end
|
418
|
+
end
|
419
|
+
|
420
|
+
# Returns the string representation of the object
|
421
|
+
# @return [String] String presentation of the object
|
422
|
+
def to_s
|
423
|
+
to_hash.to_s
|
424
|
+
end
|
425
|
+
|
426
|
+
# to_body is an alias to to_hash (backward compatibility)
|
427
|
+
# @return [Hash] Returns the object in the form of hash
|
428
|
+
def to_body
|
429
|
+
to_hash
|
430
|
+
end
|
431
|
+
|
432
|
+
# Returns the object in the form of hash
|
433
|
+
# @return [Hash] Returns the object in the form of hash
|
434
|
+
def to_hash
|
435
|
+
hash = {}
|
436
|
+
self.class.attribute_map.each_pair do |attr, param|
|
437
|
+
value = self.send(attr)
|
438
|
+
if value.nil?
|
439
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
440
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
441
|
+
end
|
442
|
+
|
443
|
+
hash[param] = _to_hash(value)
|
444
|
+
end
|
445
|
+
hash
|
446
|
+
end
|
447
|
+
|
448
|
+
# Outputs non-array value in the form of hash
|
449
|
+
# For object, use to_hash. Otherwise, just return the value
|
450
|
+
# @param [Object] value Any valid value
|
451
|
+
# @return [Hash] Returns the value in the form of hash
|
452
|
+
def _to_hash(value)
|
453
|
+
if value.is_a?(Array)
|
454
|
+
value.compact.map { |v| _to_hash(v) }
|
455
|
+
elsif value.is_a?(Hash)
|
456
|
+
{}.tap do |hash|
|
457
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
458
|
+
end
|
459
|
+
elsif value.respond_to? :to_hash
|
460
|
+
value.to_hash
|
461
|
+
else
|
462
|
+
value
|
463
|
+
end
|
464
|
+
end
|
465
|
+
|
466
|
+
end
|
467
|
+
|
468
|
+
end
|