encode<V> static method

V encode<V>(
  1. SessionDiscountsItem instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  SessionDiscountsItem instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.coupon != null) {
    container.encodeString(
      'coupon',
      instance.coupon!,
    );
  }
  if (instance.promotionCode != null) {
    container.encodeString(
      'promotion_code',
      instance.promotionCode!,
    );
  }
  return container.value;
}