370 lines
11 KiB
Dart
Raw Normal View History

/// Auto gen code from rust ast, do not edit
part of 'dispatch.dart';
2021-09-01 22:50:22 +08:00
2021-07-20 23:51:08 +08:00
class WorkspaceEventCreateWorkspace {
2021-09-01 22:50:22 +08:00
CreateWorkspaceRequest request;
WorkspaceEventCreateWorkspace(this.request);
2021-07-20 23:51:08 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Workspace, WorkspaceError>> send() {
2021-07-20 23:51:08 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.CreateWorkspace.toString()
..payload = requestToBytes(this.request);
2021-07-20 23:51:08 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(Workspace.fromBuffer(okBytes)),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-20 23:51:08 +08:00
}
2021-07-29 17:46:20 +08:00
class WorkspaceEventReadCurWorkspace {
2021-09-01 22:50:22 +08:00
WorkspaceEventReadCurWorkspace();
2021-07-20 23:51:08 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Workspace, WorkspaceError>> send() {
final request = FFIRequest.create()
..event = WorkspaceEvent.ReadCurWorkspace.toString();
2021-07-20 23:51:08 +08:00
2021-09-01 22:50:22 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
(okBytes) => left(Workspace.fromBuffer(okBytes)),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-20 23:51:08 +08:00
}
class WorkspaceEventReadWorkspaces {
2021-09-01 22:50:22 +08:00
QueryWorkspaceRequest request;
WorkspaceEventReadWorkspaces(this.request);
2021-07-20 23:51:08 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<RepeatedWorkspace, WorkspaceError>> send() {
2021-07-20 23:51:08 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.ReadWorkspaces.toString()
..payload = requestToBytes(this.request);
2021-07-20 23:51:08 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(RepeatedWorkspace.fromBuffer(okBytes)),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-20 23:51:08 +08:00
}
2021-07-29 17:46:20 +08:00
class WorkspaceEventDeleteWorkspace {
2021-09-01 22:50:22 +08:00
DeleteWorkspaceRequest request;
WorkspaceEventDeleteWorkspace(this.request);
2021-07-29 17:46:20 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Unit, WorkspaceError>> send() {
2021-07-29 17:46:20 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.DeleteWorkspace.toString()
..payload = requestToBytes(this.request);
2021-07-29 17:46:20 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(bytes) => left(unit),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-29 17:46:20 +08:00
}
class WorkspaceEventOpenWorkspace {
2021-09-01 22:50:22 +08:00
QueryWorkspaceRequest request;
WorkspaceEventOpenWorkspace(this.request);
2021-07-26 13:51:41 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Workspace, WorkspaceError>> send() {
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.OpenWorkspace.toString()
..payload = requestToBytes(this.request);
2021-07-26 13:51:41 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(Workspace.fromBuffer(okBytes)),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-26 13:51:41 +08:00
}
2021-07-20 23:51:08 +08:00
class WorkspaceEventCreateApp {
2021-09-01 22:50:22 +08:00
CreateAppRequest request;
WorkspaceEventCreateApp(this.request);
2021-07-20 23:51:08 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<App, WorkspaceError>> send() {
2021-07-20 23:51:08 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.CreateApp.toString()
..payload = requestToBytes(this.request);
2021-07-20 23:51:08 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(App.fromBuffer(okBytes)),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-20 23:51:08 +08:00
}
2021-07-29 17:46:20 +08:00
class WorkspaceEventDeleteApp {
2021-09-01 22:50:22 +08:00
DeleteAppRequest request;
WorkspaceEventDeleteApp(this.request);
2021-07-29 17:46:20 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Unit, WorkspaceError>> send() {
2021-07-29 17:46:20 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.DeleteApp.toString()
..payload = requestToBytes(this.request);
2021-07-29 17:46:20 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(bytes) => left(unit),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-29 17:46:20 +08:00
}
class WorkspaceEventReadApp {
2021-09-01 22:50:22 +08:00
QueryAppRequest request;
WorkspaceEventReadApp(this.request);
2021-07-20 23:51:08 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<App, WorkspaceError>> send() {
2021-07-20 23:51:08 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.ReadApp.toString()
..payload = requestToBytes(this.request);
2021-07-20 23:51:08 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(App.fromBuffer(okBytes)),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-20 23:51:08 +08:00
}
2021-07-29 17:46:20 +08:00
class WorkspaceEventUpdateApp {
2021-09-01 22:50:22 +08:00
UpdateAppRequest request;
WorkspaceEventUpdateApp(this.request);
2021-07-29 17:46:20 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Unit, WorkspaceError>> send() {
2021-07-29 17:46:20 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.UpdateApp.toString()
..payload = requestToBytes(this.request);
2021-07-29 17:46:20 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(bytes) => left(unit),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-29 17:46:20 +08:00
}
2021-07-20 23:51:08 +08:00
class WorkspaceEventCreateView {
2021-09-01 22:50:22 +08:00
CreateViewRequest request;
WorkspaceEventCreateView(this.request);
2021-07-20 23:51:08 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<View, WorkspaceError>> send() {
2021-07-20 23:51:08 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.CreateView.toString()
..payload = requestToBytes(this.request);
2021-07-20 23:51:08 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(View.fromBuffer(okBytes)),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-20 23:51:08 +08:00
}
2021-07-23 23:56:59 +08:00
class WorkspaceEventReadView {
2021-09-01 22:50:22 +08:00
QueryViewRequest request;
WorkspaceEventReadView(this.request);
2021-07-23 23:56:59 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<View, WorkspaceError>> send() {
2021-07-23 23:56:59 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.ReadView.toString()
..payload = requestToBytes(this.request);
2021-07-23 23:56:59 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(View.fromBuffer(okBytes)),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-23 23:56:59 +08:00
}
class WorkspaceEventUpdateView {
2021-09-01 22:50:22 +08:00
UpdateViewRequest request;
WorkspaceEventUpdateView(this.request);
2021-07-23 23:56:59 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Unit, WorkspaceError>> send() {
2021-07-23 23:56:59 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.UpdateView.toString()
..payload = requestToBytes(this.request);
2021-07-23 23:56:59 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(bytes) => left(unit),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-23 23:56:59 +08:00
}
2021-07-29 17:46:20 +08:00
class WorkspaceEventDeleteView {
2021-09-01 22:50:22 +08:00
DeleteViewRequest request;
WorkspaceEventDeleteView(this.request);
2021-07-29 17:46:20 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Unit, WorkspaceError>> send() {
2021-07-29 17:46:20 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = WorkspaceEvent.DeleteView.toString()
..payload = requestToBytes(this.request);
2021-07-29 17:46:20 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(bytes) => left(unit),
(errBytes) => right(WorkspaceError.fromBuffer(errBytes)),
));
}
2021-07-29 17:46:20 +08:00
}
2021-07-31 10:50:56 +08:00
class EditorEventCreateDoc {
2021-09-01 22:50:22 +08:00
CreateDocRequest request;
EditorEventCreateDoc(this.request);
2021-07-31 10:50:56 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<DocInfo, DocError>> send() {
2021-07-31 10:50:56 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = EditorEvent.CreateDoc.toString()
..payload = requestToBytes(this.request);
2021-07-31 10:50:56 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(DocInfo.fromBuffer(okBytes)),
(errBytes) => right(DocError.fromBuffer(errBytes)),
));
}
2021-07-31 10:50:56 +08:00
}
class EditorEventUpdateDoc {
2021-09-01 22:50:22 +08:00
UpdateDocRequest request;
EditorEventUpdateDoc(this.request);
2021-07-31 10:50:56 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Unit, DocError>> send() {
2021-07-31 10:50:56 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = EditorEvent.UpdateDoc.toString()
..payload = requestToBytes(this.request);
2021-07-31 10:50:56 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(bytes) => left(unit),
(errBytes) => right(DocError.fromBuffer(errBytes)),
));
}
2021-07-31 10:50:56 +08:00
}
class EditorEventReadDocInfo {
2021-09-01 22:50:22 +08:00
QueryDocRequest request;
EditorEventReadDocInfo(this.request);
2021-07-31 10:50:56 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<DocInfo, DocError>> send() {
2021-07-31 10:50:56 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = EditorEvent.ReadDocInfo.toString()
..payload = requestToBytes(this.request);
2021-07-31 10:50:56 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(DocInfo.fromBuffer(okBytes)),
(errBytes) => right(DocError.fromBuffer(errBytes)),
));
}
2021-07-31 10:50:56 +08:00
}
class EditorEventReadDocData {
2021-09-01 22:50:22 +08:00
QueryDocDataRequest request;
EditorEventReadDocData(this.request);
2021-07-31 10:50:56 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<DocData, DocError>> send() {
2021-07-31 10:50:56 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = EditorEvent.ReadDocData.toString()
..payload = requestToBytes(this.request);
2021-07-31 10:50:56 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(DocData.fromBuffer(okBytes)),
(errBytes) => right(DocError.fromBuffer(errBytes)),
));
}
2021-07-31 10:50:56 +08:00
}
class UserEventGetStatus {
2021-09-01 22:50:22 +08:00
UserEventGetStatus();
2021-09-01 22:50:22 +08:00
Future<Either<UserDetail, UserError>> send() {
final request = FFIRequest.create()
..event = UserEvent.GetUserProfile.toString();
2021-09-01 22:50:22 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
(okBytes) => left(UserDetail.fromBuffer(okBytes)),
(errBytes) => right(UserError.fromBuffer(errBytes)),
));
}
}
class UserEventSignIn {
2021-09-01 22:50:22 +08:00
SignInRequest request;
UserEventSignIn(this.request);
2021-09-01 22:50:22 +08:00
Future<Either<UserDetail, UserError>> send() {
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = UserEvent.SignIn.toString()
..payload = requestToBytes(this.request);
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(UserDetail.fromBuffer(okBytes)),
(errBytes) => right(UserError.fromBuffer(errBytes)),
));
}
}
class UserEventSignUp {
2021-09-01 22:50:22 +08:00
SignUpRequest request;
UserEventSignUp(this.request);
2021-09-01 22:50:22 +08:00
Future<Either<UserDetail, UserError>> send() {
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = UserEvent.SignUp.toString()
..payload = requestToBytes(this.request);
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(okBytes) => left(UserDetail.fromBuffer(okBytes)),
(errBytes) => right(UserError.fromBuffer(errBytes)),
));
}
}
class UserEventSignOut {
2021-09-01 22:50:22 +08:00
UserEventSignOut();
2021-09-01 22:50:22 +08:00
Future<Either<Unit, UserError>> send() {
final request = FFIRequest.create()..event = UserEvent.SignOut.toString();
2021-09-01 22:50:22 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
(bytes) => left(unit),
(errBytes) => right(UserError.fromBuffer(errBytes)),
));
}
}
2021-07-08 21:23:44 +08:00
2021-07-20 23:51:08 +08:00
class UserEventUpdateUser {
2021-09-01 22:50:22 +08:00
UpdateUserRequest request;
UserEventUpdateUser(this.request);
2021-07-20 23:51:08 +08:00
2021-09-01 22:50:22 +08:00
Future<Either<Unit, UserError>> send() {
2021-07-20 23:51:08 +08:00
final request = FFIRequest.create()
2021-09-01 22:50:22 +08:00
..event = UserEvent.UpdateUser.toString()
..payload = requestToBytes(this.request);
2021-07-20 23:51:08 +08:00
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
2021-09-01 22:50:22 +08:00
(bytes) => left(unit),
(errBytes) => right(UserError.fromBuffer(errBytes)),
));
}
2021-07-20 23:51:08 +08:00
}