Class: FdxV660Api::RewardsTermsAndConditionsEntity2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::RewardsTermsAndConditionsEntity2
- Defined in:
- lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb
Overview
The PDFs or JSON data elements for the terms and conditions for the account's reward program (and reward categories, if any)
Instance Attribute Summary collapse
-
#base_earning ⇒ String
Rewards earned for base category transactions.
-
#base_points_calculation ⇒ String
Description of Base Points calculation.
-
#bonus_earning ⇒ String
Rewards earned during bonus period.
-
#cash_rewards ⇒ String
How to redeem Cash Rewards.
-
#expiration_rules ⇒ String
What are the rules for rewards expiration.
-
#fi_attributes ⇒ Array[FiAttributeEntity]
Array of Financial institution-specific attributes.
-
#forfeiture ⇒ String
What are the rules for rewards forfeiture.
-
#gift_card_rewards ⇒ String
How to redeem Gift Card Rewards.
-
#ineligible ⇒ String
What are the rules for transactions ineligible to earn points.
-
#minimum_redemption ⇒ String
What minimum balance is required for initial redemption options.
-
#points_calculation ⇒ String
Description of Points Calculation.
-
#points_expire ⇒ TrueClass | FalseClass
Whether earned rewards can expire.
-
#reward_program_id ⇒ String
Long term persistent identity of the reward program.
-
#reward_type ⇒ RewardType1
The type of the reward balance - CASHBACK, MILES, POINTS.
-
#travel_credit_rewards ⇒ String
How to redeem Travel Credit Rewards.
-
#uris ⇒ Array[TermsAndConditionsUriEntity]
Static public-facing URIs which return the reward program's 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(reward_program_id: SKIP, uris: SKIP, base_earning: SKIP, bonus_earning: SKIP, reward_type: SKIP, minimum_redemption: SKIP, points_expire: SKIP, expiration_rules: SKIP, forfeiture: SKIP, points_calculation: SKIP, base_points_calculation: SKIP, travel_credit_rewards: SKIP, cash_rewards: SKIP, gift_card_rewards: SKIP, ineligible: SKIP, fi_attributes: SKIP, additional_properties: nil) ⇒ RewardsTermsAndConditionsEntity2
constructor
A new instance of RewardsTermsAndConditionsEntity2.
-
#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(reward_program_id: SKIP, uris: SKIP, base_earning: SKIP, bonus_earning: SKIP, reward_type: SKIP, minimum_redemption: SKIP, points_expire: SKIP, expiration_rules: SKIP, forfeiture: SKIP, points_calculation: SKIP, base_points_calculation: SKIP, travel_credit_rewards: SKIP, cash_rewards: SKIP, gift_card_rewards: SKIP, ineligible: SKIP, fi_attributes: SKIP, additional_properties: nil) ⇒ RewardsTermsAndConditionsEntity2
Returns a new instance of RewardsTermsAndConditionsEntity2.
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 152 153 154 155 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 127 def initialize(reward_program_id: SKIP, uris: SKIP, base_earning: SKIP, bonus_earning: SKIP, reward_type: SKIP, minimum_redemption: SKIP, points_expire: SKIP, expiration_rules: SKIP, forfeiture: SKIP, points_calculation: SKIP, base_points_calculation: SKIP, travel_credit_rewards: SKIP, cash_rewards: SKIP, gift_card_rewards: SKIP, ineligible: SKIP, fi_attributes: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @reward_program_id = reward_program_id unless reward_program_id == SKIP @uris = uris unless uris == SKIP @base_earning = base_earning unless base_earning == SKIP @bonus_earning = bonus_earning unless bonus_earning == SKIP @reward_type = reward_type unless reward_type == SKIP @minimum_redemption = minimum_redemption unless minimum_redemption == SKIP @points_expire = points_expire unless points_expire == SKIP @expiration_rules = expiration_rules unless expiration_rules == SKIP @forfeiture = forfeiture unless forfeiture == SKIP @points_calculation = points_calculation unless points_calculation == SKIP @base_points_calculation = base_points_calculation unless base_points_calculation == SKIP @travel_credit_rewards = travel_credit_rewards unless travel_credit_rewards == SKIP @cash_rewards = cash_rewards unless cash_rewards == SKIP @gift_card_rewards = gift_card_rewards unless gift_card_rewards == SKIP @ineligible = ineligible unless ineligible == SKIP @fi_attributes = fi_attributes unless fi_attributes == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#base_earning ⇒ String
Rewards earned for base category transactions
24 25 26 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 24 def base_earning @base_earning end |
#base_points_calculation ⇒ String
Description of Base Points calculation
56 57 58 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 56 def base_points_calculation @base_points_calculation end |
#bonus_earning ⇒ String
Rewards earned during bonus period
28 29 30 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 28 def bonus_earning @bonus_earning end |
#cash_rewards ⇒ String
How to redeem Cash Rewards
64 65 66 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 64 def cash_rewards @cash_rewards end |
#expiration_rules ⇒ String
What are the rules for rewards expiration
44 45 46 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 44 def expiration_rules @expiration_rules end |
#fi_attributes ⇒ Array[FiAttributeEntity]
Array of Financial institution-specific attributes
76 77 78 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 76 def fi_attributes @fi_attributes end |
#forfeiture ⇒ String
What are the rules for rewards forfeiture
48 49 50 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 48 def forfeiture @forfeiture end |
#gift_card_rewards ⇒ String
How to redeem Gift Card Rewards
68 69 70 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 68 def gift_card_rewards @gift_card_rewards end |
#ineligible ⇒ String
What are the rules for transactions ineligible to earn points
72 73 74 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 72 def ineligible @ineligible end |
#minimum_redemption ⇒ String
What minimum balance is required for initial redemption options
36 37 38 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 36 def minimum_redemption @minimum_redemption end |
#points_calculation ⇒ String
Description of Points Calculation
52 53 54 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 52 def points_calculation @points_calculation end |
#points_expire ⇒ TrueClass | FalseClass
Whether earned rewards can expire
40 41 42 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 40 def points_expire @points_expire end |
#reward_program_id ⇒ String
Long term persistent identity of the reward program
15 16 17 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 15 def reward_program_id @reward_program_id end |
#reward_type ⇒ RewardType1
The type of the reward balance - CASHBACK, MILES, POINTS
32 33 34 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 32 def reward_type @reward_type end |
#travel_credit_rewards ⇒ String
How to redeem Travel Credit Rewards
60 61 62 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 60 def travel_credit_rewards @travel_credit_rewards end |
#uris ⇒ Array[TermsAndConditionsUriEntity]
Static public-facing URIs which return the reward program's terms and conditions as PDF files or web content
20 21 22 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 20 def uris @uris end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 158 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reward_program_id = hash.key?('rewardProgramId') ? hash['rewardProgramId'] : 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') base_earning = hash.key?('baseEarning') ? hash['baseEarning'] : SKIP bonus_earning = hash.key?('bonusEarning') ? hash['bonusEarning'] : SKIP reward_type = hash.key?('rewardType') ? hash['rewardType'] : SKIP minimum_redemption = hash.key?('minimumRedemption') ? hash['minimumRedemption'] : SKIP points_expire = hash.key?('pointsExpire') ? hash['pointsExpire'] : SKIP expiration_rules = hash.key?('expirationRules') ? hash['expirationRules'] : SKIP forfeiture = hash.key?('forfeiture') ? hash['forfeiture'] : SKIP points_calculation = hash.key?('pointsCalculation') ? hash['pointsCalculation'] : SKIP base_points_calculation = hash.key?('basePointsCalculation') ? hash['basePointsCalculation'] : SKIP travel_credit_rewards = hash.key?('travelCreditRewards') ? hash['travelCreditRewards'] : SKIP cash_rewards = hash.key?('cashRewards') ? hash['cashRewards'] : SKIP gift_card_rewards = hash.key?('giftCardRewards') ? hash['giftCardRewards'] : SKIP ineligible = hash.key?('ineligible') ? hash['ineligible'] : SKIP # 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. RewardsTermsAndConditionsEntity2.new(reward_program_id: reward_program_id, uris: uris, base_earning: base_earning, bonus_earning: bonus_earning, reward_type: reward_type, minimum_redemption: minimum_redemption, points_expire: points_expire, expiration_rules: expiration_rules, forfeiture: forfeiture, points_calculation: points_calculation, base_points_calculation: base_points_calculation, travel_credit_rewards: travel_credit_rewards, cash_rewards: cash_rewards, gift_card_rewards: gift_card_rewards, ineligible: ineligible, fi_attributes: fi_attributes, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 79 def self.names @_hash = {} if @_hash.nil? @_hash['reward_program_id'] = 'rewardProgramId' @_hash['uris'] = 'uris' @_hash['base_earning'] = 'baseEarning' @_hash['bonus_earning'] = 'bonusEarning' @_hash['reward_type'] = 'rewardType' @_hash['minimum_redemption'] = 'minimumRedemption' @_hash['points_expire'] = 'pointsExpire' @_hash['expiration_rules'] = 'expirationRules' @_hash['forfeiture'] = 'forfeiture' @_hash['points_calculation'] = 'pointsCalculation' @_hash['base_points_calculation'] = 'basePointsCalculation' @_hash['travel_credit_rewards'] = 'travelCreditRewards' @_hash['cash_rewards'] = 'cashRewards' @_hash['gift_card_rewards'] = 'giftCardRewards' @_hash['ineligible'] = 'ineligible' @_hash['fi_attributes'] = 'fiAttributes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
123 124 125 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 123 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 101 def self.optionals %w[ reward_program_id uris base_earning bonus_earning reward_type minimum_redemption points_expire expiration_rules forfeiture points_calculation base_points_calculation travel_credit_rewards cash_rewards gift_card_rewards ineligible fi_attributes ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
233 234 235 236 237 238 239 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 233 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 255 def inspect class_name = self.class.name.split('::').last "<#{class_name} reward_program_id: #{@reward_program_id.inspect}, uris: #{@uris.inspect},"\ " base_earning: #{@base_earning.inspect}, bonus_earning: #{@bonus_earning.inspect},"\ " reward_type: #{@reward_type.inspect}, minimum_redemption: #{@minimum_redemption.inspect},"\ " points_expire: #{@points_expire.inspect}, expiration_rules: #{@expiration_rules.inspect},"\ " forfeiture: #{@forfeiture.inspect}, points_calculation: #{@points_calculation.inspect},"\ " base_points_calculation: #{@base_points_calculation.inspect}, travel_credit_rewards:"\ " #{@travel_credit_rewards.inspect}, cash_rewards: #{@cash_rewards.inspect},"\ " gift_card_rewards: #{@gift_card_rewards.inspect}, ineligible: #{@ineligible.inspect},"\ " fi_attributes: #{@fi_attributes.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity2.rb', line 242 def to_s class_name = self.class.name.split('::').last "<#{class_name} reward_program_id: #{@reward_program_id}, uris: #{@uris}, base_earning:"\ " #{@base_earning}, bonus_earning: #{@bonus_earning}, reward_type: #{@reward_type},"\ " minimum_redemption: #{@minimum_redemption}, points_expire: #{@points_expire},"\ " expiration_rules: #{@expiration_rules}, forfeiture: #{@forfeiture}, points_calculation:"\ " #{@points_calculation}, base_points_calculation: #{@base_points_calculation},"\ " travel_credit_rewards: #{@travel_credit_rewards}, cash_rewards: #{@cash_rewards},"\ " gift_card_rewards: #{@gift_card_rewards}, ineligible: #{@ineligible}, fi_attributes:"\ " #{@fi_attributes}, additional_properties: #{@additional_properties}>" end |