getCustomContentAttachments method

Future<MultiEntityResult<Attachment>> getCustomContentAttachments({
  1. required int id,
  2. String? sort,
  3. String? cursor,
  4. List<String>? status,
  5. String? mediaType,
  6. String? filename,
  7. int? limit,
  8. bool? serializeIdsAsStrings,
})

Returns the attachments of specific custom content. 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 content of the custom content and its corresponding space.

Implementation

Future<MultiEntityResult<Attachment>> getCustomContentAttachments(
    {required int id,
    String? sort,
    String? cursor,
    List<String>? status,
    String? mediaType,
    String? filename,
    int? limit,
    bool? serializeIdsAsStrings}) async {
  return MultiEntityResult.fromJson(
    await _client.send(
      'get',
      'custom-content/{id}/attachments',
      pathParameters: {
        'id': '$id',
      },
      queryParameters: {
        if (sort != null) 'sort': sort,
        if (cursor != null) 'cursor': cursor,
        if (status != null) 'status': status.map((e) => e).join(','),
        if (mediaType != null) 'mediaType': mediaType,
        if (filename != null) 'filename': filename,
        if (limit != null) 'limit': '$limit',
        if (serializeIdsAsStrings != null)
          'serialize-ids-as-strings': '$serializeIdsAsStrings',
      },
    ),
    reviver: (v) => Attachment.fromJson(v as Map<String, Object?>),
  );
}