Class: Onlyfans::Models::PromotionCreateParams

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

Overview

See Also:

  • Onlyfans::Resources::Promotions#create

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

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(account:, discount:, expiration_days:, offer_limit:, type:, free_trial_days: nil, message: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see Onlyfans::Models::PromotionCreateParams for more details.

Parameters:

  • account (String)
  • discount (Integer) —

    The discount percentage for the promotion's first month. Set to 100 to make this

  • expiration_days (Integer) —

    In how many days this offer will expire. Set to 0 to make this promotion infinit

  • offer_limit (Integer) —

    Limit how many people can claim this offer. Set to 0 for no limits.

  • type (Symbol, Onlyfans::Models::PromotionCreateParams::Type) —

    Whether this promotion should apply to new subscribers, expired subscribers, or

  • free_trial_days (Integer) (defaults to: nil) —

    Required only when discount is 100. Sets the duration (in days) of the free tria

  • message (String) (defaults to: nil) —

    Optionally, provide a message for this promotion.

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


# File 'lib/onlyfans/models/promotion_create_params.rb', line 56

Instance Attribute Details

#account ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/onlyfans/models/promotion_create_params.rb', line 13

required :account, String

#discount ⇒ Integer

The discount percentage for the promotion's first month. Set to 100 to make this promotion a Free Trial.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


20
# File 'lib/onlyfans/models/promotion_create_params.rb', line 20

required :discount, Integer

#expiration_days ⇒ Integer

In how many days this offer will expire. Set to 0 to make this promotion infinite.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


27
# File 'lib/onlyfans/models/promotion_create_params.rb', line 27

required :expiration_days, Integer, api_name: :expirationDays

#free_trial_days ⇒ Integer?

Required only when discount is 100. Sets the duration (in days) of the free trial. Accepted 1-30

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


48
# File 'lib/onlyfans/models/promotion_create_params.rb', line 48

optional :free_trial_days, Integer, api_name: :freeTrialDays

#message ⇒ String?

Optionally, provide a message for this promotion.

Parameters:

  • (String)

Returns:

  • (String, nil)


54
# File 'lib/onlyfans/models/promotion_create_params.rb', line 54

optional :message, String

#offer_limit ⇒ Integer

Limit how many people can claim this offer. Set to 0 for no limits.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


33
# File 'lib/onlyfans/models/promotion_create_params.rb', line 33

required :offer_limit, Integer, api_name: :offerLimit

#type ⇒ Symbol, Onlyfans::Models::PromotionCreateParams::Type

Whether this promotion should apply to new subscribers, expired subscribers, or both. IMPORTANT: when set to new_and_expired, the OF will create two separate promotions.

Parameters:

  • value (Onlyfans::Models::PromotionCreateParams::type_)

Returns:



41
# File 'lib/onlyfans/models/promotion_create_params.rb', line 41

required :type, enum: -> { Onlyfans::PromotionCreateParams::Type }

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


48
# File 'sig/onlyfans/models/promotion_create_params.rbs', line 48

def to_hash: -> {