encode<V> static method

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

Implementation

static V encode<V>(
  AccountSettings instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.bacsDebitPayments != null) {
    AccountBacsDebitPaymentsSettings.encode(
      instance.bacsDebitPayments!,
      container.nestedSingleValueContainer('bacs_debit_payments').encoder,
    );
  }
  AccountBrandingSettings.encode(
    instance.branding,
    container.nestedSingleValueContainer('branding').encoder,
  );
  if (instance.cardIssuing != null) {
    AccountCardIssuingSettings.encode(
      instance.cardIssuing!,
      container.nestedSingleValueContainer('card_issuing').encoder,
    );
  }
  AccountCardPaymentsSettings.encode(
    instance.cardPayments,
    container.nestedSingleValueContainer('card_payments').encoder,
  );
  AccountDashboardSettings.encode(
    instance.dashboard,
    container.nestedSingleValueContainer('dashboard').encoder,
  );
  if (instance.invoices != null) {
    AccountInvoicesSettings.encode(
      instance.invoices!,
      container.nestedSingleValueContainer('invoices').encoder,
    );
  }
  AccountPaymentsSettings.encode(
    instance.payments,
    container.nestedSingleValueContainer('payments').encoder,
  );
  if (instance.payouts != null) {
    AccountPayoutSettings.encode(
      instance.payouts!,
      container.nestedSingleValueContainer('payouts').encoder,
    );
  }
  if (instance.sepaDebitPayments != null) {
    AccountSepaDebitPaymentsSettings.encode(
      instance.sepaDebitPayments!,
      container.nestedSingleValueContainer('sepa_debit_payments').encoder,
    );
  }
  if (instance.treasury != null) {
    AccountTreasurySettings.encode(
      instance.treasury!,
      container.nestedSingleValueContainer('treasury').encoder,
    );
  }
  return container.value;
}