encode<V> static method

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

Implementation

static V encode<V>(
  AccountSessionComponents instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.accountOnboarding != null) {
    AccountSessionAccountOnboarding.encode(
      instance.accountOnboarding!,
      container.nestedSingleValueContainer('account_onboarding').encoder,
    );
  }
  if (instance.documents != null) {
    AccountSessionAccountOnboarding.encode(
      instance.documents!,
      container.nestedSingleValueContainer('documents').encoder,
    );
  }
  if (instance.paymentDetails != null) {
    AccountSessionPaymentDetails.encode(
      instance.paymentDetails!,
      container.nestedSingleValueContainer('payment_details').encoder,
    );
  }
  if (instance.payments != null) {
    AccountSessionPaymentDetails.encode(
      instance.payments!,
      container.nestedSingleValueContainer('payments').encoder,
    );
  }
  if (instance.payouts != null) {
    AccountSessionPayouts.encode(
      instance.payouts!,
      container.nestedSingleValueContainer('payouts').encoder,
    );
  }
  return container.value;
}