Class: WhopSDK::Models::PromoCodeCreateParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- WhopSDK::Models::PromoCodeCreateParams
- Extended by:
- Internal::Type::RequestParameters::Converter
- Includes:
- Internal::Type::RequestParameters
- Defined in:
- lib/whop_sdk/models/promo_code_create_params.rb
Overview
Instance Attribute Summary collapse
-
#amount_off ⇒ Float
The amount off (% or flat amount) for the promo.
-
#base_currency ⇒ Symbol, WhopSDK::Models::Currency
The monetary currency of the promo code.
-
#churned_users_only ⇒ Boolean?
Restricts promo use to only users who have churned from the company before.
-
#code ⇒ String
The specific code used to apply the promo at checkout.
-
#company_id ⇒ String
The id of the company to create the promo code for.
-
#existing_memberships_only ⇒ Boolean?
Whether this promo code is for existing memberships only (cancelations).
-
#expires_at ⇒ Time?
The date/time of when the promo expires.
-
#new_users_only ⇒ Boolean
Restricts promo use to only users who have never purchased from the company before.
-
#one_per_customer ⇒ Boolean?
Restricts promo use to only be applied once per customer.
-
#plan_ids ⇒ Array<String>?
The IDs of the plans that the promo code applies to.
-
#product_id ⇒ String?
The product to lock the promo code to, if any.
-
#promo_duration_months ⇒ Integer
The number of months this promo code is applied and valid for.
-
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The type (% or flat amount) of the promo.
-
#stock ⇒ Integer?
The quantity limit on the number of uses.
-
#unlimited_stock ⇒ Boolean?
Whether or not the promo code should have unlimited stock.
Attributes included from Internal::Type::RequestParameters
Instance Method Summary collapse
-
#initialize(amount_off: , base_currency: , code: , company_id: , new_users_only: , promo_duration_months: , promo_type: , churned_users_only: nil, existing_memberships_only: nil, expires_at: nil, one_per_customer: nil, plan_ids: nil, product_id: nil, stock: nil, unlimited_stock: nil, request_options: {}) ⇒ Object
constructor
Some parameter documentations has been truncated, see PromoCodeCreateParams for more details.
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
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(amount_off: , base_currency: , code: , company_id: , new_users_only: , promo_duration_months: , promo_type: , churned_users_only: nil, existing_memberships_only: nil, expires_at: nil, one_per_customer: nil, plan_ids: nil, product_id: nil, stock: nil, unlimited_stock: nil, request_options: {}) ⇒ Object
Some parameter documentations has been truncated, see WhopSDK::Models::PromoCodeCreateParams for more details.
|
|
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 103
|
Instance Attribute Details
#amount_off ⇒ Float
The amount off (% or flat amount) for the promo.
14 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 14 required :amount_off, Float |
#base_currency ⇒ Symbol, WhopSDK::Models::Currency
The monetary currency of the promo code.
20 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 20 required :base_currency, enum: -> { WhopSDK::Currency } |
#churned_users_only ⇒ Boolean?
Restricts promo use to only users who have churned from the company before.
57 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 57 optional :churned_users_only, WhopSDK::Internal::Type::Boolean, nil?: true |
#code ⇒ String
The specific code used to apply the promo at checkout.
26 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 26 required :code, String |
#company_id ⇒ String
The id of the company to create the promo code for.
32 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 32 required :company_id, String |
#existing_memberships_only ⇒ Boolean?
Whether this promo code is for existing memberships only (cancelations)
63 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 63 optional :existing_memberships_only, WhopSDK::Internal::Type::Boolean, nil?: true |
#expires_at ⇒ Time?
The date/time of when the promo expires.
69 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 69 optional :expires_at, Time, nil?: true |
#new_users_only ⇒ Boolean
Restricts promo use to only users who have never purchased from the company before.
39 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 39 required :new_users_only, WhopSDK::Internal::Type::Boolean |
#one_per_customer ⇒ Boolean?
Restricts promo use to only be applied once per customer.
75 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 75 optional :one_per_customer, WhopSDK::Internal::Type::Boolean, nil?: true |
#plan_ids ⇒ Array<String>?
The IDs of the plans that the promo code applies to. If product_id is provided, it will only apply to plans attached to that product
82 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 82 optional :plan_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true |
#product_id ⇒ String?
The product to lock the promo code to, if any. If provided will filter out any plan ids not attached to this product
89 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 89 optional :product_id, String, nil?: true |
#promo_duration_months ⇒ Integer
The number of months this promo code is applied and valid for.
45 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 45 required :promo_duration_months, Integer |
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The type (% or flat amount) of the promo.
51 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 51 required :promo_type, enum: -> { WhopSDK::PromoType } |
#stock ⇒ Integer?
The quantity limit on the number of uses.
95 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 95 optional :stock, Integer, nil?: true |