Class: FdxV660Api::TermsAndConditionsCommonElements

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb

Overview

Base response entity for terms and conditions data elements shared among account types

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(effective_date: SKIP, arbitration_provision: SKIP, card_replacement_fee: 0, paper_statements_fee: 0, domestic_atm_fee: 0, foreign_atm_foreign_currency_advance_fee: 0, foreign_atm_us_dollar_advance_fee: 0, foreign_purchase_foreign_currency_fee: 0, transaction_limits: SKIP, promotions: SKIP, fi_attributes: SKIP, additional_properties: nil) ⇒ TermsAndConditionsCommonElements

Returns a new instance of TermsAndConditionsCommonElements.



107
108
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
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 107

def initialize(effective_date: SKIP, arbitration_provision: SKIP,
               card_replacement_fee: 0, paper_statements_fee: 0,
               domestic_atm_fee: 0,
               foreign_atm_foreign_currency_advance_fee: 0,
               foreign_atm_us_dollar_advance_fee: 0,
               foreign_purchase_foreign_currency_fee: 0,
               transaction_limits: SKIP, promotions: SKIP,
               fi_attributes: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @effective_date = effective_date unless effective_date == SKIP
  @arbitration_provision = arbitration_provision unless arbitration_provision == SKIP
  @card_replacement_fee = card_replacement_fee unless card_replacement_fee == SKIP
  @paper_statements_fee = paper_statements_fee unless paper_statements_fee == SKIP
  @domestic_atm_fee = domestic_atm_fee unless domestic_atm_fee == SKIP
  unless foreign_atm_foreign_currency_advance_fee == SKIP
    @foreign_atm_foreign_currency_advance_fee =
      foreign_atm_foreign_currency_advance_fee
  end
  unless foreign_atm_us_dollar_advance_fee == SKIP
    @foreign_atm_us_dollar_advance_fee =
      foreign_atm_us_dollar_advance_fee
  end
  unless foreign_purchase_foreign_currency_fee == SKIP
    @foreign_purchase_foreign_currency_fee =
      foreign_purchase_foreign_currency_fee
  end
  @transaction_limits = transaction_limits unless transaction_limits == SKIP
  @promotions = promotions unless promotions == SKIP
  @fi_attributes = fi_attributes unless fi_attributes == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#arbitration_provisionTrueClass | FalseClass

A terms and conditions clause that requires the parties to resolve their disputes through an arbitration process. If true, the terms and conditions have an Arbitration Provision

Returns:

  • (TrueClass | FalseClass)


21
22
23
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 21

def arbitration_provision
  @arbitration_provision
end

#card_replacement_feeFloat

Fee for replacement of debit or credit card (Rush order?). The value is zero if not charged on this account

Returns:

  • (Float)


26
27
28
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 26

def card_replacement_fee
  @card_replacement_fee
end

#domestic_atm_feeFloat

Fee for ATM withdrawal or advance in account-holder's own country and currency. The value is zero if not charged on this account

Returns:

  • (Float)


35
36
37
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 35

def domestic_atm_fee
  @domestic_atm_fee
end

#effective_dateDate

Date that the document or content became effective

Returns:

  • (Date)


15
16
17
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 15

def effective_date
  @effective_date
end

#fi_attributesArray[FiAttributeEntity]

Array of Financial institution-specific attributes

Returns:



63
64
65
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 63

def fi_attributes
  @fi_attributes
end

#foreign_atm_foreign_currency_advance_feeFloat

Fee for foreign transaction ATM withdrawal or advance in foreign currency. The value is zero if not charged on this account

Returns:

  • (Float)


40
41
42
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 40

def foreign_atm_foreign_currency_advance_fee
  @foreign_atm_foreign_currency_advance_fee
end

#foreign_atm_us_dollar_advance_feeFloat

Fee for foreign transaction ATM withdrawal or advance in US Dollars. The value is zero if not charged on this account

Returns:

  • (Float)


45
46
47
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 45

def foreign_atm_us_dollar_advance_fee
  @foreign_atm_us_dollar_advance_fee
end

#foreign_purchase_foreign_currency_feeFloat

Fee for foreign transaction purchase in foreign currency. The value is zero if not charged on this account

Returns:

  • (Float)


50
51
52
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 50

def foreign_purchase_foreign_currency_fee
  @foreign_purchase_foreign_currency_fee
end

#paper_statements_feeFloat

Fee for paper statements. The value is zero if not charged on this account

Returns:

  • (Float)


30
31
32
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 30

def paper_statements_fee
  @paper_statements_fee
end

#promotionsArray[PromotionEntity]

The promotions originally defined in Terms and Conditions or currently active on the account

Returns:



59
60
61
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 59

def promotions
  @promotions
end

#transaction_limitsArray[TransactionLimit]

The various maximum amounts on different types of account transactions

Returns:



54
55
56
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 54

def transaction_limits
  @transaction_limits
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 142

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  effective_date = hash.key?('effectiveDate') ? hash['effectiveDate'] : SKIP
  arbitration_provision =
    hash.key?('arbitrationProvision') ? hash['arbitrationProvision'] : SKIP
  card_replacement_fee = hash['cardReplacementFee'] ||= 0
  paper_statements_fee = hash['paperStatementsFee'] ||= 0
  domestic_atm_fee = hash['domesticAtmFee'] ||= 0
  foreign_atm_foreign_currency_advance_fee =
    hash['foreignAtmForeignCurrencyAdvanceFee'] ||= 0
  foreign_atm_us_dollar_advance_fee =
    hash['foreignAtmUsDollarAdvanceFee'] ||= 0
  foreign_purchase_foreign_currency_fee =
    hash['foreignPurchaseForeignCurrencyFee'] ||= 0
  # Parameter is an array, so we need to iterate through it
  transaction_limits = nil
  unless hash['transactionLimits'].nil?
    transaction_limits = []
    hash['transactionLimits'].each do |structure|
      transaction_limits << (TransactionLimit.from_hash(structure) if structure)
    end
  end

  transaction_limits = SKIP unless hash.key?('transactionLimits')
  # Parameter is an array, so we need to iterate through it
  promotions = nil
  unless hash['promotions'].nil?
    promotions = []
    hash['promotions'].each do |structure|
      promotions << (PromotionEntity.from_hash(structure) if structure)
    end
  end

  promotions = SKIP unless hash.key?('promotions')
  # Parameter is an array, so we need to iterate through it
  fi_attributes = nil
  unless hash['fiAttributes'].nil?
    fi_attributes = []
    hash['fiAttributes'].each do |structure|
      fi_attributes << (FiAttributeEntity.from_hash(structure) if structure)
    end
  end

  fi_attributes = SKIP unless hash.key?('fiAttributes')

  # 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.
  TermsAndConditionsCommonElements.new(effective_date: effective_date,
                                       arbitration_provision: arbitration_provision,
                                       card_replacement_fee: card_replacement_fee,
                                       paper_statements_fee: paper_statements_fee,
                                       domestic_atm_fee: domestic_atm_fee,
                                       foreign_atm_foreign_currency_advance_fee: foreign_atm_foreign_currency_advance_fee,
                                       foreign_atm_us_dollar_advance_fee: foreign_atm_us_dollar_advance_fee,
                                       foreign_purchase_foreign_currency_fee: foreign_purchase_foreign_currency_fee,
                                       transaction_limits: transaction_limits,
                                       promotions: promotions,
                                       fi_attributes: fi_attributes,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 66

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['effective_date'] = 'effectiveDate'
  @_hash['arbitration_provision'] = 'arbitrationProvision'
  @_hash['card_replacement_fee'] = 'cardReplacementFee'
  @_hash['paper_statements_fee'] = 'paperStatementsFee'
  @_hash['domestic_atm_fee'] = 'domesticAtmFee'
  @_hash['foreign_atm_foreign_currency_advance_fee'] =
    'foreignAtmForeignCurrencyAdvanceFee'
  @_hash['foreign_atm_us_dollar_advance_fee'] =
    'foreignAtmUsDollarAdvanceFee'
  @_hash['foreign_purchase_foreign_currency_fee'] =
    'foreignPurchaseForeignCurrencyFee'
  @_hash['transaction_limits'] = 'transactionLimits'
  @_hash['promotions'] = 'promotions'
  @_hash['fi_attributes'] = 'fiAttributes'
  @_hash
end

.nullablesObject

An array for nullable fields



103
104
105
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 103

def self.nullables
  []
end

.optionalsObject

An array for optional fields



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 86

def self.optionals
  %w[
    effective_date
    arbitration_provision
    card_replacement_fee
    paper_statements_fee
    domestic_atm_fee
    foreign_atm_foreign_currency_advance_fee
    foreign_atm_us_dollar_advance_fee
    foreign_purchase_foreign_currency_fee
    transaction_limits
    promotions
    fi_attributes
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 225

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} effective_date: #{@effective_date.inspect}, arbitration_provision:"\
  " #{@arbitration_provision.inspect}, card_replacement_fee: #{@card_replacement_fee.inspect},"\
  " paper_statements_fee: #{@paper_statements_fee.inspect}, domestic_atm_fee:"\
  " #{@domestic_atm_fee.inspect}, foreign_atm_foreign_currency_advance_fee:"\
  " #{@foreign_atm_foreign_currency_advance_fee.inspect}, foreign_atm_us_dollar_advance_fee:"\
  " #{@foreign_atm_us_dollar_advance_fee.inspect}, foreign_purchase_foreign_currency_fee:"\
  " #{@foreign_purchase_foreign_currency_fee.inspect}, transaction_limits:"\
  " #{@transaction_limits.inspect}, promotions: #{@promotions.inspect}, fi_attributes:"\
  " #{@fi_attributes.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



212
213
214
215
216
217
218
219
220
221
222
# File 'lib/fdx_v660_api/models/terms_and_conditions_common_elements.rb', line 212

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} effective_date: #{@effective_date}, arbitration_provision:"\
  " #{@arbitration_provision}, card_replacement_fee: #{@card_replacement_fee},"\
  " paper_statements_fee: #{@paper_statements_fee}, domestic_atm_fee: #{@domestic_atm_fee},"\
  " foreign_atm_foreign_currency_advance_fee: #{@foreign_atm_foreign_currency_advance_fee},"\
  " foreign_atm_us_dollar_advance_fee: #{@foreign_atm_us_dollar_advance_fee},"\
  " foreign_purchase_foreign_currency_fee: #{@foreign_purchase_foreign_currency_fee},"\
  " transaction_limits: #{@transaction_limits}, promotions: #{@promotions}, fi_attributes:"\
  " #{@fi_attributes}, additional_properties: #{@additional_properties}>"
end