Class: Brevo::MainReward
- Inherits:
-
Object
- Object
- Brevo::MainReward
- Defined in:
- lib/brevo/models/main_reward.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#attribution_per_consumer ⇒ Object
Maximum number of times a consumer can be attributed this reward.
-
#balance_definition_id ⇒ Object
Unique identifier for the balance definition.
-
#code ⇒ Object
Unique code for the reward.
-
#code_count ⇒ Object
Total number of codes generated.
-
#code_generator_id ⇒ Object
Unique identifier for the code generator.
-
#code_pool_id ⇒ Object
Unique identifier for the code pool.
-
#config ⇒ Object
Configuration settings for the reward.
-
#created_at ⇒ Object
Timestamp when the reward was created.
-
#disabled_at ⇒ Object
Disabled date of the reward.
-
#end_date ⇒ Object
End date of the reward validity.
-
#expiration_date ⇒ Object
Expiration date of the reward.
-
#expiration_modifier ⇒ Object
Select startOfPeriod to configure rewards expiry on start of day/week/month/year.
-
#expiration_unit ⇒ Object
Unit of time for the rewards’s availability (e.g., day/week/month/year).
-
#expiration_value ⇒ Object
Number of days/weeks/month/year for reward expiry.
-
#generator ⇒ Object
Returns the value of attribute generator.
-
#id ⇒ Object
Unique identifier for the reward.
-
#limits ⇒ Object
Attribution / Redeem Limits for the reward.
-
#loyalty_program_id ⇒ Object
Id of the loyalty program to which the current reward belongs to.
-
#meta ⇒ Object
Additional data for reward definition.
-
#name ⇒ Object
Name of the reward.
-
#products ⇒ Object
Selected products for reward definition.
-
#public_description ⇒ Object
Public description for the reward.
-
#public_image ⇒ Object
Public Image for the reward.
-
#public_name ⇒ Object
Public name for the reward.
-
#redeem_per_consumer ⇒ Object
Defines the redeem limit for the consumer.
-
#redeem_rules ⇒ Object
Rules defined to redeem a reward.
-
#reward_configs ⇒ Object
Returns the value of attribute reward_configs.
-
#rule ⇒ Object
Returns the value of attribute rule.
-
#start_date ⇒ Object
Start date of attribution of the reward.
-
#subtract_balance_definition_id ⇒ Object
Id of the selected balance while redeeming / attributing a reward.
-
#subtract_balance_strategy ⇒ Object
Strategy of the Balance while redeeming / attributing a reward.
-
#subtract_balance_value ⇒ Object
Amount of balance to be selected while redeeming / attributing a reward.
-
#subtract_total_balance ⇒ Object
Value to indicate to subtract full balance or not.
-
#total_attribution ⇒ Object
Defines the limit to which a consumer can attribute a reward.
-
#total_redeem ⇒ Object
Defines the limit to which a consumer can redeem a reward.
-
#trigger_id ⇒ Object
Id of the Rule to be updated for that reward.
-
#unit ⇒ Object
Selected unit of the balance.
-
#updated_at ⇒ Object
Timestamp for when this reward was last updated.
-
#value ⇒ Object
Value of metric in selected config for reward definition.
-
#value_type ⇒ Object
Type of config selected for reward definition.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ MainReward
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ MainReward
Initializes the object
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
# File 'lib/brevo/models/main_reward.rb', line 250 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'attributionPerConsumer') self.attribution_per_consumer = attributes[:'attributionPerConsumer'] end if attributes.has_key?(:'balanceDefinitionId') self.balance_definition_id = attributes[:'balanceDefinitionId'] end if attributes.has_key?(:'code') self.code = attributes[:'code'] end if attributes.has_key?(:'codeCount') self.code_count = attributes[:'codeCount'] end if attributes.has_key?(:'codeGeneratorId') self.code_generator_id = attributes[:'codeGeneratorId'] end if attributes.has_key?(:'codePoolId') self.code_pool_id = attributes[:'codePoolId'] end if attributes.has_key?(:'config') self.config = attributes[:'config'] end if attributes.has_key?(:'createdAt') self.created_at = attributes[:'createdAt'] end if attributes.has_key?(:'disabledAt') self.disabled_at = attributes[:'disabledAt'] end if attributes.has_key?(:'endDate') self.end_date = attributes[:'endDate'] end if attributes.has_key?(:'expirationDate') self.expiration_date = attributes[:'expirationDate'] end if attributes.has_key?(:'expirationModifier') self.expiration_modifier = attributes[:'expirationModifier'] else self.expiration_modifier = 'noModification' end if attributes.has_key?(:'expirationUnit') self.expiration_unit = attributes[:'expirationUnit'] end if attributes.has_key?(:'expirationValue') self.expiration_value = attributes[:'expirationValue'] end if attributes.has_key?(:'generator') self.generator = attributes[:'generator'] end if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'limits') if (value = attributes[:'limits']).is_a?(Array) self.limits = value end end if attributes.has_key?(:'loyaltyProgramId') self.loyalty_program_id = attributes[:'loyaltyProgramId'] end if attributes.has_key?(:'meta') if (value = attributes[:'meta']).is_a?(Hash) self. = value end end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'products') if (value = attributes[:'products']).is_a?(Array) self.products = value end end if attributes.has_key?(:'publicDescription') self.public_description = attributes[:'publicDescription'] end if attributes.has_key?(:'publicImage') self.public_image = attributes[:'publicImage'] end if attributes.has_key?(:'publicName') self.public_name = attributes[:'publicName'] end if attributes.has_key?(:'redeemPerConsumer') self.redeem_per_consumer = attributes[:'redeemPerConsumer'] end if attributes.has_key?(:'redeemRules') if (value = attributes[:'redeemRules']).is_a?(Array) self.redeem_rules = value end end if attributes.has_key?(:'rewardConfigs') self.reward_configs = attributes[:'rewardConfigs'] end if attributes.has_key?(:'rule') self.rule = attributes[:'rule'] end if attributes.has_key?(:'startDate') self.start_date = attributes[:'startDate'] end if attributes.has_key?(:'subtractBalanceDefinitionId') self.subtract_balance_definition_id = attributes[:'subtractBalanceDefinitionId'] end if attributes.has_key?(:'subtractBalanceStrategy') self.subtract_balance_strategy = attributes[:'subtractBalanceStrategy'] end if attributes.has_key?(:'subtractBalanceValue') self.subtract_balance_value = attributes[:'subtractBalanceValue'] end if attributes.has_key?(:'subtractTotalBalance') self.subtract_total_balance = attributes[:'subtractTotalBalance'] end if attributes.has_key?(:'totalAttribution') self.total_attribution = attributes[:'totalAttribution'] end if attributes.has_key?(:'totalRedeem') self.total_redeem = attributes[:'totalRedeem'] end if attributes.has_key?(:'triggerId') self.trigger_id = attributes[:'triggerId'] end if attributes.has_key?(:'unit') self.unit = attributes[:'unit'] end if attributes.has_key?(:'updatedAt') self.updated_at = attributes[:'updatedAt'] end if attributes.has_key?(:'value') self.value = attributes[:'value'] end if attributes.has_key?(:'valueType') self.value_type = attributes[:'valueType'] end end |
Instance Attribute Details
#attribution_per_consumer ⇒ Object
Maximum number of times a consumer can be attributed this reward
18 19 20 |
# File 'lib/brevo/models/main_reward.rb', line 18 def attribution_per_consumer @attribution_per_consumer end |
#balance_definition_id ⇒ Object
Unique identifier for the balance definition
21 22 23 |
# File 'lib/brevo/models/main_reward.rb', line 21 def balance_definition_id @balance_definition_id end |
#code ⇒ Object
Unique code for the reward
24 25 26 |
# File 'lib/brevo/models/main_reward.rb', line 24 def code @code end |
#code_count ⇒ Object
Total number of codes generated
27 28 29 |
# File 'lib/brevo/models/main_reward.rb', line 27 def code_count @code_count end |
#code_generator_id ⇒ Object
Unique identifier for the code generator
30 31 32 |
# File 'lib/brevo/models/main_reward.rb', line 30 def code_generator_id @code_generator_id end |
#code_pool_id ⇒ Object
Unique identifier for the code pool
33 34 35 |
# File 'lib/brevo/models/main_reward.rb', line 33 def code_pool_id @code_pool_id end |
#config ⇒ Object
Configuration settings for the reward
36 37 38 |
# File 'lib/brevo/models/main_reward.rb', line 36 def config @config end |
#created_at ⇒ Object
Timestamp when the reward was created
39 40 41 |
# File 'lib/brevo/models/main_reward.rb', line 39 def created_at @created_at end |
#disabled_at ⇒ Object
Disabled date of the reward
42 43 44 |
# File 'lib/brevo/models/main_reward.rb', line 42 def disabled_at @disabled_at end |
#end_date ⇒ Object
End date of the reward validity
45 46 47 |
# File 'lib/brevo/models/main_reward.rb', line 45 def end_date @end_date end |
#expiration_date ⇒ Object
Expiration date of the reward
48 49 50 |
# File 'lib/brevo/models/main_reward.rb', line 48 def expiration_date @expiration_date end |
#expiration_modifier ⇒ Object
Select startOfPeriod to configure rewards expiry on start of day/week/month/year. Select endOfPeriod to configure reward expiry on end of day/week/month/year, else select noModification
51 52 53 |
# File 'lib/brevo/models/main_reward.rb', line 51 def expiration_modifier @expiration_modifier end |
#expiration_unit ⇒ Object
Unit of time for the rewards’s availability (e.g., day/week/month/year).
54 55 56 |
# File 'lib/brevo/models/main_reward.rb', line 54 def expiration_unit @expiration_unit end |
#expiration_value ⇒ Object
Number of days/weeks/month/year for reward expiry
57 58 59 |
# File 'lib/brevo/models/main_reward.rb', line 57 def expiration_value @expiration_value end |
#generator ⇒ Object
Returns the value of attribute generator.
59 60 61 |
# File 'lib/brevo/models/main_reward.rb', line 59 def generator @generator end |
#id ⇒ Object
Unique identifier for the reward
62 63 64 |
# File 'lib/brevo/models/main_reward.rb', line 62 def id @id end |
#limits ⇒ Object
Attribution / Redeem Limits for the reward
65 66 67 |
# File 'lib/brevo/models/main_reward.rb', line 65 def limits @limits end |
#loyalty_program_id ⇒ Object
Id of the loyalty program to which the current reward belongs to
68 69 70 |
# File 'lib/brevo/models/main_reward.rb', line 68 def loyalty_program_id @loyalty_program_id end |
#meta ⇒ Object
Additional data for reward definition
71 72 73 |
# File 'lib/brevo/models/main_reward.rb', line 71 def @meta end |
#name ⇒ Object
Name of the reward
74 75 76 |
# File 'lib/brevo/models/main_reward.rb', line 74 def name @name end |
#products ⇒ Object
Selected products for reward definition
77 78 79 |
# File 'lib/brevo/models/main_reward.rb', line 77 def products @products end |
#public_description ⇒ Object
Public description for the reward
80 81 82 |
# File 'lib/brevo/models/main_reward.rb', line 80 def public_description @public_description end |
#public_image ⇒ Object
Public Image for the reward
83 84 85 |
# File 'lib/brevo/models/main_reward.rb', line 83 def public_image @public_image end |
#public_name ⇒ Object
Public name for the reward
86 87 88 |
# File 'lib/brevo/models/main_reward.rb', line 86 def public_name @public_name end |
#redeem_per_consumer ⇒ Object
Defines the redeem limit for the consumer
89 90 91 |
# File 'lib/brevo/models/main_reward.rb', line 89 def redeem_per_consumer @redeem_per_consumer end |
#redeem_rules ⇒ Object
Rules defined to redeem a reward
92 93 94 |
# File 'lib/brevo/models/main_reward.rb', line 92 def redeem_rules @redeem_rules end |
#reward_configs ⇒ Object
Returns the value of attribute reward_configs.
94 95 96 |
# File 'lib/brevo/models/main_reward.rb', line 94 def reward_configs @reward_configs end |
#rule ⇒ Object
Returns the value of attribute rule.
96 97 98 |
# File 'lib/brevo/models/main_reward.rb', line 96 def rule @rule end |
#start_date ⇒ Object
Start date of attribution of the reward
99 100 101 |
# File 'lib/brevo/models/main_reward.rb', line 99 def start_date @start_date end |
#subtract_balance_definition_id ⇒ Object
Id of the selected balance while redeeming / attributing a reward
102 103 104 |
# File 'lib/brevo/models/main_reward.rb', line 102 def subtract_balance_definition_id @subtract_balance_definition_id end |
#subtract_balance_strategy ⇒ Object
Strategy of the Balance while redeeming / attributing a reward
105 106 107 |
# File 'lib/brevo/models/main_reward.rb', line 105 def subtract_balance_strategy @subtract_balance_strategy end |
#subtract_balance_value ⇒ Object
Amount of balance to be selected while redeeming / attributing a reward
108 109 110 |
# File 'lib/brevo/models/main_reward.rb', line 108 def subtract_balance_value @subtract_balance_value end |
#subtract_total_balance ⇒ Object
Value to indicate to subtract full balance or not
111 112 113 |
# File 'lib/brevo/models/main_reward.rb', line 111 def subtract_total_balance @subtract_total_balance end |
#total_attribution ⇒ Object
Defines the limit to which a consumer can attribute a reward
114 115 116 |
# File 'lib/brevo/models/main_reward.rb', line 114 def total_attribution @total_attribution end |
#total_redeem ⇒ Object
Defines the limit to which a consumer can redeem a reward
117 118 119 |
# File 'lib/brevo/models/main_reward.rb', line 117 def total_redeem @total_redeem end |
#trigger_id ⇒ Object
Id of the Rule to be updated for that reward
120 121 122 |
# File 'lib/brevo/models/main_reward.rb', line 120 def trigger_id @trigger_id end |
#unit ⇒ Object
Selected unit of the balance
123 124 125 |
# File 'lib/brevo/models/main_reward.rb', line 123 def unit @unit end |
#updated_at ⇒ Object
Timestamp for when this reward was last updated.
126 127 128 |
# File 'lib/brevo/models/main_reward.rb', line 126 def updated_at @updated_at end |
#value ⇒ Object
Value of metric in selected config for reward definition
129 130 131 |
# File 'lib/brevo/models/main_reward.rb', line 129 def value @value end |
#value_type ⇒ Object
Type of config selected for reward definition
132 133 134 |
# File 'lib/brevo/models/main_reward.rb', line 132 def value_type @value_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/brevo/models/main_reward.rb', line 157 def self.attribute_map { :'attribution_per_consumer' => :'attributionPerConsumer', :'balance_definition_id' => :'balanceDefinitionId', :'code' => :'code', :'code_count' => :'codeCount', :'code_generator_id' => :'codeGeneratorId', :'code_pool_id' => :'codePoolId', :'config' => :'config', :'created_at' => :'createdAt', :'disabled_at' => :'disabledAt', :'end_date' => :'endDate', :'expiration_date' => :'expirationDate', :'expiration_modifier' => :'expirationModifier', :'expiration_unit' => :'expirationUnit', :'expiration_value' => :'expirationValue', :'generator' => :'generator', :'id' => :'id', :'limits' => :'limits', :'loyalty_program_id' => :'loyaltyProgramId', :'meta' => :'meta', :'name' => :'name', :'products' => :'products', :'public_description' => :'publicDescription', :'public_image' => :'publicImage', :'public_name' => :'publicName', :'redeem_per_consumer' => :'redeemPerConsumer', :'redeem_rules' => :'redeemRules', :'reward_configs' => :'rewardConfigs', :'rule' => :'rule', :'start_date' => :'startDate', :'subtract_balance_definition_id' => :'subtractBalanceDefinitionId', :'subtract_balance_strategy' => :'subtractBalanceStrategy', :'subtract_balance_value' => :'subtractBalanceValue', :'subtract_total_balance' => :'subtractTotalBalance', :'total_attribution' => :'totalAttribution', :'total_redeem' => :'totalRedeem', :'trigger_id' => :'triggerId', :'unit' => :'unit', :'updated_at' => :'updatedAt', :'value' => :'value', :'value_type' => :'valueType' } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/brevo/models/main_reward.rb', line 203 def self.swagger_types { :'attribution_per_consumer' => :'Integer', :'balance_definition_id' => :'String', :'code' => :'String', :'code_count' => :'Integer', :'code_generator_id' => :'String', :'code_pool_id' => :'String', :'config' => :'String', :'created_at' => :'DateTime', :'disabled_at' => :'DateTime', :'end_date' => :'DateTime', :'expiration_date' => :'DateTime', :'expiration_modifier' => :'String', :'expiration_unit' => :'String', :'expiration_value' => :'Integer', :'generator' => :'MainRewardGenerator', :'id' => :'String', :'limits' => :'Array<MainLimit>', :'loyalty_program_id' => :'String', :'meta' => :'Hash<String, Object>', :'name' => :'String', :'products' => :'Array<MainProduct>', :'public_description' => :'String', :'public_image' => :'String', :'public_name' => :'String', :'redeem_per_consumer' => :'Integer', :'redeem_rules' => :'Array<String>', :'reward_configs' => :'MainRewardGenerator', :'rule' => :'MainRewardRule', :'start_date' => :'DateTime', :'subtract_balance_definition_id' => :'String', :'subtract_balance_strategy' => :'String', :'subtract_balance_value' => :'Integer', :'subtract_total_balance' => :'BOOLEAN', :'total_attribution' => :'Integer', :'total_redeem' => :'Integer', :'trigger_id' => :'String', :'unit' => :'String', :'updated_at' => :'String', :'value' => :'Float', :'value_type' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
# File 'lib/brevo/models/main_reward.rb', line 454 def ==(o) return true if self.equal?(o) self.class == o.class && attribution_per_consumer == o.attribution_per_consumer && balance_definition_id == o.balance_definition_id && code == o.code && code_count == o.code_count && code_generator_id == o.code_generator_id && code_pool_id == o.code_pool_id && config == o.config && created_at == o.created_at && disabled_at == o.disabled_at && end_date == o.end_date && expiration_date == o.expiration_date && expiration_modifier == o.expiration_modifier && expiration_unit == o.expiration_unit && expiration_value == o.expiration_value && generator == o.generator && id == o.id && limits == o.limits && loyalty_program_id == o.loyalty_program_id && == o. && name == o.name && products == o.products && public_description == o.public_description && public_image == o.public_image && public_name == o.public_name && redeem_per_consumer == o.redeem_per_consumer && redeem_rules == o.redeem_rules && reward_configs == o.reward_configs && rule == o.rule && start_date == o.start_date && subtract_balance_definition_id == o.subtract_balance_definition_id && subtract_balance_strategy == o.subtract_balance_strategy && subtract_balance_value == o.subtract_balance_value && subtract_total_balance == o.subtract_total_balance && total_attribution == o.total_attribution && total_redeem == o.total_redeem && trigger_id == o.trigger_id && unit == o.unit && updated_at == o.updated_at && value == o.value && value_type == o.value_type end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
# File 'lib/brevo/models/main_reward.rb', line 535 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = Brevo.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/brevo/models/main_reward.rb', line 601 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/brevo/models/main_reward.rb', line 514 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
501 502 503 |
# File 'lib/brevo/models/main_reward.rb', line 501 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
507 508 509 |
# File 'lib/brevo/models/main_reward.rb', line 507 def hash [attribution_per_consumer, balance_definition_id, code, code_count, code_generator_id, code_pool_id, config, created_at, disabled_at, end_date, expiration_date, expiration_modifier, expiration_unit, expiration_value, generator, id, limits, loyalty_program_id, , name, products, public_description, public_image, public_name, redeem_per_consumer, redeem_rules, reward_configs, rule, start_date, subtract_balance_definition_id, subtract_balance_strategy, subtract_balance_value, subtract_total_balance, total_attribution, total_redeem, trigger_id, unit, updated_at, value, value_type].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
429 430 431 432 |
# File 'lib/brevo/models/main_reward.rb', line 429 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
581 582 583 |
# File 'lib/brevo/models/main_reward.rb', line 581 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
587 588 589 590 591 592 593 594 595 |
# File 'lib/brevo/models/main_reward.rb', line 587 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
575 576 577 |
# File 'lib/brevo/models/main_reward.rb', line 575 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
436 437 438 439 440 |
# File 'lib/brevo/models/main_reward.rb', line 436 def valid? expiration_modifier_validator = EnumAttributeValidator.new('String', ['startOfPeriod', 'endOfPeriod', 'noModification']) return false unless expiration_modifier_validator.valid?(@expiration_modifier) true end |