Class: ThePlaidApi::PartnerEndCustomerBankAddendumAcceptance

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

Overview

The bank addendum acceptance for the end customer.

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(customer_accepted: SKIP, customer_ip_address: SKIP, customer_agreement_timestamp: SKIP, additional_properties: nil) ⇒ PartnerEndCustomerBankAddendumAcceptance

Returns a new instance of PartnerEndCustomerBankAddendumAcceptance.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/the_plaid_api/models/partner_end_customer_bank_addendum_acceptance.rb', line 50

def initialize(customer_accepted: SKIP, customer_ip_address: SKIP,
               customer_agreement_timestamp: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @customer_accepted = customer_accepted unless customer_accepted == SKIP
  @customer_ip_address = customer_ip_address unless customer_ip_address == SKIP
  unless customer_agreement_timestamp == SKIP
    @customer_agreement_timestamp =
      customer_agreement_timestamp
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#customer_acceptedTrueClass | FalseClass

Denotes whether the end customer has accepted the bank addendum terms.

Returns:

  • (TrueClass | FalseClass)


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

def customer_accepted
  @customer_accepted
end

#customer_agreement_timestampDateTime

The timestamp of when the end customer accepted the bank addendum in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (‘YYYY-MM-DDTHH:mm:ssZ`).

Returns:

  • (DateTime)


25
26
27
# File 'lib/the_plaid_api/models/partner_end_customer_bank_addendum_acceptance.rb', line 25

def customer_agreement_timestamp
  @customer_agreement_timestamp
end

#customer_ip_addressString

The IP address of the end customer when they accepted the bank addendum.

Returns:

  • (String)


19
20
21
# File 'lib/the_plaid_api/models/partner_end_customer_bank_addendum_acceptance.rb', line 19

def customer_ip_address
  @customer_ip_address
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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/partner_end_customer_bank_addendum_acceptance.rb', line 66

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  customer_accepted =
    hash.key?('customer_accepted') ? hash['customer_accepted'] : SKIP
  customer_ip_address =
    hash.key?('customer_ip_address') ? hash['customer_ip_address'] : SKIP
  customer_agreement_timestamp = if hash.key?('customer_agreement_timestamp')
                                   (DateTimeHelper.from_rfc3339(hash['customer_agreement_timestamp']) if hash['customer_agreement_timestamp'])
                                 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.
  PartnerEndCustomerBankAddendumAcceptance.new(customer_accepted: customer_accepted,
                                               customer_ip_address: customer_ip_address,
                                               customer_agreement_timestamp: customer_agreement_timestamp,
                                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['customer_accepted'] = 'customer_accepted'
  @_hash['customer_ip_address'] = 'customer_ip_address'
  @_hash['customer_agreement_timestamp'] = 'customer_agreement_timestamp'
  @_hash
end

.nullablesObject

An array for nullable fields



46
47
48
# File 'lib/the_plaid_api/models/partner_end_customer_bank_addendum_acceptance.rb', line 46

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    customer_accepted
    customer_ip_address
    customer_agreement_timestamp
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



107
108
109
110
111
112
113
# File 'lib/the_plaid_api/models/partner_end_customer_bank_addendum_acceptance.rb', line 107

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

#to_custom_customer_agreement_timestampObject



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

def to_custom_customer_agreement_timestamp
  DateTimeHelper.to_rfc3339(customer_agreement_timestamp)
end

#to_sObject

Provides a human-readable string representation of the object.



99
100
101
102
103
104
# File 'lib/the_plaid_api/models/partner_end_customer_bank_addendum_acceptance.rb', line 99

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