encode<V> static method

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

Implementation

static V encode<V>(
  SessionCurrencyOptionsValue instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeInt(
    'amount',
    instance.amount,
  );
  if (instance.taxBehavior != null) {
    ShippingRateCurrencyOptionTaxBehavior.encode(
      instance.taxBehavior!,
      container.nestedSingleValueContainer('tax_behavior').encoder,
    );
  }
  return container.value;
}