Class: WhopSDK::Models::PromoCode
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- WhopSDK::Models::PromoCode
- Defined in:
- lib/whop_sdk/models/promo_code.rb
Overview
Defined Under Namespace
Instance Attribute Summary collapse
-
#amount_off ⇒ Float
The amount off (% or flat amount) for the promo.
-
#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 ⇒ WhopSDK::Models::PromoCode::Company
The company for the promo code.
-
#created_at ⇒ Time
The timestamp of when the promo 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 ID of the promo.
-
#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::PromoCode::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: , title: ) ⇒ Object
constructor
The company for the promo code.
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: , title: ) ⇒ Object
The company for the promo code.
|
|
# File 'lib/whop_sdk/models/promo_code.rb', line 122
|
Instance Attribute Details
#amount_off ⇒ Float
The amount off (% or flat amount) for the promo.
17 |
# File 'lib/whop_sdk/models/promo_code.rb', line 17 required :amount_off, Float |
#churned_users_only ⇒ Boolean
Restricts promo use to only users who have churned from the company before.
23 |
# File 'lib/whop_sdk/models/promo_code.rb', line 23 required :churned_users_only, WhopSDK::Internal::Type::Boolean |
#code ⇒ String?
The specific code used to apply the promo at checkout.
29 |
# File 'lib/whop_sdk/models/promo_code.rb', line 29 required :code, String, nil?: true |
#company ⇒ WhopSDK::Models::PromoCode::Company
The company for the promo code.
35 |
# File 'lib/whop_sdk/models/promo_code.rb', line 35 required :company, -> { WhopSDK::PromoCode::Company } |
#created_at ⇒ Time
The timestamp of when the promo was created.
41 |
# File 'lib/whop_sdk/models/promo_code.rb', line 41 required :created_at, Time |
#currency ⇒ Symbol, WhopSDK::Models::Currency
The monetary currency of the promo code.
47 |
# File 'lib/whop_sdk/models/promo_code.rb', line 47 required :currency, enum: -> { WhopSDK::Currency } |
#duration ⇒ Symbol, ...
The duration setting for the promo code
53 |
# File 'lib/whop_sdk/models/promo_code.rb', line 53 required :duration, enum: -> { WhopSDK::PromoDuration }, nil?: true |
#existing_memberships_only ⇒ Boolean
Restricts promo use to only be applied to already purchased memberships.
59 |
# File 'lib/whop_sdk/models/promo_code.rb', line 59 required :existing_memberships_only, WhopSDK::Internal::Type::Boolean |
#expires_at ⇒ Time?
The date/time of when the promo expires.
65 |
# File 'lib/whop_sdk/models/promo_code.rb', line 65 required :expires_at, Time, nil?: true |
#id ⇒ String
The ID of the promo.
11 |
# File 'lib/whop_sdk/models/promo_code.rb', line 11 required :id, String |
#new_users_only ⇒ Boolean
Restricts promo use to only users who have never purchased from the company before.
72 |
# File 'lib/whop_sdk/models/promo_code.rb', line 72 required :new_users_only, WhopSDK::Internal::Type::Boolean |
#one_per_customer ⇒ Boolean
Restricts promo use to only be applied once per customer.
78 |
# File 'lib/whop_sdk/models/promo_code.rb', line 78 required :one_per_customer, WhopSDK::Internal::Type::Boolean |
#product ⇒ WhopSDK::Models::PromoCode::Product?
The product this promo code applies to
84 |
# File 'lib/whop_sdk/models/promo_code.rb', line 84 required :product, -> { WhopSDK::PromoCode::Product }, nil?: true |
#promo_duration_months ⇒ Integer?
The number of months the promo is applied for.
90 |
# File 'lib/whop_sdk/models/promo_code.rb', line 90 required :promo_duration_months, Integer, nil?: true |
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The type (% or flat amount) of the promo.
96 |
# File 'lib/whop_sdk/models/promo_code.rb', line 96 required :promo_type, enum: -> { WhopSDK::PromoType } |
#status ⇒ Symbol, WhopSDK::Models::PromoCodeStatus
Indicates if the promo code is live or disabled.
102 |
# File 'lib/whop_sdk/models/promo_code.rb', line 102 required :status, enum: -> { WhopSDK::PromoCodeStatus } |
#stock ⇒ Integer
The quantity limit on the number of uses.
108 |
# File 'lib/whop_sdk/models/promo_code.rb', line 108 required :stock, Integer |
#unlimited_stock ⇒ Boolean
Whether or not the promo code has unlimited stock.
114 |
# File 'lib/whop_sdk/models/promo_code.rb', line 114 required :unlimited_stock, WhopSDK::Internal::Type::Boolean |
#uses ⇒ Integer
The amount of times the promo codes has been used.
120 |
# File 'lib/whop_sdk/models/promo_code.rb', line 120 required :uses, Integer |