Class: WhopSDK::Models::PromoCodeListResponse
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- WhopSDK::Models::PromoCodeListResponse
- Defined in:
- lib/whop_sdk/models/promo_code_list_response.rb
Overview
Defined Under Namespace
Classes: Product
Instance Attribute Summary collapse
-
#amount_off ⇒ Float
The discount amount.
-
#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.
-
#created_at ⇒ Time
The datetime the promo code was created.
-
#currency ⇒ Symbol, WhopSDK::Models::Currency
The monetary currency of the promo code.
-
#duration ⇒ Symbol, ...
The duration setting for the promo code.
-
#existing_memberships_only ⇒ Boolean
Restricts promo use to only be applied to already purchased memberships.
-
#expires_at ⇒ Time?
The date/time of when the promo expires.
-
#id ⇒ String
The unique identifier for the promo code.
-
#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.
-
#product ⇒ WhopSDK::Models::PromoCodeListResponse::Product?
The product this promo code applies to.
-
#promo_duration_months ⇒ Integer?
The number of months the promo is applied for.
-
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The type (% or flat amount) of the promo.
-
#status ⇒ Symbol, WhopSDK::Models::PromoCodeStatus
Indicates if the promo code is live or disabled.
-
#stock ⇒ Integer
The quantity limit on the number of uses.
-
#unlimited_stock ⇒ Boolean
Whether or not the promo code has unlimited stock.
-
#uses ⇒ Integer
The amount of times the promo codes has been used.
Instance Method Summary collapse
-
#initialize(id:, amount_off:, churned_users_only:, code:, created_at:, currency:, duration:, existing_memberships_only:, expires_at:, new_users_only:, one_per_customer:, product:, promo_duration_months:, promo_type:, status:, stock:, unlimited_stock:, uses:) ⇒ Object
constructor
Some parameter documentations has been truncated, see PromoCodeListResponse for more details.
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:, amount_off:, churned_users_only:, code:, created_at:, currency:, duration:, existing_memberships_only:, expires_at:, new_users_only:, one_per_customer:, product:, promo_duration_months:, promo_type:, status:, stock:, unlimited_stock:, uses:) ⇒ Object
Some parameter documentations has been truncated, see WhopSDK::Models::PromoCodeListResponse for more details.
A promo code applies a discount to a plan during checkout. Promo codes can be percentage-based or fixed-amount, and can have usage limits and expiration dates.
|
|
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 118
|
Instance Attribute Details
#amount_off ⇒ Float
The discount amount. Interpretation depends on promo_type: if ‘percentage’, this is the percentage (e.g., 20 means 20% off); if ‘flat_amount’, this is dollars off (e.g., 10.00 means $10.00 off).
19 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 19 required :amount_off, Float |
#churned_users_only ⇒ Boolean
Restricts promo use to only users who have churned from the company before.
25 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 25 required :churned_users_only, WhopSDK::Internal::Type::Boolean |
#code ⇒ String?
The specific code used to apply the promo at checkout.
31 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 31 required :code, String, nil?: true |
#created_at ⇒ Time
The datetime the promo code was created.
37 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 37 required :created_at, Time |
#currency ⇒ Symbol, WhopSDK::Models::Currency
The monetary currency of the promo code.
43 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 43 required :currency, enum: -> { WhopSDK::Currency } |
#duration ⇒ Symbol, ...
The duration setting for the promo code
49 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 49 required :duration, enum: -> { WhopSDK::PromoDuration }, nil?: true |
#existing_memberships_only ⇒ Boolean
Restricts promo use to only be applied to already purchased memberships.
55 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 55 required :existing_memberships_only, WhopSDK::Internal::Type::Boolean |
#expires_at ⇒ Time?
The date/time of when the promo expires.
61 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 61 required :expires_at, Time, nil?: true |
#id ⇒ String
The unique identifier for the promo code.
11 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 11 required :id, String |
#new_users_only ⇒ Boolean
Restricts promo use to only users who have never purchased from the company before.
68 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 68 required :new_users_only, WhopSDK::Internal::Type::Boolean |
#one_per_customer ⇒ Boolean
Restricts promo use to only be applied once per customer.
74 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 74 required :one_per_customer, WhopSDK::Internal::Type::Boolean |
#product ⇒ WhopSDK::Models::PromoCodeListResponse::Product?
The product this promo code applies to
80 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 80 required :product, -> { WhopSDK::Models::PromoCodeListResponse::Product }, nil?: true |
#promo_duration_months ⇒ Integer?
The number of months the promo is applied for.
86 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 86 required :promo_duration_months, Integer, nil?: true |
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The type (% or flat amount) of the promo.
92 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 92 required :promo_type, enum: -> { WhopSDK::PromoType } |
#status ⇒ Symbol, WhopSDK::Models::PromoCodeStatus
Indicates if the promo code is live or disabled.
98 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 98 required :status, enum: -> { WhopSDK::PromoCodeStatus } |
#stock ⇒ Integer
The quantity limit on the number of uses.
104 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 104 required :stock, Integer |
#unlimited_stock ⇒ Boolean
Whether or not the promo code has unlimited stock.
110 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 110 required :unlimited_stock, WhopSDK::Internal::Type::Boolean |
#uses ⇒ Integer
The amount of times the promo codes has been used.
116 |
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 116 required :uses, Integer |