Class: ThePlaidApi::TosAcceptanceMetadata

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

Overview

Metadata related to the acceptance of Terms of Service

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(agreement_accepted:, originator_ip_address:, agreement_accepted_at:, additional_properties: nil) ⇒ TosAcceptanceMetadata

Returns a new instance of TosAcceptanceMetadata.



45
46
47
48
49
50
51
52
53
54
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 45

def initialize(agreement_accepted:, originator_ip_address:,
               agreement_accepted_at:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @agreement_accepted = agreement_accepted
  @originator_ip_address = originator_ip_address
  @agreement_accepted_at = agreement_accepted_at
  @additional_properties = additional_properties
end

Instance Attribute Details

#agreement_acceptedTrueClass | FalseClass

Indicates whether the TOS agreement was accepted

Returns:

  • (TrueClass | FalseClass)


15
16
17
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 15

def agreement_accepted
  @agreement_accepted
end

#agreement_accepted_atDateTime

ISO8601 timestamp indicating when the originator accepted the TOS

Returns:

  • (DateTime)


24
25
26
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 24

def agreement_accepted_at
  @agreement_accepted_at
end

#originator_ip_addressString

The IP address of the originator when they accepted the TOS. Formatted as an IPv4 or IPv6 IP address

Returns:

  • (String)


20
21
22
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 20

def originator_ip_address
  @originator_ip_address
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 57

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  agreement_accepted =
    hash.key?('agreement_accepted') ? hash['agreement_accepted'] : nil
  originator_ip_address =
    hash.key?('originator_ip_address') ? hash['originator_ip_address'] : nil
  agreement_accepted_at = if hash.key?('agreement_accepted_at')
                            (DateTimeHelper.from_rfc3339(hash['agreement_accepted_at']) if hash['agreement_accepted_at'])
                          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.
  TosAcceptanceMetadata.new(agreement_accepted: agreement_accepted,
                            originator_ip_address: originator_ip_address,
                            agreement_accepted_at: agreement_accepted_at,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



27
28
29
30
31
32
33
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 27

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['agreement_accepted'] = 'agreement_accepted'
  @_hash['originator_ip_address'] = 'originator_ip_address'
  @_hash['agreement_accepted_at'] = 'agreement_accepted_at'
  @_hash
end

.nullablesObject

An array for nullable fields



41
42
43
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 41

def self.nullables
  []
end

.optionalsObject

An array for optional fields



36
37
38
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 36

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



96
97
98
99
100
101
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 96

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

#to_custom_agreement_accepted_atObject



83
84
85
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 83

def to_custom_agreement_accepted_at
  DateTimeHelper.to_rfc3339(agreement_accepted_at)
end

#to_sObject

Provides a human-readable string representation of the object.



88
89
90
91
92
93
# File 'lib/the_plaid_api/models/tos_acceptance_metadata.rb', line 88

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