encode<V> static method

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

Implementation

static V encode<V>(
  TerminalReaderReaderResourceProcessSetupIntentAction instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.generatedCard != null) {
    container.encodeString(
      'generated_card',
      instance.generatedCard!,
    );
  }
  if (instance.processConfig != null) {
    TerminalReaderReaderResourceProcessSetupConfig.encode(
      instance.processConfig!,
      container.nestedSingleValueContainer('process_config').encoder,
    );
  }
  SetupIntentOrId.encode(
    instance.setupIntent,
    container.nestedSingleValueContainer('setup_intent').encoder,
  );
  return container.value;
}