validate method

void validate(
  1. LicenseValidationDocument document,
  2. Observer completion
)

Implementation

void validate(LicenseValidationDocument document, Observer completion) {
  LVEvent event;
  switch (document.runtimeType) {
    case LicenseValidationLicenseDocument:
      event = RetrievedLicenseDataEvent(document.data);
      break;
    case LicenseValidationStatusDocument:
      event = RetrievedStatusDataEvent(document.data);
      break;
    default:
      throw LcpException.unknown;
  }
  _log("validate $event");
  _observe(event, completion);
}