Class: ShellCardManagementApIs::UsageRestrictionsCard
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::UsageRestrictionsCard
- Defined in:
- lib/shell_card_management_ap_is/models/usage_restrictions_card.rb
Overview
UsageRestrictionsCard Model.
Instance Attribute Summary collapse
-
#annual_spend ⇒ Float
Maximum spend value (amount) allowed per annum.
-
#annual_transaction_count ⇒ Float
Maximum number of transactions allowed per annum.
-
#annual_volume ⇒ Float
Maximum volume (quantity) allowed per annum.
-
#daily_spend ⇒ Float
Maximum spend value (amount) allowed per day.
-
#daily_transaction_count ⇒ Float
Maximum number of transactions allowed per day.
-
#daily_volume ⇒ Float
Maximum volume (quantity) allowed per day.
-
#life_time_spend ⇒ Float
Maximum spend value (amount) allowed in card’s life time.
-
#life_time_transaction_count ⇒ Float
Maximum number of transactions allowed in card’s lifetime.
-
#life_time_volume ⇒ Float
Maximum volume (quantity) allowed in card’s life time.
-
#monthly_spend ⇒ Float
Maximum spend value (amount) allowed per month.
-
#monthly_transaction_count ⇒ Float
Maximum number of transactions allowed per month.
-
#monthly_volume ⇒ Float
Maximum volume (quantity) allowed per month.
-
#per_transaction_spend ⇒ Float
Maximum spend value (amount) allowed per transaction.
-
#per_transaction_volume ⇒ Float
Maximum volume (quantity) allowed per transaction.
-
#weekly_spend ⇒ Float
Maximum spend value (amount) allowed per week.
-
#weekly_transaction_count ⇒ Float
Maximum number of transactions allowed per week.
-
#weekly_volume ⇒ Float
Maximum volume (quantity) allowed per week.
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
Methods inherited from BaseModel
Constructor Details
#initialize(daily_spend = SKIP, weekly_spend = SKIP, monthly_spend = SKIP, per_transaction_spend = SKIP, annual_spend = SKIP, life_time_spend = SKIP, daily_volume = SKIP, weekly_volume = SKIP, monthly_volume = SKIP, per_transaction_volume = SKIP, annual_volume = SKIP, life_time_volume = SKIP, daily_transaction_count = SKIP, weekly_transaction_count = SKIP, monthly_transaction_count = SKIP, annual_transaction_count = SKIP, life_time_transaction_count = SKIP) ⇒ UsageRestrictionsCard
Returns a new instance of UsageRestrictionsCard.
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 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 166 def initialize(daily_spend = SKIP, weekly_spend = SKIP, monthly_spend = SKIP, per_transaction_spend = SKIP, annual_spend = SKIP, life_time_spend = SKIP, daily_volume = SKIP, weekly_volume = SKIP, monthly_volume = SKIP, per_transaction_volume = SKIP, annual_volume = SKIP, life_time_volume = SKIP, daily_transaction_count = SKIP, weekly_transaction_count = SKIP, monthly_transaction_count = SKIP, annual_transaction_count = SKIP, life_time_transaction_count = SKIP) @daily_spend = daily_spend unless daily_spend == SKIP @weekly_spend = weekly_spend unless weekly_spend == SKIP @monthly_spend = monthly_spend unless monthly_spend == SKIP @per_transaction_spend = per_transaction_spend unless per_transaction_spend == SKIP @annual_spend = annual_spend unless annual_spend == SKIP @life_time_spend = life_time_spend unless life_time_spend == SKIP @daily_volume = daily_volume unless daily_volume == SKIP @weekly_volume = weekly_volume unless weekly_volume == SKIP @monthly_volume = monthly_volume unless monthly_volume == SKIP @per_transaction_volume = per_transaction_volume unless per_transaction_volume == SKIP @annual_volume = annual_volume unless annual_volume == SKIP @life_time_volume = life_time_volume unless life_time_volume == SKIP @daily_transaction_count = daily_transaction_count unless daily_transaction_count == SKIP @weekly_transaction_count = weekly_transaction_count unless weekly_transaction_count == SKIP unless monthly_transaction_count == SKIP @monthly_transaction_count = monthly_transaction_count end @annual_transaction_count = annual_transaction_count unless annual_transaction_count == SKIP unless life_time_transaction_count == SKIP @life_time_transaction_count = life_time_transaction_count end end |
Instance Attribute Details
#annual_spend ⇒ Float
Maximum spend value (amount) allowed per annum. Optional
38 39 40 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 38 def annual_spend @annual_spend end |
#annual_transaction_count ⇒ Float
Maximum number of transactions allowed per annum.
92 93 94 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 92 def annual_transaction_count @annual_transaction_count end |
#annual_volume ⇒ Float
Maximum volume (quantity) allowed per annum. Optional
68 69 70 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 68 def annual_volume @annual_volume end |
#daily_spend ⇒ Float
Maximum spend value (amount) allowed per day. Optional It allows null in the input field. If Values is passed as null, apply the card type limit. However, if the card type limit is NULL for the same field then No limit will be applied in Gateway.
18 19 20 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 18 def daily_spend @daily_spend end |
#daily_transaction_count ⇒ Float
Maximum number of transactions allowed per day. Optional
78 79 80 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 78 def daily_transaction_count @daily_transaction_count end |
#daily_volume ⇒ Float
Maximum volume (quantity) allowed per day. Optional
48 49 50 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 48 def daily_volume @daily_volume end |
#life_time_spend ⇒ Float
Maximum spend value (amount) allowed in card’s life time. Optional
43 44 45 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 43 def life_time_spend @life_time_spend end |
#life_time_transaction_count ⇒ Float
Maximum number of transactions allowed in card’s lifetime. Optional
97 98 99 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 97 def life_time_transaction_count @life_time_transaction_count end |
#life_time_volume ⇒ Float
Maximum volume (quantity) allowed in card’s life time. Optional
73 74 75 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 73 def life_time_volume @life_time_volume end |
#monthly_spend ⇒ Float
Maximum spend value (amount) allowed per month. Optional
28 29 30 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 28 def monthly_spend @monthly_spend end |
#monthly_transaction_count ⇒ Float
Maximum number of transactions allowed per month. Optional.
88 89 90 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 88 def monthly_transaction_count @monthly_transaction_count end |
#monthly_volume ⇒ Float
Maximum volume (quantity) allowed per month. Optional
58 59 60 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 58 def monthly_volume @monthly_volume end |
#per_transaction_spend ⇒ Float
Maximum spend value (amount) allowed per transaction. Optional
33 34 35 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 33 def per_transaction_spend @per_transaction_spend end |
#per_transaction_volume ⇒ Float
Maximum volume (quantity) allowed per transaction. Optional
63 64 65 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 63 def per_transaction_volume @per_transaction_volume end |
#weekly_spend ⇒ Float
Maximum spend value (amount) allowed per week. Optional
23 24 25 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 23 def weekly_spend @weekly_spend end |
#weekly_transaction_count ⇒ Float
Maximum number of transactions allowed per week. Optional
83 84 85 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 83 def weekly_transaction_count @weekly_transaction_count end |
#weekly_volume ⇒ Float
Maximum volume (quantity) allowed per week. Optional
53 54 55 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 53 def weekly_volume @weekly_volume end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 203 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. daily_spend = hash.key?('DailySpend') ? hash['DailySpend'] : SKIP weekly_spend = hash.key?('WeeklySpend') ? hash['WeeklySpend'] : SKIP monthly_spend = hash.key?('MonthlySpend') ? hash['MonthlySpend'] : SKIP per_transaction_spend = hash.key?('PerTransactionSpend') ? hash['PerTransactionSpend'] : SKIP annual_spend = hash.key?('AnnualSpend') ? hash['AnnualSpend'] : SKIP life_time_spend = hash.key?('LifeTimeSpend') ? hash['LifeTimeSpend'] : SKIP daily_volume = hash.key?('DailyVolume') ? hash['DailyVolume'] : SKIP weekly_volume = hash.key?('WeeklyVolume') ? hash['WeeklyVolume'] : SKIP monthly_volume = hash.key?('MonthlyVolume') ? hash['MonthlyVolume'] : SKIP per_transaction_volume = hash.key?('PerTransactionVolume') ? hash['PerTransactionVolume'] : SKIP annual_volume = hash.key?('AnnualVolume') ? hash['AnnualVolume'] : SKIP life_time_volume = hash.key?('LifeTimeVolume') ? hash['LifeTimeVolume'] : SKIP daily_transaction_count = hash.key?('DailyTransactionCount') ? hash['DailyTransactionCount'] : SKIP weekly_transaction_count = hash.key?('WeeklyTransactionCount') ? hash['WeeklyTransactionCount'] : SKIP monthly_transaction_count = hash.key?('MonthlyTransactionCount') ? hash['MonthlyTransactionCount'] : SKIP annual_transaction_count = hash.key?('AnnualTransactionCount') ? hash['AnnualTransactionCount'] : SKIP life_time_transaction_count = hash.key?('LifeTimeTransactionCount') ? hash['LifeTimeTransactionCount'] : SKIP # Create object from extracted values. UsageRestrictionsCard.new(daily_spend, weekly_spend, monthly_spend, per_transaction_spend, annual_spend, life_time_spend, daily_volume, weekly_volume, monthly_volume, per_transaction_volume, annual_volume, life_time_volume, daily_transaction_count, weekly_transaction_count, monthly_transaction_count, annual_transaction_count, life_time_transaction_count) end |
.names ⇒ Object
A mapping from model property names to API property names.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 100 def self.names @_hash = {} if @_hash.nil? @_hash['daily_spend'] = 'DailySpend' @_hash['weekly_spend'] = 'WeeklySpend' @_hash['monthly_spend'] = 'MonthlySpend' @_hash['per_transaction_spend'] = 'PerTransactionSpend' @_hash['annual_spend'] = 'AnnualSpend' @_hash['life_time_spend'] = 'LifeTimeSpend' @_hash['daily_volume'] = 'DailyVolume' @_hash['weekly_volume'] = 'WeeklyVolume' @_hash['monthly_volume'] = 'MonthlyVolume' @_hash['per_transaction_volume'] = 'PerTransactionVolume' @_hash['annual_volume'] = 'AnnualVolume' @_hash['life_time_volume'] = 'LifeTimeVolume' @_hash['daily_transaction_count'] = 'DailyTransactionCount' @_hash['weekly_transaction_count'] = 'WeeklyTransactionCount' @_hash['monthly_transaction_count'] = 'MonthlyTransactionCount' @_hash['annual_transaction_count'] = 'AnnualTransactionCount' @_hash['life_time_transaction_count'] = 'LifeTimeTransactionCount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 146 def self.nullables %w[ daily_spend weekly_spend monthly_spend per_transaction_spend annual_spend life_time_spend daily_volume weekly_volume monthly_volume annual_volume daily_transaction_count weekly_transaction_count monthly_transaction_count annual_transaction_count life_time_transaction_count ] end |
.optionals ⇒ Object
An array for optional fields
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/shell_card_management_ap_is/models/usage_restrictions_card.rb', line 123 def self.optionals %w[ daily_spend weekly_spend monthly_spend per_transaction_spend annual_spend life_time_spend daily_volume weekly_volume monthly_volume per_transaction_volume annual_volume life_time_volume daily_transaction_count weekly_transaction_count monthly_transaction_count annual_transaction_count life_time_transaction_count ] end |