getPostsThreadedPaged static method

Future<PostSearchResponseResponse> getPostsThreadedPaged(
  1. HttpClient client,
  2. bool getParentPost,
  3. int page,
  4. int pageSize,
  5. String parentPostId,
  6. int replySize,
  7. bool rootThreadMode,
  8. String showbanned,
  9. ForumPostSortEnum sortMode,
)

Returns a thread of posts at the given parent, optionally returning replies to those posts as well as the original parent.

Implementation

static Future<PostSearchResponseResponse> getPostsThreadedPaged (
    HttpClient client,
    bool getParentPost,
    int page,
    int pageSize,
    String parentPostId,
    int replySize,
    bool rootThreadMode,
    String showbanned,
    ForumPostSortEnum sortMode,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _getParentPost = '$getParentPost';
    final String _page = '$page';
    final String _pageSize = '$pageSize';
    final String _parentPostId = '$parentPostId';
    final String _replySize = '$replySize';
    final String _rootThreadMode = '$rootThreadMode';
    final String _sortMode = '${sortMode.value}';
    params['showbanned'] = showbanned;
    final HttpClientConfig config = HttpClientConfig('GET', '/Forum/GetPostsThreadedPaged/$_parentPostId/$_page/$_pageSize/$_replySize/$_getParentPost/$_rootThreadMode/$_sortMode/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return PostSearchResponseResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}