encode<V> static method

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

Implementation

static V encode<V>(
  AccountCardPaymentsSettings instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.declineOn != null) {
    AccountDeclineChargeOn.encode(
      instance.declineOn!,
      container.nestedSingleValueContainer('decline_on').encoder,
    );
  }
  if (instance.statementDescriptorPrefix != null) {
    container.encodeString(
      'statement_descriptor_prefix',
      instance.statementDescriptorPrefix!,
    );
  }
  if (instance.statementDescriptorPrefixKana != null) {
    container.encodeString(
      'statement_descriptor_prefix_kana',
      instance.statementDescriptorPrefixKana!,
    );
  }
  if (instance.statementDescriptorPrefixKanji != null) {
    container.encodeString(
      'statement_descriptor_prefix_kanji',
      instance.statementDescriptorPrefixKanji!,
    );
  }
  return container.value;
}