Class: GrowsurfRuby::Models::Campaign::Reward
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- GrowsurfRuby::Models::Campaign::Reward
- Defined in:
- lib/growsurf_ruby/models/campaign/reward.rb,
sig/growsurf_ruby/models/campaign/reward.rbs
Overview
Defined Under Namespace
Modules: Event, LimitDuration, Type
Instance Attribute Summary collapse
- #commission_structure ⇒ GrowsurfRuby::Models::CommissionStructure?
- #conversions_required ⇒ Integer?
-
#coupon_code ⇒ String?
Legacy static coupon code shown to the referrer in the reward-won email and webhook.
- #description ⇒ String?
-
#event ⇒ Symbol, ...
The referral event that earns this Campaign Reward.
- #id ⇒ String
- #image_url ⇒ String?
- #is_unlimited ⇒ Boolean
-
#is_visible ⇒ Boolean?
Whether the reward is enabled.
-
#limit ⇒ Integer?
-1represents an unlimited reward in REST responses. - #limit_duration ⇒ Symbol, ...
-
#metadata ⇒ Hash{Symbol=>Object}
Shallow custom metadata object.
-
#next_milestone_prefix ⇒ String?
Text shown before a participant's referral count in milestone-progress copy.
-
#next_milestone_suffix ⇒ String?
Text shown after a participant's referral count in milestone-progress copy.
-
#number_of_winners ⇒ Integer?
The number of winners (
LEADERBOARDrewards only). - #order ⇒ Integer?
-
#referral_coupon_code ⇒ String?
Legacy static coupon code shown to the referred friend (double-sided rewards) in the reward-won email and webhook.
- #referral_description ⇒ String?
- #referred_reward_upfront ⇒ Boolean?
-
#referred_value ⇒ GrowsurfRuby::Models::RewardTaxValuation?
Tax treatment override for the referred friend's side of a double-sided reward.
-
#title ⇒ String?
The reward title (internal label).
- #type ⇒ Symbol, GrowsurfRuby::Models::Campaign::Reward::Type
-
#value ⇒ GrowsurfRuby::Models::RewardTaxValuation?
Tax valuation for the reward (the referrer's side of a double-sided reward).
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, is_unlimited:, metadata:, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_visible: nil, limit: nil, limit_duration: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil) ⇒ Object constructor
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(id:, is_unlimited:, metadata:, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_visible: nil, limit: nil, limit_duration: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil) ⇒ Object
|
|
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 156
|
Instance Attribute Details
#commission_structure ⇒ GrowsurfRuby::Models::CommissionStructure?
32 33 34 35 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 32 optional :commission_structure, -> { GrowsurfRuby::CommissionStructure }, api_name: :commissionStructure, nil?: true |
#conversions_required ⇒ Integer?
40 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 40 optional :conversions_required, Integer, api_name: :conversionsRequired, nil?: true |
#coupon_code ⇒ String?
Legacy static coupon code shown to the referrer in the reward-won email and webhook. Display text only; superseded by a connected billing integration's issued coupon when one exists.
48 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 48 optional :coupon_code, String, api_name: :couponCode, nil?: true |
#description ⇒ String?
53 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 53 optional :description, String, nil?: true |
#event ⇒ Symbol, ...
The referral event that earns this Campaign Reward. Present only for
SINGLE_SIDED, DOUBLE_SIDED, and MILESTONE rewards. Legacy Campaign
Rewards return CONVERSION.
61 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 61 optional :event, enum: -> { GrowsurfRuby::Campaign::Reward::Event }, nil?: true |
#id ⇒ String
11 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 11 required :id, String |
#image_url ⇒ String?
66 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 66 optional :image_url, String, api_name: :imageUrl, nil?: true |
#is_unlimited ⇒ Boolean
16 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 16 required :is_unlimited, GrowsurfRuby::Internal::Type::Boolean, api_name: :isUnlimited |
#is_visible ⇒ Boolean?
Whether the reward is enabled. When false the reward is disabled: hidden from
participants and no longer awarded, including those who already earned it.
73 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 73 optional :is_visible, GrowsurfRuby::Internal::Type::Boolean, api_name: :isVisible |
#limit ⇒ Integer?
-1 represents an unlimited reward in REST responses.
79 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 79 optional :limit, Integer, nil?: true |
#limit_duration ⇒ Symbol, ...
84 85 86 87 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 84 optional :limit_duration, enum: -> { GrowsurfRuby::Campaign::Reward::LimitDuration }, api_name: :limitDuration, nil?: true |
#metadata ⇒ Hash{Symbol=>Object}
Shallow custom metadata object.
22 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 22 required :metadata, GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown] |
#next_milestone_prefix ⇒ String?
Text shown before a participant's referral count in milestone-progress copy.
Applies to MILESTONE rewards.
94 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 94 optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix, nil?: true |
#next_milestone_suffix ⇒ String?
Text shown after a participant's referral count in milestone-progress copy.
Applies to MILESTONE rewards.
101 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 101 optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix, nil?: true |
#number_of_winners ⇒ Integer?
The number of winners (LEADERBOARD rewards only). With limitDuration
PER_MONTH this many win each month, otherwise this many win in total.
108 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 108 optional :number_of_winners, Integer, api_name: :numberOfWinners, nil?: true |
#order ⇒ Integer?
113 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 113 optional :order, Integer, nil?: true |
#referral_coupon_code ⇒ String?
Legacy static coupon code shown to the referred friend (double-sided rewards) in the reward-won email and webhook. Display text only; superseded by a connected billing integration's issued coupon when one exists.
121 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 121 optional :referral_coupon_code, String, api_name: :referralCouponCode, nil?: true |
#referral_description ⇒ String?
126 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 126 optional :referral_description, String, api_name: :referralDescription, nil?: true |
#referred_reward_upfront ⇒ Boolean?
131 132 133 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 131 optional :referred_reward_upfront, GrowsurfRuby::Internal::Type::Boolean, api_name: :referredRewardUpfront |
#referred_value ⇒ GrowsurfRuby::Models::RewardTaxValuation?
Tax treatment override for the referred friend's side of a double-sided reward.
139 140 141 142 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 139 optional :referred_value, -> { GrowsurfRuby::RewardTaxValuation }, api_name: :referredValue, nil?: true |
#title ⇒ String?
The reward title (internal label).
148 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 148 optional :title, String, nil?: true |
#type ⇒ Symbol, GrowsurfRuby::Models::Campaign::Reward::Type
27 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 27 required :type, enum: -> { GrowsurfRuby::Campaign::Reward::Type } |
#value ⇒ GrowsurfRuby::Models::RewardTaxValuation?
Tax valuation for the reward (the referrer's side of a double-sided reward).
154 |
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 154 optional :value, -> { GrowsurfRuby::RewardTaxValuation }, nil?: true |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/growsurf_ruby/models/campaign/reward.rb', line 213
|
Instance Method Details
#to_hash ⇒ {
108 |
# File 'sig/growsurf_ruby/models/campaign/reward.rbs', line 108
def to_hash: -> {
|