encode<V> static method

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

Implementation

static V encode<V>(
  DiscountsResourceDiscountAmount instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeInt(
    'amount',
    instance.amount,
  );
  DiscountsResourceDiscountAmountDiscountOrId.encode(
    instance.discount,
    container.nestedSingleValueContainer('discount').encoder,
  );
  return container.value;
}