getAttachmentById method

Future<Attachment> getAttachmentById({
  1. required String id,
  2. int? version,
  3. bool? serializeIdsAsStrings,
})

Returns a specific attachment.

Permissions required: Permission to view the attachment's container.

Implementation

Future<Attachment> getAttachmentById(
    {required String id, int? version, bool? serializeIdsAsStrings}) async {
  return Attachment.fromJson(await _client.send(
    'get',
    'attachments/{id}',
    pathParameters: {
      'id': id,
    },
    queryParameters: {
      if (version != null) 'version': '$version',
      if (serializeIdsAsStrings != null)
        'serialize-ids-as-strings': '$serializeIdsAsStrings',
    },
  ));
}