Class: ThePlaidApi::RiskSignalDocumentReference

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/risk_signal_document_reference.rb

Overview

Object containing metadata for the document

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(document_id: SKIP, document_name: SKIP, status: SKIP, document_type: SKIP, file_type: SKIP, additional_properties: nil) ⇒ RiskSignalDocumentReference

Returns a new instance of RiskSignalDocumentReference.



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 63

def initialize(document_id: SKIP, document_name: SKIP, status: SKIP,
               document_type: SKIP, file_type: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @document_id = document_id unless document_id == SKIP
  @document_name = document_name unless document_name == SKIP
  @status = status unless status == SKIP
  @document_type = document_type unless document_type == SKIP
  @file_type = file_type unless file_type == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#document_idString

An identifier of the document referenced by the document metadata.

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 14

def document_id
  @document_id
end

#document_nameString

The name of the document

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 18

def document_name
  @document_name
end

#document_typeRiskSignalDocumentType

Type of a document for risk signal analysis



26
27
28
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 26

def document_type
  @document_type
end

#file_typeRiskSignalFileType

The file type for risk signal analysis

Returns:



30
31
32
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 30

def file_type
  @file_type
end

#statusRiskSignalDocumentStatus

Status of a document for risk signal analysis



22
23
24
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 22

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 78

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  document_id = hash.key?('document_id') ? hash['document_id'] : SKIP
  document_name = hash.key?('document_name') ? hash['document_name'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  document_type = hash.key?('document_type') ? hash['document_type'] : SKIP
  file_type = hash.key?('file_type') ? hash['file_type'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  RiskSignalDocumentReference.new(document_id: document_id,
                                  document_name: document_name,
                                  status: status,
                                  document_type: document_type,
                                  file_type: file_type,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['document_id'] = 'document_id'
  @_hash['document_name'] = 'document_name'
  @_hash['status'] = 'status'
  @_hash['document_type'] = 'document_type'
  @_hash['file_type'] = 'file_type'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
58
59
60
61
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 55

def self.nullables
  %w[
    document_id
    document_type
    file_type
  ]
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 44

def self.optionals
  %w[
    document_id
    document_name
    status
    document_type
    file_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



113
114
115
116
117
118
119
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 113

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} document_id: #{@document_id.inspect}, document_name:"\
  " #{@document_name.inspect}, status: #{@status.inspect}, document_type:"\
  " #{@document_type.inspect}, file_type: #{@file_type.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



105
106
107
108
109
110
# File 'lib/the_plaid_api/models/risk_signal_document_reference.rb', line 105

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} document_id: #{@document_id}, document_name: #{@document_name}, status:"\
  " #{@status}, document_type: #{@document_type}, file_type: #{@file_type},"\
  " additional_properties: #{@additional_properties}>"
end