Class: Orb::Models::Coupon
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Orb::Models::Coupon
- Defined in:
- lib/orb/models/coupon.rb
Overview
Defined Under Namespace
Modules: Discount
Instance Attribute Summary collapse
-
#archived_at ⇒ Time?
An archived coupon can no longer be redeemed.
- #discount ⇒ Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount
-
#duration_in_months ⇒ Integer?
This allows for a coupon’s discount to apply for a limited time (determined in months); a ‘null` value here means “unlimited time”.
-
#id ⇒ String
Also referred to as coupon_id in this documentation.
-
#max_redemptions ⇒ Integer?
The maximum number of redemptions allowed for this coupon before it is exhausted; ‘null` here means “unlimited”.
-
#redemption_code ⇒ String
This string can be used to redeem this coupon for a given subscription.
-
#times_redeemed ⇒ Integer
The number of times this coupon has been redeemed.
Instance Method Summary collapse
-
#initialize(id: , archived_at: , discount: , duration_in_months: , max_redemptions: , redemption_code: , times_redeemed: ) ⇒ Object
constructor
Some parameter documentations has been truncated, see Coupon 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: , archived_at: , discount: , duration_in_months: , max_redemptions: , redemption_code: , times_redeemed: ) ⇒ Object
Some parameter documentations has been truncated, see Orb::Models::Coupon for more details.
A coupon represents a reusable discount configuration that can be applied either as a fixed or percentage amount to an invoice or subscription. Coupons are activated using a redemption code, which applies the discount to a subscription or invoice. The duration of a coupon determines how long it remains available for use by end users.
|
|
# File 'lib/orb/models/coupon.rb', line 51
|
Instance Attribute Details
#archived_at ⇒ Time?
An archived coupon can no longer be redeemed. Active coupons will have a value of null for ‘archived_at`; this field will be non-null for archived coupons.
18 |
# File 'lib/orb/models/coupon.rb', line 18 required :archived_at, Time, nil?: true |
#discount ⇒ Orb::Models::PercentageDiscount, Orb::Models::AmountDiscount
23 |
# File 'lib/orb/models/coupon.rb', line 23 required :discount, union: -> { Orb::Coupon::Discount } |
#duration_in_months ⇒ Integer?
This allows for a coupon’s discount to apply for a limited time (determined in months); a ‘null` value here means “unlimited time”.
30 |
# File 'lib/orb/models/coupon.rb', line 30 required :duration_in_months, Integer, nil?: true |
#id ⇒ String
Also referred to as coupon_id in this documentation.
11 |
# File 'lib/orb/models/coupon.rb', line 11 required :id, String |
#max_redemptions ⇒ Integer?
The maximum number of redemptions allowed for this coupon before it is exhausted; ‘null` here means “unlimited”.
37 |
# File 'lib/orb/models/coupon.rb', line 37 required :max_redemptions, Integer, nil?: true |
#redemption_code ⇒ String
This string can be used to redeem this coupon for a given subscription.
43 |
# File 'lib/orb/models/coupon.rb', line 43 required :redemption_code, String |
#times_redeemed ⇒ Integer
The number of times this coupon has been redeemed.
49 |
# File 'lib/orb/models/coupon.rb', line 49 required :times_redeemed, Integer |