Class: GrowsurfRuby::Models::CampaignAPI::Reward

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/growsurf_ruby/models/campaign.rb,
sig/growsurf_ruby/models/campaign.rbs

Defined Under Namespace

Modules: LimitDuration, Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • id (String)
  • is_unlimited (Boolean)
  • metadata (Hash{Symbol=>Object})

    Shallow custom metadata object.

  • type (Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::Type)
  • commission_structure (GrowsurfRuby::Models::CommissionStructure, nil) (defaults to: nil)
  • conversions_required (Integer, nil) (defaults to: nil)
  • coupon_code (String, nil) (defaults to: nil)
  • description (String, nil) (defaults to: nil)
  • image_url (String, nil) (defaults to: nil)
  • limit (Integer, nil) (defaults to: nil)

    -1 represents an unlimited reward in REST responses.

  • limit_duration (Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::LimitDuration, nil) (defaults to: nil)
  • next_milestone_prefix (String, nil) (defaults to: nil)
  • next_milestone_suffix (String, nil) (defaults to: nil)
  • number_of_winners (Integer, nil) (defaults to: nil)
  • order (Integer, nil) (defaults to: nil)
  • referral_coupon_code (String, nil) (defaults to: nil)

    The coupon code delivered to the referred friend (double-sided rewards).

  • referral_description (String, nil) (defaults to: nil)
  • referred_reward_upfront (Boolean) (defaults to: nil)
  • referred_value (GrowsurfRuby::Models::RewardTaxValuation, nil) (defaults to: nil)

    Tax valuation for the referred friend's side of a double-sided reward.

  • value (GrowsurfRuby::Models::RewardTaxValuation, nil) (defaults to: nil)

    Tax valuation for the reward (the referrer's side of a double-sided reward).



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
# 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
  #
  #   @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
  #
  #   @return [String, nil]
  optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix, nil?: true

  # @!attribute next_milestone_suffix
  #
  #   @return [String, nil]
  optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix, nil?: true

  # @!attribute number_of_winners
  #
  #   @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
  #   The coupon code delivered to the referred friend (double-sided rewards).
  #
  #   @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]
  #
  #   @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]
  #
  #   @param next_milestone_suffix [String, nil]
  #
  #   @param number_of_winners [Integer, nil]
  #
  #   @param order [Integer, nil]
  #
  #   @param referral_coupon_code [String, nil] The coupon code delivered to the referred friend (double-sided rewards).
  #
  #   @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_structureGrowsurfRuby::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_requiredInteger?

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


108
# File 'lib/growsurf_ruby/models/campaign.rb', line 108

optional :conversions_required, Integer, api_name: :conversionsRequired, nil?: true

#coupon_codeString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


113
# File 'lib/growsurf_ruby/models/campaign.rb', line 113

optional :coupon_code, String, api_name: :couponCode, nil?: true

#descriptionString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


118
# File 'lib/growsurf_ruby/models/campaign.rb', line 118

optional :description, String, nil?: true

#idString

Parameters:

  • value (String)

Returns:

  • (String)


79
# File 'lib/growsurf_ruby/models/campaign.rb', line 79

required :id, String

#image_urlString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


123
# File 'lib/growsurf_ruby/models/campaign.rb', line 123

optional :image_url, String, api_name: :imageUrl, nil?: true

#is_unlimitedBoolean

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


84
# File 'lib/growsurf_ruby/models/campaign.rb', line 84

required :is_unlimited, GrowsurfRuby::Internal::Type::Boolean, api_name: :isUnlimited

#limitInteger?

-1 represents an unlimited reward in REST responses.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


129
# File 'lib/growsurf_ruby/models/campaign.rb', line 129

optional :limit, Integer, nil?: true

#limit_durationSymbol, ...

Parameters:

  • value (GrowsurfRuby::Models::CampaignAPI::Reward::limit_duration, nil)

Returns:



134
135
136
137
# File 'lib/growsurf_ruby/models/campaign.rb', line 134

optional :limit_duration,
enum: -> { GrowsurfRuby::CampaignAPI::Reward::LimitDuration },
api_name: :limitDuration,
nil?: true

#metadataHash{Symbol=>Object}

Shallow custom metadata object.

Parameters:

  • value (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object})


90
# File 'lib/growsurf_ruby/models/campaign.rb', line 90

required :metadata, GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown]

#next_milestone_prefixString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


142
# File 'lib/growsurf_ruby/models/campaign.rb', line 142

optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix, nil?: true

#next_milestone_suffixString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


147
# File 'lib/growsurf_ruby/models/campaign.rb', line 147

optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix, nil?: true

#number_of_winnersInteger?

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


152
# File 'lib/growsurf_ruby/models/campaign.rb', line 152

optional :number_of_winners, Integer, api_name: :numberOfWinners, nil?: true

#orderInteger?

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


157
# File 'lib/growsurf_ruby/models/campaign.rb', line 157

optional :order, Integer, nil?: true

#referral_coupon_codeString?

The coupon code delivered to the referred friend (double-sided rewards).

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


163
# File 'lib/growsurf_ruby/models/campaign.rb', line 163

optional :referral_coupon_code, String, api_name: :referralCouponCode, nil?: true

#referral_descriptionString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


168
# File 'lib/growsurf_ruby/models/campaign.rb', line 168

optional :referral_description, String, api_name: :referralDescription, nil?: true

#referred_reward_upfrontBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


173
174
175
# File 'lib/growsurf_ruby/models/campaign.rb', line 173

optional :referred_reward_upfront,
GrowsurfRuby::Internal::Type::Boolean,
api_name: :referredRewardUpfront

#referred_valueGrowsurfRuby::Models::RewardTaxValuation?

Tax valuation for the referred friend's side of a double-sided reward.



181
182
183
184
# File 'lib/growsurf_ruby/models/campaign.rb', line 181

optional :referred_value,
-> { GrowsurfRuby::RewardTaxValuation },
api_name: :referredValue,
nil?: true

#typeSymbol, GrowsurfRuby::Models::CampaignAPI::Reward::Type

Parameters:

  • value (GrowsurfRuby::Models::CampaignAPI::Reward::type_)

Returns:



95
# File 'lib/growsurf_ruby/models/campaign.rb', line 95

required :type, enum: -> { GrowsurfRuby::CampaignAPI::Reward::Type }

#valueGrowsurfRuby::Models::RewardTaxValuation?

Tax valuation for the reward (the referrer's side of a double-sided reward).



190
# File 'lib/growsurf_ruby/models/campaign.rb', line 190

optional :value, -> { GrowsurfRuby::RewardTaxValuation }, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/growsurf_ruby/models/campaign.rb', line 243

Instance Method Details

#to_hash{

Returns:

  • ({)


161
# File 'sig/growsurf_ruby/models/campaign.rbs', line 161

def to_hash: -> {