encode<V> static method

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

Implementation

static V encode<V>(
  IssuingTransactionReceiptData instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.description != null) {
    container.encodeString(
      'description',
      instance.description!,
    );
  }
  if (instance.quantity != null) {
    container.encodeDouble(
      'quantity',
      instance.quantity!,
    );
  }
  if (instance.total != null) {
    container.encodeInt(
      'total',
      instance.total!,
    );
  }
  if (instance.unitCost != null) {
    container.encodeInt(
      'unit_cost',
      instance.unitCost!,
    );
  }
  return container.value;
}