Class: ThePlaidApi::IdentityDocumentMetadata

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

Overview

In closed beta. Object representing metadata pertaining to 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(is_account_number_match: SKIP, last_updated: SKIP, uploaded_at: SKIP, additional_properties: nil) ⇒ IdentityDocumentMetadata

Returns a new instance of IdentityDocumentMetadata.



51
52
53
54
55
56
57
58
59
60
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 51

def initialize(is_account_number_match: SKIP, last_updated: SKIP,
               uploaded_at: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @is_account_number_match =  unless  == SKIP
  @last_updated = last_updated unless last_updated == SKIP
  @uploaded_at = uploaded_at unless uploaded_at == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#is_account_number_matchTrueClass | FalseClass

Boolean field indicating if the uploaded document’s account number matches the account number we have on file

Returns:

  • (TrueClass | FalseClass)


16
17
18
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 16

def 
  @is_account_number_match
end

#last_updatedDateTime

Boolean field indicating if the uploaded document’s account number matches the account number we have on file

Returns:

  • (DateTime)


21
22
23
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 21

def last_updated
  @last_updated
end

#uploaded_atDateTime

Boolean field indicating if the uploaded document’s account number matches the account number we have on file

Returns:

  • (DateTime)


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

def uploaded_at
  @uploaded_at
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   =
    hash.key?('is_account_number_match') ? hash['is_account_number_match'] : SKIP
  last_updated = if hash.key?('last_updated')
                   (DateTimeHelper.from_rfc3339(hash['last_updated']) if hash['last_updated'])
                 else
                   SKIP
                 end
  uploaded_at = if hash.key?('uploaded_at')
                  (DateTimeHelper.from_rfc3339(hash['uploaded_at']) if hash['uploaded_at'])
                else
                  SKIP
                end

  # 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.
  IdentityDocumentMetadata.new(is_account_number_match: ,
                               last_updated: last_updated,
                               uploaded_at: uploaded_at,
                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['is_account_number_match'] = 'is_account_number_match'
  @_hash['last_updated'] = 'last_updated'
  @_hash['uploaded_at'] = 'uploaded_at'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



38
39
40
41
42
43
44
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 38

def self.optionals
  %w[
    is_account_number_match
    last_updated
    uploaded_at
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



111
112
113
114
115
116
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 111

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} is_account_number_match: #{@is_account_number_match.inspect}, last_updated:"\
  " #{@last_updated.inspect}, uploaded_at: #{@uploaded_at.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_last_updatedObject



94
95
96
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 94

def to_custom_last_updated
  DateTimeHelper.to_rfc3339(last_updated)
end

#to_custom_uploaded_atObject



98
99
100
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 98

def to_custom_uploaded_at
  DateTimeHelper.to_rfc3339(uploaded_at)
end

#to_sObject

Provides a human-readable string representation of the object.



103
104
105
106
107
108
# File 'lib/the_plaid_api/models/identity_document_metadata.rb', line 103

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} is_account_number_match: #{@is_account_number_match}, last_updated:"\
  " #{@last_updated}, uploaded_at: #{@uploaded_at}, additional_properties:"\
  " #{@additional_properties}>"
end