authenticate method

Future<AuthResponse> authenticate(
  1. Int8List username,
  2. Int8List password
)
override

Implementation

Future<AuthResponse> authenticate(
    Int8List username, Int8List password) async {
  oprot.writeMessageBegin(
      new TMessage("authenticate", TMessageType.CALL, nextSeqid()));
  authenticate_args args = new authenticate_args();
  args.username = username;
  args.password = password;
  args.write(oprot);
  oprot.writeMessageEnd();

  await oprot.trans_.flush();

  TMessage msg = iprot.readMessageBegin();
  if (msg.type == TMessageType.EXCEPTION) {
    TApplicationError error = TApplicationError.read(iprot);
    iprot.readMessageEnd();
    throw error;
  }

  authenticate_result result = new authenticate_result();
  result.read(iprot);
  iprot.readMessageEnd();
  if (result.isSetSuccess()) {
    return result.success!;
  }

  throw new TApplicationError(TApplicationErrorType.MISSING_RESULT,
      "authenticate failed: unknown result");
}