add client_test.dart

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-06-16 22:19:00 +05:30
parent 7c9bc3b950
commit e8e1d53aa3
12 changed files with 2356 additions and 75 deletions
@@ -142,13 +142,13 @@ class MessageApi {
/// Get all the reactions for a [messageId]
Future<QueryReactionsResponse> getReactions(
String messageId,
PaginationParams options,
) async {
String messageId, {
PaginationParams? options,
}) async {
final response = await _client.get(
'/messages/$messageId/reactions',
queryParameters: {
...options.toJson(),
if (options != null) ...options.toJson(),
},
);
return QueryReactionsResponse.fromJson(response.data);
@@ -168,13 +168,13 @@ class MessageApi {
/// Lists all the message replies for the [parentId]
Future<QueryRepliesResponse> getReplies(
String parentId,
PaginationParams options,
) async {
String parentId, {
PaginationParams? options,
}) async {
final response = await _client.get(
'/messages/$parentId/replies',
queryParameters: {
...options.toJson(),
if (options != null) ...options.toJson(),
},
);
return QueryRepliesResponse.fromJson(response.data);