PromotionCode class
auto generated A Promotion Code represents a customer-redeemable code for an underlying promotion.You can create multiple codes for a single promotion.If you enable promotion codes in your customer portal configuration, then customers can redeem a code themselves when updating a subscription in the portal.Customers can also view the currently active promotion codes and coupons on each of their subscriptions in the portal.
Constructors
- PromotionCode()
- Instantiates a new PromotionCode and sets the default values.
Properties
- active ↔ bool?
-
Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid.
getter/setter pair
-
additionalData
↔ Map<
String, Object?> -
Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
getter/setter pairoverride
- code ↔ String?
-
The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9).
getter/setter pair
- created ↔ int?
-
Time at which the object was created. Measured in seconds since the Unix epoch.
getter/setter pair
- customer ↔ PromotionCodeCustomer?
-
The customer who can use this promotion code.
getter/setter pair
- customerAccount ↔ String?
-
The account representing the customer who can use this promotion code.
getter/setter pair
- expiresAt ↔ int?
-
Date at which the promotion code can no longer be redeemed.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
Unique identifier for the object.
getter/setter pair
- livemode ↔ bool?
-
Has the value
trueif the object exists in live mode or the valuefalseif the object exists in test mode.getter/setter pair - maxRedemptions ↔ int?
-
Maximum number of times this promotion code can be redeemed.
getter/setter pair
- metadata ↔ PromotionCodeMetadata?
-
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
getter/setter pair
- object ↔ PromotionCodeObject?
-
String representing the object's type. Objects of the same type share the same value.
getter/setter pair
- promotion ↔ PromotionCodesResourcePromotion?
-
The promotion property
getter/setter pair
- restrictions ↔ PromotionCodesResourceRestrictions?
-
The restrictions property
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timesRedeemed ↔ int?
-
Number of times this promotion code has been used.
getter/setter pair
Methods
-
getFieldDeserializers(
) → Map< String, void Function(ParseNode)> -
The deserialization information for the current model
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
serialize(
SerializationWriter writer) → void -
Serializes information the current object
writerSerialization writer to use to serialize this modeloverride -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createFromDiscriminatorValue(
ParseNode parseNode) → PromotionCode -
Creates a new instance of the appropriate class based on discriminator value
parseNodeThe parse node to use to read the discriminator value and create the object