getPageVersions method

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

Returns the versions of specific page.

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

Implementation

Future<MultiEntityResult<PageVersion>> getPageVersions(
    {required int id,
    String? bodyFormat,
    String? cursor,
    int? limit,
    String? sort}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'pages/{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) => PageVersion.fromJson(v as Map<String, Object?>),
  );
}