getDescendantsOfType method
Returns all descendants of a given type, for a piece of content. This is similar to Get content children by type, except that this method returns child pages at all levels, rather than just the direct child pages.
A piece of content has different types of descendants, depending on its type:
page
: descendant ispage
,comment
,attachment
blogpost
: descendant iscomment
,attachment
attachment
: descendant iscomment
comment
: descendant isattachment
Custom content types that are provided by apps can also be returned.
Permissions required: 'View' permission for the space, and permission to view the content if it is a page.
Implementation
Future<ContentArray> getDescendantsOfType(
{required String id,
required String type,
String? depth,
List<String>? expand,
int? start,
int? limit}) async {
return ContentArray.fromJson(await _client.send(
'get',
'wiki/rest/api/content/{id}/descendant/{type}',
pathParameters: {
'id': id,
'type': type,
},
queryParameters: {
if (depth != null) 'depth': depth,
if (expand != null) 'expand': expand.map((e) => e).join(','),
if (start != null) 'start': '$start',
if (limit != null) 'limit': '$limit',
},
));
}