Class: FdxV660Api::BaseLineOfCreditAccountTermsAndConditions
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::BaseLineOfCreditAccountTermsAndConditions
- Defined in:
- lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb
Overview
Base type for initial and current terms and conditions for line of credit account
Instance Attribute Summary collapse
-
#account_category ⇒ AccountCategoryLineOfCreditType2
The specific Account types which have Loan or LOC Terms and Conditions.
-
#current ⇒ LineOfCreditAccountTermsAndConditionsEntity1
Any data elements which have been updated since original Terms and Conditions.
-
#initial ⇒ LineOfCreditAccountTermsAndConditionsEntity3
The initial Terms and Conditions for this loan or LOC account.
-
#product_id ⇒ String
Unique ID of the marketed product for which these are the Terms and Conditions.
-
#rewards_terms_and_conditions ⇒ RewardsTermsAndConditionsEntity2
The PDFs or JSON data elements for the terms and conditions for the account's reward program (and reward categories, if any).
-
#uris ⇒ Array[TermsAndConditionsUriEntity]
Static public-facing URIs which return initial or latest account terms and conditions as PDF files or web content.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(account_category:, product_id: SKIP, uris: SKIP, rewards_terms_and_conditions: SKIP, initial: SKIP, current: SKIP, additional_properties: nil) ⇒ BaseLineOfCreditAccountTermsAndConditions
constructor
A new instance of BaseLineOfCreditAccountTermsAndConditions.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(account_category:, product_id: SKIP, uris: SKIP, rewards_terms_and_conditions: SKIP, initial: SKIP, current: SKIP, additional_properties: nil) ⇒ BaseLineOfCreditAccountTermsAndConditions
Returns a new instance of BaseLineOfCreditAccountTermsAndConditions.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 69 def initialize(account_category:, product_id: SKIP, uris: SKIP, rewards_terms_and_conditions: SKIP, initial: SKIP, current: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @product_id = product_id unless product_id == SKIP @uris = uris unless uris == SKIP unless rewards_terms_and_conditions == SKIP @rewards_terms_and_conditions = rewards_terms_and_conditions end @account_category = account_category @initial = initial unless initial == SKIP @current = current unless current == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_category ⇒ AccountCategoryLineOfCreditType2
The specific Account types which have Loan or LOC Terms and Conditions
30 31 32 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 30 def account_category @account_category end |
#current ⇒ LineOfCreditAccountTermsAndConditionsEntity1
Any data elements which have been updated since original Terms and Conditions
39 40 41 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 39 def current @current end |
#initial ⇒ LineOfCreditAccountTermsAndConditionsEntity3
The initial Terms and Conditions for this loan or LOC account
34 35 36 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 34 def initial @initial end |
#product_id ⇒ String
Unique ID of the marketed product for which these are the Terms and Conditions
16 17 18 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 16 def product_id @product_id end |
#rewards_terms_and_conditions ⇒ RewardsTermsAndConditionsEntity2
The PDFs or JSON data elements for the terms and conditions for the account's reward program (and reward categories, if any)
26 27 28 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 26 def rewards_terms_and_conditions @rewards_terms_and_conditions end |
#uris ⇒ Array[TermsAndConditionsUriEntity]
Static public-facing URIs which return initial or latest account terms and conditions as PDF files or web content
21 22 23 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 21 def uris @uris end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_category = hash.key?('accountCategory') ? hash['accountCategory'] : nil product_id = hash.key?('productId') ? hash['productId'] : SKIP # Parameter is an array, so we need to iterate through it uris = nil unless hash['uris'].nil? uris = [] hash['uris'].each do |structure| uris << (TermsAndConditionsUriEntity.from_hash(structure) if structure) end end uris = SKIP unless hash.key?('uris') if hash['rewardsTermsAndConditions'] rewards_terms_and_conditions = RewardsTermsAndConditionsEntity2.from_hash(hash['rewardsTermsAndConditions']) end initial = LineOfCreditAccountTermsAndConditionsEntity3.from_hash(hash['initial']) if hash['initial'] current = LineOfCreditAccountTermsAndConditionsEntity1.from_hash(hash['current']) if hash['current'] # 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. BaseLineOfCreditAccountTermsAndConditions.new(account_category: account_category, product_id: product_id, uris: uris, rewards_terms_and_conditions: rewards_terms_and_conditions, initial: initial, current: current, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['product_id'] = 'productId' @_hash['uris'] = 'uris' @_hash['rewards_terms_and_conditions'] = 'rewardsTermsAndConditions' @_hash['account_category'] = 'accountCategory' @_hash['initial'] = 'initial' @_hash['current'] = 'current' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 54 def self.optionals %w[ product_id uris rewards_terms_and_conditions initial current ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 132 def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.account_category, ->(val) { AccountCategoryLineOfCreditType2.validate(val) }) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['accountCategory'], ->(val) { AccountCategoryLineOfCreditType2.validate(val) }) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
153 154 155 156 157 158 159 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 153 def inspect class_name = self.class.name.split('::').last "<#{class_name} product_id: #{@product_id.inspect}, uris: #{@uris.inspect},"\ " rewards_terms_and_conditions: #{@rewards_terms_and_conditions.inspect}, account_category:"\ " #{@account_category.inspect}, initial: #{@initial.inspect}, current: #{@current.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
145 146 147 148 149 150 |
# File 'lib/fdx_v660_api/models/base_line_of_credit_account_terms_and_conditions.rb', line 145 def to_s class_name = self.class.name.split('::').last "<#{class_name} product_id: #{@product_id}, uris: #{@uris}, rewards_terms_and_conditions:"\ " #{@rewards_terms_and_conditions}, account_category: #{@account_category}, initial:"\ " #{@initial}, current: #{@current}, additional_properties: #{@additional_properties}>" end |