Class: WhopSDK::Models::PromoCodeListResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/promo_code_list_response.rb

Overview

Defined Under Namespace

Classes: Product

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

An object representing a promo code for a plan.

Parameters:

  • id (String) (defaults to: )

    The ID of the promo.

  • amount_off (Float) (defaults to: )

    The amount off (% or flat amount) for the promo.

  • churned_users_only (Boolean) (defaults to: )

    Restricts promo use to only users who have churned from the company before.

  • code (String, nil) (defaults to: )

    The specific code used to apply the promo at checkout.

  • created_at (Time) (defaults to: )

    The timestamp of when the promo was created.

  • currency (Symbol, WhopSDK::Models::Currency) (defaults to: )

    The monetary currency of the promo code.

  • duration (Symbol, WhopSDK::Models::PromoDuration, nil) (defaults to: )

    The duration setting for the promo code

  • existing_memberships_only (Boolean) (defaults to: )

    Restricts promo use to only be applied to already purchased memberships.

  • expires_at (Time, nil) (defaults to: )

    The date/time of when the promo expires.

  • new_users_only (Boolean) (defaults to: )

    Restricts promo use to only users who have never purchased from the company befo

  • one_per_customer (Boolean) (defaults to: )

    Restricts promo use to only be applied once per customer.

  • product (WhopSDK::Models::PromoCodeListResponse::Product, nil) (defaults to: )

    The product this promo code applies to

  • promo_duration_months (Integer, nil) (defaults to: )

    The number of months the promo is applied for.

  • promo_type (Symbol, WhopSDK::Models::PromoType) (defaults to: )

    The type (% or flat amount) of the promo.

  • status (Symbol, WhopSDK::Models::PromoCodeStatus) (defaults to: )

    Indicates if the promo code is live or disabled.

  • stock (Integer) (defaults to: )

    The quantity limit on the number of uses.

  • unlimited_stock (Boolean) (defaults to: )

    Whether or not the promo code has unlimited stock.

  • uses (Integer) (defaults to: )

    The amount of times the promo codes has been used.



# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 116

Instance Attribute Details

#amount_offFloat

The amount off (% or flat amount) for the promo.

Returns:

  • (Float)


17
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 17

required :amount_off, Float

#churned_users_onlyBoolean

Restricts promo use to only users who have churned from the company before.

Returns:

  • (Boolean)


23
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 23

required :churned_users_only, WhopSDK::Internal::Type::Boolean

#codeString?

The specific code used to apply the promo at checkout.

Returns:

  • (String, nil)


29
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 29

required :code, String, nil?: true

#created_atTime

The timestamp of when the promo was created.

Returns:

  • (Time)


35
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 35

required :created_at, Time

#currencySymbol, WhopSDK::Models::Currency

The monetary currency of the promo code.

Returns:



41
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 41

required :currency, enum: -> { WhopSDK::Currency }

#durationSymbol, ...

The duration setting for the promo code

Returns:



47
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 47

required :duration, enum: -> { WhopSDK::PromoDuration }, nil?: true

#existing_memberships_onlyBoolean

Restricts promo use to only be applied to already purchased memberships.

Returns:

  • (Boolean)


53
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 53

required :existing_memberships_only, WhopSDK::Internal::Type::Boolean

#expires_atTime?

The date/time of when the promo expires.

Returns:

  • (Time, nil)


59
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 59

required :expires_at, Time, nil?: true

#idString

The ID of the promo.

Returns:

  • (String)


11
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 11

required :id, String

#new_users_onlyBoolean

Restricts promo use to only users who have never purchased from the company before.

Returns:

  • (Boolean)


66
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 66

required :new_users_only, WhopSDK::Internal::Type::Boolean

#one_per_customerBoolean

Restricts promo use to only be applied once per customer.

Returns:

  • (Boolean)


72
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 72

required :one_per_customer, WhopSDK::Internal::Type::Boolean

#productWhopSDK::Models::PromoCodeListResponse::Product?

The product this promo code applies to



78
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 78

required :product, -> { WhopSDK::Models::PromoCodeListResponse::Product }, nil?: true

#promo_duration_monthsInteger?

The number of months the promo is applied for.

Returns:

  • (Integer, nil)


84
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 84

required :promo_duration_months, Integer, nil?: true

#promo_typeSymbol, WhopSDK::Models::PromoType

The type (% or flat amount) of the promo.

Returns:



90
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 90

required :promo_type, enum: -> { WhopSDK::PromoType }

#statusSymbol, WhopSDK::Models::PromoCodeStatus

Indicates if the promo code is live or disabled.



96
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 96

required :status, enum: -> { WhopSDK::PromoCodeStatus }

#stockInteger

The quantity limit on the number of uses.

Returns:

  • (Integer)


102
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 102

required :stock, Integer

#unlimited_stockBoolean

Whether or not the promo code has unlimited stock.

Returns:

  • (Boolean)


108
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 108

required :unlimited_stock, WhopSDK::Internal::Type::Boolean

#usesInteger

The amount of times the promo codes has been used.

Returns:

  • (Integer)


114
# File 'lib/whop_sdk/models/promo_code_list_response.rb', line 114

required :uses, Integer