Class: Yoti::Sandbox::DocScan::Request::CheckReports

Inherits:
Object
  • Object
show all
Defined in:
lib/yoti_sandbox/doc_scan/request/check_reports.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_text_data_checks, document_authenticity_checks, liveness_checks, document_face_match_checks, async_report_delay, id_document_comparison_checks = nil, supplementary_document_text_data_checks = nil) ⇒ CheckReports

Returns a new instance of CheckReports.

Parameters:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/yoti_sandbox/doc_scan/request/check_reports.rb', line 16

def initialize(
  document_text_data_checks,
  document_authenticity_checks,
  liveness_checks,
  document_face_match_checks,
  async_report_delay,
  id_document_comparison_checks = nil,
  supplementary_document_text_data_checks = nil
)
  Validation.assert_is_a(Array, document_text_data_checks, 'document_text_data_checks')
  @document_text_data_checks = document_text_data_checks

  Validation.assert_is_a(Array, document_authenticity_checks, 'document_authenticity_checks')
  @document_authenticity_checks = document_authenticity_checks

  Validation.assert_is_a(Array, liveness_checks, 'liveness_checks')
  @liveness_checks = liveness_checks

  Validation.assert_is_a(Array, document_face_match_checks, 'document_face_match_checks')
  @document_face_match_checks = document_face_match_checks

  Validation.assert_is_a(Integer, async_report_delay, 'async_report_delay', true)
  @async_report_delay = async_report_delay

  Validation.assert_is_a(Array, id_document_comparison_checks, 'id_document_comparison_checks', true)
  @id_document_comparison_checks = id_document_comparison_checks

  Validation.assert_is_a(
    Array,
    supplementary_document_text_data_checks,
    'supplementary_document_text_data_checks',
    true
  )
  @supplementary_document_text_data_checks = supplementary_document_text_data_checks
end

Class Method Details

.builderObject



52
53
54
# File 'lib/yoti_sandbox/doc_scan/request/check_reports.rb', line 52

def self.builder
  CheckReportsBuilder.new
end

Instance Method Details

#as_json(*_args) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
# File 'lib/yoti_sandbox/doc_scan/request/check_reports.rb', line 60

def as_json(*_args)
  {
    ID_DOCUMENT_TEXT_DATA_CHECK: @document_text_data_checks,
    ID_DOCUMENT_AUTHENTICITY: @document_authenticity_checks,
    ID_DOCUMENT_FACE_MATCH: @document_face_match_checks,
    LIVENESS: @liveness_checks,
    ID_DOCUMENT_COMPARISON: @id_document_comparison_checks,
    SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK: @supplementary_document_text_data_checks,
    async_report_delay: @async_report_delay
  }.compact
end

#to_json(*_args) ⇒ Object



56
57
58
# File 'lib/yoti_sandbox/doc_scan/request/check_reports.rb', line 56

def to_json(*_args)
  as_json.to_json
end