encode<V> static method

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

Implementation

static V encode<V>(
  AccountDocuments instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.bankAccountOwnershipVerification != null) {
    AccountBankAccountOwnershipVerification.encode(
      instance.bankAccountOwnershipVerification!,
      container
          .nestedSingleValueContainer('bank_account_ownership_verification')
          .encoder,
    );
  }
  if (instance.companyLicense != null) {
    AccountBankAccountOwnershipVerification.encode(
      instance.companyLicense!,
      container.nestedSingleValueContainer('company_license').encoder,
    );
  }
  if (instance.companyMemorandumOfAssociation != null) {
    AccountBankAccountOwnershipVerification.encode(
      instance.companyMemorandumOfAssociation!,
      container
          .nestedSingleValueContainer('company_memorandum_of_association')
          .encoder,
    );
  }
  if (instance.companyMinisterialDecree != null) {
    AccountBankAccountOwnershipVerification.encode(
      instance.companyMinisterialDecree!,
      container
          .nestedSingleValueContainer('company_ministerial_decree')
          .encoder,
    );
  }
  if (instance.companyRegistrationVerification != null) {
    AccountBankAccountOwnershipVerification.encode(
      instance.companyRegistrationVerification!,
      container
          .nestedSingleValueContainer('company_registration_verification')
          .encoder,
    );
  }
  if (instance.companyTaxIdVerification != null) {
    AccountBankAccountOwnershipVerification.encode(
      instance.companyTaxIdVerification!,
      container
          .nestedSingleValueContainer('company_tax_id_verification')
          .encoder,
    );
  }
  if (instance.proofOfRegistration != null) {
    AccountBankAccountOwnershipVerification.encode(
      instance.proofOfRegistration!,
      container.nestedSingleValueContainer('proof_of_registration').encoder,
    );
  }
  return container.value;
}