encode<V> static method

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

Implementation

static V encode<V>(
  TokenAccount instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.businessType != null) {
    AccountCreateOptionsBusinessType.encode(
      instance.businessType!,
      container.nestedSingleValueContainer('business_type').encoder,
    );
  }
  if (instance.company != null) {
    TokenCompany.encode(
      instance.company!,
      container.nestedSingleValueContainer('company').encoder,
    );
  }
  if (instance.individual != null) {
    AccountIndividual.encode(
      instance.individual!,
      container.nestedSingleValueContainer('individual').encoder,
    );
  }
  if (instance.tosShownAndAccepted != null) {
    container.encodeBool(
      'tos_shown_and_accepted',
      instance.tosShownAndAccepted!,
    );
  }
  return container.value;
}