getAttachmentVersions method

Future<MultiEntityResult<AttachmentVersion>> getAttachmentVersions({
  1. required String id,
  2. String? cursor,
  3. int? limit,
  4. String? sort,
})

Returns the versions of specific attachment.

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

Implementation

Future<MultiEntityResult<AttachmentVersion>> getAttachmentVersions(
    {required String id, String? cursor, int? limit, String? sort}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'attachments/{id}/versions',
      pathParameters: {
        'id': id,
      },
      queryParameters: {
        if (cursor != null) 'cursor': cursor,
        if (limit != null) 'limit': '$limit',
        if (sort != null) 'sort': sort,
      },
    ),
    reviver: (v) => AttachmentVersion.fromJson(v as Map<String, Object?>),
  );
}