Class: ThePlaidApi::PartnerEndCustomerCraPurposes

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

Overview

A map of permissible purposes to their corresponding use cases.

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(written_instruction: SKIP, extension_of_credit_or_account_review: SKIP, employment: SKIP, insurance_underwriting: SKIP, license_eligibility: SKIP, risk_assessment: SKIP, business_need_transaction: SKIP, business_need_account_review: SKIP, additional_properties: nil) ⇒ PartnerEndCustomerCraPurposes

Returns a new instance of PartnerEndCustomerCraPurposes.



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
103
104
105
106
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 78

def initialize(written_instruction: SKIP,
               extension_of_credit_or_account_review: SKIP,
               employment: SKIP, insurance_underwriting: SKIP,
               license_eligibility: SKIP, risk_assessment: SKIP,
               business_need_transaction: SKIP,
               business_need_account_review: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @written_instruction = written_instruction unless written_instruction == SKIP
  unless  == SKIP
    @extension_of_credit_or_account_review =
      
  end
  @employment = employment unless employment == SKIP
  @insurance_underwriting = insurance_underwriting unless insurance_underwriting == SKIP
  @license_eligibility = license_eligibility unless license_eligibility == SKIP
  @risk_assessment = risk_assessment unless risk_assessment == SKIP
  unless business_need_transaction == SKIP
    @business_need_transaction =
      business_need_transaction
  end
  unless  == SKIP
    @business_need_account_review =
      
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#business_need_account_reviewPartnerEndCustomerCraUseCases

The list of use cases associated with a given permissible purpose.



42
43
44
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 42

def 
  @business_need_account_review
end

#business_need_transactionPartnerEndCustomerCraUseCases

The list of use cases associated with a given permissible purpose.



38
39
40
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 38

def business_need_transaction
  @business_need_transaction
end

#employmentPartnerEndCustomerCraUseCases

The list of use cases associated with a given permissible purpose.



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

def employment
  @employment
end

#extension_of_credit_or_account_reviewPartnerEndCustomerCraUseCases

The list of use cases associated with a given permissible purpose.



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

def 
  @extension_of_credit_or_account_review
end

#insurance_underwritingPartnerEndCustomerCraUseCases

The list of use cases associated with a given permissible purpose.



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

def insurance_underwriting
  @insurance_underwriting
end

#license_eligibilityPartnerEndCustomerCraUseCases

The list of use cases associated with a given permissible purpose.



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

def license_eligibility
  @license_eligibility
end

#risk_assessmentPartnerEndCustomerCraUseCases

The list of use cases associated with a given permissible purpose.



34
35
36
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 34

def risk_assessment
  @risk_assessment
end

#written_instructionPartnerEndCustomerCraUseCases

The list of use cases associated with a given permissible purpose.



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

def written_instruction
  @written_instruction
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 109

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  written_instruction = PartnerEndCustomerCraUseCases.from_hash(hash['WRITTEN_INSTRUCTION']) if
    hash['WRITTEN_INSTRUCTION']
  if hash['EXTENSION_OF_CREDIT_OR_ACCOUNT_REVIEW']
     = PartnerEndCustomerCraUseCases.from_hash(hash['EXTENSION_OF_CREDIT_OR_ACCOUNT_REVIEW'])
  end
  employment = PartnerEndCustomerCraUseCases.from_hash(hash['EMPLOYMENT']) if
    hash['EMPLOYMENT']
  if hash['INSURANCE_UNDERWRITING']
    insurance_underwriting = PartnerEndCustomerCraUseCases.from_hash(hash['INSURANCE_UNDERWRITING'])
  end
  license_eligibility = PartnerEndCustomerCraUseCases.from_hash(hash['LICENSE_ELIGIBILITY']) if
    hash['LICENSE_ELIGIBILITY']
  risk_assessment = PartnerEndCustomerCraUseCases.from_hash(hash['RISK_ASSESSMENT']) if
    hash['RISK_ASSESSMENT']
  if hash['BUSINESS_NEED_TRANSACTION']
    business_need_transaction = PartnerEndCustomerCraUseCases.from_hash(hash['BUSINESS_NEED_TRANSACTION'])
  end
  if hash['BUSINESS_NEED_ACCOUNT_REVIEW']
     = PartnerEndCustomerCraUseCases.from_hash(hash['BUSINESS_NEED_ACCOUNT_REVIEW'])
  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.
  PartnerEndCustomerCraPurposes.new(written_instruction: written_instruction,
                                    extension_of_credit_or_account_review: ,
                                    employment: employment,
                                    insurance_underwriting: insurance_underwriting,
                                    license_eligibility: license_eligibility,
                                    risk_assessment: risk_assessment,
                                    business_need_transaction: business_need_transaction,
                                    business_need_account_review: ,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['written_instruction'] = 'WRITTEN_INSTRUCTION'
  @_hash['extension_of_credit_or_account_review'] =
    'EXTENSION_OF_CREDIT_OR_ACCOUNT_REVIEW'
  @_hash['employment'] = 'EMPLOYMENT'
  @_hash['insurance_underwriting'] = 'INSURANCE_UNDERWRITING'
  @_hash['license_eligibility'] = 'LICENSE_ELIGIBILITY'
  @_hash['risk_assessment'] = 'RISK_ASSESSMENT'
  @_hash['business_need_transaction'] = 'BUSINESS_NEED_TRANSACTION'
  @_hash['business_need_account_review'] = 'BUSINESS_NEED_ACCOUNT_REVIEW'
  @_hash
end

.nullablesObject

An array for nullable fields



74
75
76
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 74

def self.nullables
  []
end

.optionalsObject

An array for optional fields



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 60

def self.optionals
  %w[
    written_instruction
    extension_of_credit_or_account_review
    employment
    insurance_underwriting
    license_eligibility
    risk_assessment
    business_need_transaction
    business_need_account_review
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



165
166
167
168
169
170
171
172
173
174
175
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 165

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} written_instruction: #{@written_instruction.inspect},"\
  " extension_of_credit_or_account_review: #{@extension_of_credit_or_account_review.inspect},"\
  " employment: #{@employment.inspect}, insurance_underwriting:"\
  " #{@insurance_underwriting.inspect}, license_eligibility: #{@license_eligibility.inspect},"\
  " risk_assessment: #{@risk_assessment.inspect}, business_need_transaction:"\
  " #{@business_need_transaction.inspect}, business_need_account_review:"\
  " #{@business_need_account_review.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



154
155
156
157
158
159
160
161
162
# File 'lib/the_plaid_api/models/partner_end_customer_cra_purposes.rb', line 154

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} written_instruction: #{@written_instruction},"\
  " extension_of_credit_or_account_review: #{@extension_of_credit_or_account_review},"\
  " employment: #{@employment}, insurance_underwriting: #{@insurance_underwriting},"\
  " license_eligibility: #{@license_eligibility}, risk_assessment: #{@risk_assessment},"\
  " business_need_transaction: #{@business_need_transaction}, business_need_account_review:"\
  " #{@business_need_account_review}, additional_properties: #{@additional_properties}>"
end