getBlogPostVersions method

Future<MultiEntityResult<BlogPostVersion>> getBlogPostVersions({
  1. required int id,
  2. String? bodyFormat,
  3. String? cursor,
  4. int? limit,
  5. String? sort,
})

Returns the versions of specific blog post.

Permissions required: Permission to view the blog post and its corresponding space.

Implementation

Future<MultiEntityResult<BlogPostVersion>> getBlogPostVersions(
    {required int id,
    String? bodyFormat,
    String? cursor,
    int? limit,
    String? sort}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'blogposts/{id}/versions',
      pathParameters: {
        'id': '$id',
      },
      queryParameters: {
        if (bodyFormat != null) 'body-format': bodyFormat,
        if (cursor != null) 'cursor': cursor,
        if (limit != null) 'limit': '$limit',
        if (sort != null) 'sort': sort,
      },
    ),
    reviver: (v) => BlogPostVersion.fromJson(v as Map<String, Object?>),
  );
}