Class: FdxV660Api::RewardsTermsAndConditionsEntity
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::RewardsTermsAndConditionsEntity
- Defined in:
- lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb
Overview
The terms and conditions data elements for the account rewards
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.
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) ⇒ RewardsTermsAndConditionsEntity
constructor
A new instance of RewardsTermsAndConditionsEntity.
-
#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) ⇒ RewardsTermsAndConditionsEntity
Returns a new instance of RewardsTermsAndConditionsEntity.
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 152 153 154 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 126 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
23 24 25 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 23 def base_earning @base_earning end |
#base_points_calculation ⇒ String
Description of Base Points calculation
55 56 57 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 55 def base_points_calculation @base_points_calculation end |
#bonus_earning ⇒ String
Rewards earned during bonus period
27 28 29 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 27 def bonus_earning @bonus_earning end |
#cash_rewards ⇒ String
How to redeem Cash Rewards
63 64 65 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 63 def cash_rewards @cash_rewards end |
#expiration_rules ⇒ String
What are the rules for rewards expiration
43 44 45 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 43 def expiration_rules @expiration_rules end |
#fi_attributes ⇒ Array[FiAttributeEntity]
Array of Financial institution-specific attributes
75 76 77 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 75 def fi_attributes @fi_attributes end |
#forfeiture ⇒ String
What are the rules for rewards forfeiture
47 48 49 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 47 def forfeiture @forfeiture end |
#gift_card_rewards ⇒ String
How to redeem Gift Card Rewards
67 68 69 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 67 def gift_card_rewards @gift_card_rewards end |
#ineligible ⇒ String
What are the rules for transactions ineligible to earn points
71 72 73 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 71 def ineligible @ineligible end |
#minimum_redemption ⇒ String
What minimum balance is required for initial redemption options
35 36 37 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 35 def minimum_redemption @minimum_redemption end |
#points_calculation ⇒ String
Description of Points Calculation
51 52 53 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 51 def points_calculation @points_calculation end |
#points_expire ⇒ TrueClass | FalseClass
Whether earned rewards can expire
39 40 41 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 39 def points_expire @points_expire end |
#reward_program_id ⇒ String
Long term persistent identity of the reward program
14 15 16 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 14 def reward_program_id @reward_program_id end |
#reward_type ⇒ RewardType1
The type of the reward balance - CASHBACK, MILES, POINTS
31 32 33 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 31 def reward_type @reward_type end |
#travel_credit_rewards ⇒ String
How to redeem Travel Credit Rewards
59 60 61 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 59 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
19 20 21 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 19 def uris @uris end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 157 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. RewardsTermsAndConditionsEntity.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.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 78 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
122 123 124 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 122 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 100 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 |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 244 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.
231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/fdx_v660_api/models/rewards_terms_and_conditions_entity.rb', line 231 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 |