Class: GrowsurfRuby::Models::Campaign::RewardCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/growsurf_ruby/models/campaign/reward_create_params.rb,
sig/growsurf_ruby/models/campaign/reward_create_params.rbs

Overview

See Also:

  • GrowsurfRuby::Resources::Campaign::Rewards#create

Defined Under Namespace

Modules: Event, LimitDuration, Type

Constant Summary collapse

GrowsurfRuby =

Returns:

  • (:CommissionStructure)

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: 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, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see GrowsurfRuby::Models::Campaign::RewardCreateParams for more details.

Parameters:

  • type (Symbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::Type)
  • commission_structure (GrowsurfRuby::Models::CommissionStructure) (defaults to: nil)
  • conversions_required (Integer) (defaults to: nil)
  • coupon_code (String) (defaults to: nil)

    Legacy static coupon code shown to the referrer in the reward-won email and web

  • description (String) (defaults to: nil)
  • event (Symbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::Event) (defaults to: nil)

    The referral event that earns this Campaign Reward.

  • image_url (String) (defaults to: nil)
  • is_unlimited (Boolean) (defaults to: nil)

    Whether the reward can be earned an unlimited number of times. Defaults to `true

  • is_visible (Boolean) (defaults to: nil)

    Whether the reward is enabled. When false the reward is disabled: hidden from

  • limit (Integer) (defaults to: nil)
  • limit_duration (Symbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::LimitDuration) (defaults to: nil)
  • metadata (Hash{Symbol=>Object}) (defaults to: nil)

    Custom key/value metadata (single-level; values are stored as strings).

  • next_milestone_prefix (String) (defaults to: nil)

    Text shown before a participant's referral count in milestone-progress copy. App

  • next_milestone_suffix (String) (defaults to: nil)

    Text shown after a participant's referral count in milestone-progress copy. Appl

  • number_of_winners (Integer) (defaults to: nil)

    The number of winners (LEADERBOARD rewards only). With limitDuration `PER_MO

  • order (Integer) (defaults to: nil)
  • referral_coupon_code (String) (defaults to: nil)

    Legacy static coupon code shown to the referred friend (double-sided rewards) in

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

    Tax treatment override for the referred friend's side of a double-sided reward. Defaults

  • title (String) (defaults to: nil)
  • value (GrowsurfRuby::Models::RewardTaxValuation) (defaults to: nil)

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

  • request_options (GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


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

Instance Attribute Details

#commission_structureGrowsurfRuby::Models::CommissionStructure?



19
20
21
# File 'lib/growsurf_ruby/models/campaign/reward_create_params.rb', line 19

optional :commission_structure,
-> { GrowsurfRuby::CommissionStructure },
api_name: :commissionStructure

#conversions_requiredInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :conversions_required, Integer, api_name: :conversionsRequired

#coupon_codeString?

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.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :coupon_code, String, api_name: :couponCode

#descriptionString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :description, String

#eventSymbol, ...

The referral event that earns this Campaign Reward. Use LEAD or CONVERSION. LEAD requires the program installation's referralTrigger to be CUSTOM. This field applies only to SINGLE_SIDED, DOUBLE_SIDED, and MILESTONE rewards. When omitted, it defaults to CONVERSION.



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

optional :event, enum: -> { GrowsurfRuby::Campaign::RewardCreateParams::Event }

#image_urlString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :image_url, String, api_name: :imageUrl

#is_unlimitedBoolean?

Whether the reward can be earned an unlimited number of times. Defaults to true, except MILESTONE rewards, which can only be earned once.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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

#is_visibleBoolean?

Whether the reward is enabled. When false the reward is disabled: hidden from participants and no longer awarded, including those who already earned it.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

optional :is_visible, GrowsurfRuby::Internal::Type::Boolean, api_name: :isVisible

#limitInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :limit, Integer

#limit_durationSymbol, ...



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

optional :limit_duration,
enum: -> { GrowsurfRuby::Campaign::RewardCreateParams::LimitDuration },
api_name: :limitDuration

#metadataHash{Symbol=>Object}?

Custom key/value metadata (single-level; values are stored as strings).

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


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

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

#next_milestone_prefixString?

Text shown before a participant's referral count in milestone-progress copy. Applies to MILESTONE rewards.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix

#next_milestone_suffixString?

Text shown after a participant's referral count in milestone-progress copy. Applies to MILESTONE rewards.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix

#number_of_winnersInteger?

The number of winners (LEADERBOARD rewards only). With limitDuration PER_MONTH this many win each month, otherwise this many win in total; omitting it defaults to 3.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :number_of_winners, Integer, api_name: :numberOfWinners

#orderInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :order, Integer

#referral_coupon_codeString?

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.

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :referral_coupon_code, String, api_name: :referralCouponCode

#referral_descriptionString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :referral_description, String, api_name: :referralDescription

#referred_reward_upfrontBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


130
131
132
# File 'lib/growsurf_ruby/models/campaign/reward_create_params.rb', line 130

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

#referred_valueGrowsurfRuby::Models::RewardTaxValuation?

Tax treatment override for the referred friend's side of a double-sided reward. Defaults to the program's confirmed default.



139
140
141
# File 'lib/growsurf_ruby/models/campaign/reward_create_params.rb', line 139

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

#titleString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :title, String

#typeSymbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::Type

Parameters:

  • value (GrowsurfRuby::Models::Campaign::RewardCreateParams::type_)

Returns:



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

required :type, enum: -> { GrowsurfRuby::Campaign::RewardCreateParams::Type }

#valueGrowsurfRuby::Models::RewardTaxValuation?

Tax valuation for the reward (the referrer's side of a double-sided reward). Used by tax documentation / 1099 reporting.



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

optional :value, -> { GrowsurfRuby::RewardTaxValuation }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


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

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {