getAttachmentLabels method

Future<MultiEntityResult<Label>> getAttachmentLabels({
  1. required int id,
  2. String? prefix,
  3. String? sort,
  4. String? cursor,
  5. int? limit,
  6. bool? serializeIdsAsStrings,
})

Returns the labels of specific attachment. 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 parent content of the attachment and its corresponding space.

Implementation

Future<MultiEntityResult<Label>> getAttachmentLabels(
    {required int id,
    String? prefix,
    String? sort,
    String? cursor,
    int? limit,
    bool? serializeIdsAsStrings}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'attachments/{id}/labels',
      pathParameters: {
        'id': '$id',
      },
      queryParameters: {
        if (prefix != null) 'prefix': prefix,
        if (sort != null) 'sort': sort,
        if (cursor != null) 'cursor': cursor,
        if (limit != null) 'limit': '$limit',
        if (serializeIdsAsStrings != null)
          'serialize-ids-as-strings': '$serializeIdsAsStrings',
      },
    ),
    reviver: (v) => Label.fromJson(v as Map<String, Object?>),
  );
}