File Comments

A FileComment is a comment attached to a file by a user.

List File Comments by Path

SDK Method

files_sdk.file_comment.list_for()

Return Object

ListObj[FileComment]

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
path
string
Required
Path to operate on.

Additional Arguments

Example Request

import files_sdk

try:
  file_comments = files_sdk.file_comment.list_for(path)
  for file_comment in file_comments.auto_paging_iter():
    # Operate on file_comment
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

Create File Comment

SDK Method

files_sdk.file_comment.create()

Return Object

FileComment

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
body
string
Required
Comment body.
path
string
Required
File path.

Example Request

import files_sdk

try:
  file_comment = files_sdk.file_comment.create({
    "body": "What a great file!",
    "path": "path"
  })
  # Operate on file_comment
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

Update File Comment

SDK Method

file_comment.update()

Return Object

FileComment

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
body
string
Required
Comment body.

Example Request

import files_sdk

try:
  file_comment = files_sdk.file_comment.list.first
  file_comment.update({
    "body": "What a great file!"
  })
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

Delete File Comment

SDK Method

file_comment.delete()

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

import files_sdk

try:
  file_comment = files_sdk.file_comment.list.first
  file_comment.delete()
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

The FileComment Object

Some of the methods above return a FileComment object. The attributes of this object are listed below.

AttributeDescription
id
int64
File Comment ID
body
string
Comment body.
reactions
array(object)
Reactions to this comment.