code_gen.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /// Auto gen code from rust ast, do not edit
  2. part of 'dispatch.dart';
  3. class UserEventAuthCheck {
  4. UserSignInParams params;
  5. UserEventAuthCheck(this.params);
  6. Future<Either<UserSignInResult, FlowyError>> send() {
  7. return paramsToBytes(params).fold(
  8. (bytes) {
  9. final request = FFIRequest.create()
  10. ..event = UserEvent.AuthCheck.toString()
  11. ..payload = bytes;
  12. return Dispatch.asyncRequest(request)
  13. .then((bytesResult) => bytesResult.fold(
  14. (bytes) => left(UserSignInResult.fromBuffer(bytes)),
  15. (error) => right(error),
  16. ));
  17. },
  18. (err) => Future(() => right(err)),
  19. );
  20. }
  21. }
  22. class UserEventSignIn {
  23. UserSignInParams params;
  24. UserEventSignIn(this.params);
  25. Future<Either<UserSignInResult, FlowyError>> send() {
  26. return paramsToBytes(params).fold(
  27. (bytes) {
  28. final request = FFIRequest.create()
  29. ..event = UserEvent.SignIn.toString()
  30. ..payload = bytes;
  31. return Dispatch.asyncRequest(request)
  32. .then((bytesResult) => bytesResult.fold(
  33. (bytes) => left(UserSignInResult.fromBuffer(bytes)),
  34. (error) => right(error),
  35. ));
  36. },
  37. (err) => Future(() => right(err)),
  38. );
  39. }
  40. }