serialize method
Serializes information the current object
writer Serialization writer to use to serialize this model
Implementation
@override
void serialize(SerializationWriter writer) {
writer.writeBoolValue('active', value: active);
writer.writeStringValue('code', code);
writer.writeIntValue('created', created);
writer.writeObjectValue<PromotionCodeCustomer>('customer', customer);
writer.writeStringValue('customer_account', customerAccount);
writer.writeIntValue('expires_at', expiresAt);
writer.writeStringValue('id', id);
writer.writeBoolValue('livemode', value: livemode);
writer.writeIntValue('max_redemptions', maxRedemptions);
writer.writeObjectValue<PromotionCodeMetadata>('metadata', metadata);
writer.writeEnumValue<PromotionCodeObject>(
'object', object, (e) => e?.value);
writer.writeObjectValue<PromotionCodesResourcePromotion>(
'promotion', promotion);
writer.writeObjectValue<PromotionCodesResourceRestrictions>(
'restrictions', restrictions);
writer.writeIntValue('times_redeemed', timesRedeemed);
writer.writeAdditionalData(additionalData);
}