getCustomContentByTypeInBlogPost method

Future<MultiEntityResult<CustomContentBulk>> getCustomContentByTypeInBlogPost({
  1. required int id,
  2. required String type,
  3. String? sort,
  4. String? cursor,
  5. int? limit,
  6. String? bodyFormat,
  7. bool? serializeIdsAsStrings,
})

Returns all custom content for a given type within a given blogpost. 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 custom content, the container of the custom content (blog post), and the corresponding space.

Implementation

Future<MultiEntityResult<CustomContentBulk>> getCustomContentByTypeInBlogPost(
    {required int id,
    required String type,
    String? sort,
    String? cursor,
    int? limit,
    String? bodyFormat,
    bool? serializeIdsAsStrings}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'blogposts/{id}/custom-content',
      pathParameters: {
        'id': '$id',
      },
      queryParameters: {
        'type': type,
        if (sort != null) 'sort': sort,
        if (cursor != null) 'cursor': cursor,
        if (limit != null) 'limit': '$limit',
        if (bodyFormat != null) 'body-format': bodyFormat,
        if (serializeIdsAsStrings != null)
          'serialize-ids-as-strings': '$serializeIdsAsStrings',
      },
    ),
    reviver: (v) => CustomContentBulk.fromJson(v as Map<String, Object?>),
  );
}