encode<V> static method

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

Implementation

static V encode<V>(
  IssuingCardholderSpendingLimit instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeInt(
    'amount',
    instance.amount,
  );
  if (instance.categories != null) {
    container.encodeList(
      'categories',
      (container) => instance.categories!.forEach((el) =>
          IssuingCardholderSpendingControlsAllowedCategoriesItem.encode(
            el,
            container.nestedSingleValueContainer().encoder,
          )),
    );
  }
  IssuingCardSpendingLimitInterval.encode(
    instance.interval,
    container.nestedSingleValueContainer('interval').encoder,
  );
  return container.value;
}