2020-08-05 23:21:26 +02:00
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
|
2020-08-06 22:06:53 +02:00
|
|
|
import 'main.dart';
|
2020-08-05 23:21:26 +02:00
|
|
|
|
2020-08-06 22:06:53 +02:00
|
|
|
extension PostEndpoint on V1 {
|
2020-08-05 23:21:26 +02:00
|
|
|
/// POST /post
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#post
|
2020-08-06 22:06:53 +02:00
|
|
|
String createPost({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required String name,
|
|
|
|
String url,
|
|
|
|
String body,
|
|
|
|
@required bool nsfw,
|
|
|
|
@required int communityId,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// GET /post
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-post
|
2020-08-06 22:06:53 +02:00
|
|
|
String getPost({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int id,
|
|
|
|
String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// GET /post/list
|
2020-08-06 22:06:53 +02:00
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-posts
|
|
|
|
String getPosts({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required String type,
|
|
|
|
@required String sort,
|
|
|
|
int page,
|
|
|
|
int limit,
|
|
|
|
int communityId,
|
|
|
|
String communityName,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /post/like
|
2020-08-06 22:06:53 +02:00
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#create-post-like
|
|
|
|
String createPostLike({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int postId,
|
2020-08-08 23:24:34 +02:00
|
|
|
@required Vote score,
|
2020-08-05 23:21:26 +02:00
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// PUT /post
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#edit-post
|
2020-08-06 22:06:53 +02:00
|
|
|
String editPost({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int editId,
|
|
|
|
@required String name,
|
|
|
|
String url,
|
|
|
|
String body,
|
|
|
|
@required bool nsfw,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /post/delete
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#delete-post
|
|
|
|
/// delete a post in a user deleting their own kind of way
|
2020-08-06 22:06:53 +02:00
|
|
|
String deletePost({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int editId,
|
|
|
|
@required bool deleted,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /post/remove
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#remove-post
|
|
|
|
/// remove post in an admin kind of way
|
2020-08-06 22:06:53 +02:00
|
|
|
String removePost({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int editId,
|
|
|
|
@required bool removed,
|
|
|
|
String reason,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /post/save
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#save-post
|
2020-08-06 22:06:53 +02:00
|
|
|
String savePost({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int postId,
|
|
|
|
@required bool save,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
}
|