encode<V> static method

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

Implementation

static V encode<V>(
  PersonDocuments instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.companyAuthorization != null) {
    PersonCompanyAuthorization.encode(
      instance.companyAuthorization!,
      container.nestedSingleValueContainer('company_authorization').encoder,
    );
  }
  if (instance.passport != null) {
    PersonCompanyAuthorization.encode(
      instance.passport!,
      container.nestedSingleValueContainer('passport').encoder,
    );
  }
  if (instance.visa != null) {
    PersonCompanyAuthorization.encode(
      instance.visa!,
      container.nestedSingleValueContainer('visa').encoder,
    );
  }
  return container.value;
}