getLabelBlogPosts method

Future<MultiEntityResult<BlogPostBulk>> getLabelBlogPosts({
  1. required int id,
  2. List<int>? spaceId,
  3. String? bodyFormat,
  4. String? sort,
  5. String? cursor,
  6. int? limit,
})

Returns the blogposts of specified label. The number of results is limited by the limit parameter and additional results (if available) will be available through the next URL present in the Link response header.

Permissions required: Permission to view the content of the page and its corresponding space.

Implementation

Future<MultiEntityResult<BlogPostBulk>> getLabelBlogPosts(
    {required int id,
    List<int>? spaceId,
    String? bodyFormat,
    String? sort,
    String? cursor,
    int? limit}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'labels/{id}/blogposts',
      pathParameters: {
        'id': '$id',
      },
      queryParameters: {
        if (spaceId != null) 'space-id': spaceId.map((e) => '$e').join(','),
        if (bodyFormat != null) 'body-format': bodyFormat,
        if (sort != null) 'sort': sort,
        if (cursor != null) 'cursor': cursor,
        if (limit != null) 'limit': '$limit',
      },
    ),
    reviver: (v) => BlogPostBulk.fromJson(v as Map<String, Object?>),
  );
}