getBlogpostAttachments method

Future<MultiEntityResult<Attachment>> getBlogpostAttachments({
  1. required int id,
  2. String? sort,
  3. String? cursor,
  4. List<String>? status,
  5. String? mediaType,
  6. String? filename,
  7. int? limit,
})

Returns the attachments of specific blog post. 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 blog post and its corresponding space.

Implementation

Future<MultiEntityResult<Attachment>> getBlogpostAttachments(
    {required int id,
    String? sort,
    String? cursor,
    List<String>? status,
    String? mediaType,
    String? filename,
    int? limit}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'blogposts/{id}/attachments',
      pathParameters: {
        'id': '$id',
      },
      queryParameters: {
        if (sort != null) 'sort': sort,
        if (cursor != null) 'cursor': cursor,
        if (status != null) 'status': status.map((e) => e).join(','),
        if (mediaType != null) 'mediaType': mediaType,
        if (filename != null) 'filename': filename,
        if (limit != null) 'limit': '$limit',
      },
    ),
    reviver: (v) => Attachment.fromJson(v as Map<String, Object?>),
  );
}