encode<V> static method

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

Implementation

static V encode<V>(
  SourceReceiverFlow instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.address != null) {
    container.encodeString(
      'address',
      instance.address!,
    );
  }
  container.encodeInt(
    'amount_charged',
    instance.amountCharged,
  );
  container.encodeInt(
    'amount_received',
    instance.amountReceived,
  );
  container.encodeInt(
    'amount_returned',
    instance.amountReturned,
  );
  container.encodeString(
    'refund_attributes_method',
    instance.refundAttributesMethod,
  );
  container.encodeString(
    'refund_attributes_status',
    instance.refundAttributesStatus,
  );
  return container.value;
}