encode<V> static method

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

Implementation

static V encode<V>(
  TaxIDsOwner instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.account != null) {
    AccountOrId.encode(
      instance.account!,
      container.nestedSingleValueContainer('account').encoder,
    );
  }
  if (instance.application != null) {
    ApplicationOrId.encode(
      instance.application!,
      container.nestedSingleValueContainer('application').encoder,
    );
  }
  if (instance.customer != null) {
    CustomerOrId.encode(
      instance.customer!,
      container.nestedSingleValueContainer('customer').encoder,
    );
  }
  container.encodeString(
    'type',
    instance.type,
  );
  return container.value;
}