encode<V> static method
Implementation
static V encode<V>(
TerminalReaderReaderResourceReaderAction instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.failureCode != null) {
container.encodeString(
'failure_code',
instance.failureCode!,
);
}
if (instance.failureMessage != null) {
container.encodeString(
'failure_message',
instance.failureMessage!,
);
}
if (instance.processPaymentIntent != null) {
TerminalReaderReaderResourceProcessPaymentIntentAction.encode(
instance.processPaymentIntent!,
container.nestedSingleValueContainer('process_payment_intent').encoder,
);
}
if (instance.processSetupIntent != null) {
TerminalReaderReaderResourceProcessSetupIntentAction.encode(
instance.processSetupIntent!,
container.nestedSingleValueContainer('process_setup_intent').encoder,
);
}
if (instance.refundPayment != null) {
TerminalReaderReaderResourceRefundPaymentAction.encode(
instance.refundPayment!,
container.nestedSingleValueContainer('refund_payment').encoder,
);
}
if (instance.setReaderDisplay != null) {
TerminalReaderReaderResourceSetReaderDisplayAction.encode(
instance.setReaderDisplay!,
container.nestedSingleValueContainer('set_reader_display').encoder,
);
}
TerminalReaderActionStatus.encode(
instance.status,
container.nestedSingleValueContainer('status').encoder,
);
TerminalReaderActionType.encode(
instance.type,
container.nestedSingleValueContainer('type').encoder,
);
return container.value;
}