encode<V> static method

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

Implementation

static V encode<V>(
  PersonRelationship instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.director != null) {
    container.encodeBool(
      'director',
      instance.director!,
    );
  }
  if (instance.executive != null) {
    container.encodeBool(
      'executive',
      instance.executive!,
    );
  }
  if (instance.legalGuardian != null) {
    container.encodeBool(
      'legal_guardian',
      instance.legalGuardian!,
    );
  }
  if (instance.owner != null) {
    container.encodeBool(
      'owner',
      instance.owner!,
    );
  }
  if (instance.percentOwnership != null) {
    container.encodeDouble(
      'percent_ownership',
      instance.percentOwnership!,
    );
  }
  if (instance.representative != null) {
    container.encodeBool(
      'representative',
      instance.representative!,
    );
  }
  if (instance.title != null) {
    container.encodeString(
      'title',
      instance.title!,
    );
  }
  return container.value;
}