Class: GrowsurfRuby::Models::CampaignAPI::Reward
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- GrowsurfRuby::Models::CampaignAPI::Reward
- Defined in:
- lib/growsurf_ruby/models/campaign.rb,
sig/growsurf_ruby/models/campaign.rbs
Defined Under Namespace
Modules: 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?
- #id ⇒ String
- #image_url ⇒ String?
- #is_unlimited ⇒ Boolean
-
#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 valuation for the referred friend's side of a double-sided reward.
- #type ⇒ Symbol, GrowsurfRuby::Models::CampaignAPI::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, image_url: 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, 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, image_url: 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, value: nil) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 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 155 156 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 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 75 class Reward < GrowsurfRuby::Internal::Type::BaseModel # @!attribute id # # @return [String] required :id, String # @!attribute is_unlimited # # @return [Boolean] required :is_unlimited, GrowsurfRuby::Internal::Type::Boolean, api_name: :isUnlimited # @!attribute metadata # Shallow custom metadata object. # # @return [Hash{Symbol=>Object}] required :metadata, GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown] # @!attribute type # # @return [Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::Type] required :type, enum: -> { GrowsurfRuby::CampaignAPI::Reward::Type } # @!attribute commission_structure # # @return [GrowsurfRuby::Models::CommissionStructure, nil] optional :commission_structure, -> { GrowsurfRuby::CommissionStructure }, api_name: :commissionStructure, nil?: true # @!attribute conversions_required # # @return [Integer, nil] optional :conversions_required, Integer, api_name: :conversionsRequired, nil?: true # @!attribute coupon_code # 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. # # @return [String, nil] optional :coupon_code, String, api_name: :couponCode, nil?: true # @!attribute description # # @return [String, nil] optional :description, String, nil?: true # @!attribute image_url # # @return [String, nil] optional :image_url, String, api_name: :imageUrl, nil?: true # @!attribute limit # `-1` represents an unlimited reward in REST responses. # # @return [Integer, nil] optional :limit, Integer, nil?: true # @!attribute limit_duration # # @return [Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::LimitDuration, nil] optional :limit_duration, enum: -> { GrowsurfRuby::CampaignAPI::Reward::LimitDuration }, api_name: :limitDuration, nil?: true # @!attribute next_milestone_prefix # Text shown before a participant's referral count in milestone-progress copy. # Applies to `MILESTONE` rewards. # # @return [String, nil] optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix, nil?: true # @!attribute next_milestone_suffix # Text shown after a participant's referral count in milestone-progress copy. # Applies to `MILESTONE` rewards. # # @return [String, nil] optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix, nil?: true # @!attribute number_of_winners # The number of winners (`LEADERBOARD` rewards only). With `limitDuration` # `PER_MONTH` this many win each month, otherwise this many win in total. # # @return [Integer, nil] optional :number_of_winners, Integer, api_name: :numberOfWinners, nil?: true # @!attribute order # # @return [Integer, nil] optional :order, Integer, nil?: true # @!attribute referral_coupon_code # 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. # # @return [String, nil] optional :referral_coupon_code, String, api_name: :referralCouponCode, nil?: true # @!attribute referral_description # # @return [String, nil] optional :referral_description, String, api_name: :referralDescription, nil?: true # @!attribute referred_reward_upfront # # @return [Boolean, nil] optional :referred_reward_upfront, GrowsurfRuby::Internal::Type::Boolean, api_name: :referredRewardUpfront # @!attribute referred_value # Tax valuation for the referred friend's side of a double-sided reward. # # @return [GrowsurfRuby::Models::RewardTaxValuation, nil] optional :referred_value, -> { GrowsurfRuby::RewardTaxValuation }, api_name: :referredValue, nil?: true # @!attribute value # Tax valuation for the reward (the referrer's side of a double-sided reward). # # @return [GrowsurfRuby::Models::RewardTaxValuation, nil] optional :value, -> { GrowsurfRuby::RewardTaxValuation }, nil?: true # @!method initialize(id:, is_unlimited:, metadata:, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: 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, value: nil) # @param id [String] # # @param is_unlimited [Boolean] # # @param metadata [Hash{Symbol=>Object}] Shallow custom metadata object. # # @param type [Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::Type] # # @param commission_structure [GrowsurfRuby::Models::CommissionStructure, nil] # # @param conversions_required [Integer, nil] # # @param coupon_code [String, nil] Legacy static coupon code shown to the referrer in the reward-won email and web # # @param description [String, nil] # # @param image_url [String, nil] # # @param limit [Integer, nil] `-1` represents an unlimited reward in REST responses. # # @param limit_duration [Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::LimitDuration, nil] # # @param next_milestone_prefix [String, nil] Text shown before a participant's referral count in milestone-progress copy. App # # @param next_milestone_suffix [String, nil] Text shown after a participant's referral count in milestone-progress copy. Appl # # @param number_of_winners [Integer, nil] The number of winners (`LEADERBOARD` rewards only). With `limitDuration` `PER_MO # # @param order [Integer, nil] # # @param referral_coupon_code [String, nil] Legacy static coupon code shown to the referred friend (double-sided rewards) in # # @param referral_description [String, nil] # # @param referred_reward_upfront [Boolean] # # @param referred_value [GrowsurfRuby::Models::RewardTaxValuation, nil] Tax valuation for the referred friend's side of a double-sided reward. # # @param value [GrowsurfRuby::Models::RewardTaxValuation, nil] Tax valuation for the reward (the referrer's side of a double-sided reward). # @see GrowsurfRuby::Models::CampaignAPI::Reward#type module Type extend GrowsurfRuby::Internal::Type::Enum SINGLE_SIDED = :SINGLE_SIDED DOUBLE_SIDED = :DOUBLE_SIDED MILESTONE = :MILESTONE LEADERBOARD = :LEADERBOARD AFFILIATE = :AFFILIATE # @!method self.values # @return [Array<Symbol>] end # @see GrowsurfRuby::Models::CampaignAPI::Reward#limit_duration module LimitDuration extend GrowsurfRuby::Internal::Type::Enum IN_TOTAL = :IN_TOTAL PER_MONTH = :PER_MONTH # @!method self.values # @return [Array<Symbol>] end end |
Instance Attribute Details
#commission_structure ⇒ GrowsurfRuby::Models::CommissionStructure?
100 101 102 103 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 100 optional :commission_structure, -> { GrowsurfRuby::CommissionStructure }, api_name: :commissionStructure, nil?: true |
#conversions_required ⇒ Integer?
108 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 108 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.
116 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 116 optional :coupon_code, String, api_name: :couponCode, nil?: true |
#description ⇒ String?
121 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 121 optional :description, String, nil?: true |
#id ⇒ String
79 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 79 required :id, String |
#image_url ⇒ String?
126 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 126 optional :image_url, String, api_name: :imageUrl, nil?: true |
#is_unlimited ⇒ Boolean
84 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 84 required :is_unlimited, GrowsurfRuby::Internal::Type::Boolean, api_name: :isUnlimited |
#limit ⇒ Integer?
-1 represents an unlimited reward in REST responses.
132 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 132 optional :limit, Integer, nil?: true |
#limit_duration ⇒ Symbol, ...
137 138 139 140 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 137 optional :limit_duration, enum: -> { GrowsurfRuby::CampaignAPI::Reward::LimitDuration }, api_name: :limitDuration, nil?: true |
#metadata ⇒ Hash{Symbol=>Object}
Shallow custom metadata object.
90 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 90 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.
147 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 147 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.
154 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 154 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.
161 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 161 optional :number_of_winners, Integer, api_name: :numberOfWinners, nil?: true |
#order ⇒ Integer?
166 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 166 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.
174 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 174 optional :referral_coupon_code, String, api_name: :referralCouponCode, nil?: true |
#referral_description ⇒ String?
179 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 179 optional :referral_description, String, api_name: :referralDescription, nil?: true |
#referred_reward_upfront ⇒ Boolean?
184 185 186 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 184 optional :referred_reward_upfront, GrowsurfRuby::Internal::Type::Boolean, api_name: :referredRewardUpfront |
#referred_value ⇒ GrowsurfRuby::Models::RewardTaxValuation?
Tax valuation for the referred friend's side of a double-sided reward.
192 193 194 195 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 192 optional :referred_value, -> { GrowsurfRuby::RewardTaxValuation }, api_name: :referredValue, nil?: true |
#type ⇒ Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::Type
95 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 95 required :type, enum: -> { GrowsurfRuby::CampaignAPI::Reward::Type } |
#value ⇒ GrowsurfRuby::Models::RewardTaxValuation?
Tax valuation for the reward (the referrer's side of a double-sided reward).
201 |
# File 'lib/growsurf_ruby/models/campaign.rb', line 201 optional :value, -> { GrowsurfRuby::RewardTaxValuation }, nil?: true |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/growsurf_ruby/models/campaign.rb', line 254
|
Instance Method Details
#to_hash ⇒ {
161 |
# File 'sig/growsurf_ruby/models/campaign.rbs', line 161
def to_hash: -> {
|