Skip to content

comments

Accessed as client.repos.issues.comments; the async client mirrors it.

ReposIssuesComments

The repos.issues.comments namespace.

create

create(owner: str, repo: str, index: int, *, body: str, updated_at: datetime | None = None) -> Comment

Add a comment to an issue.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
index int

index of the issue

required
body str

The body of the comment

required
updated_at datetime | None

The time of the comment's update, needs admin or repository owner permission

None

Returns:

Type Description
Comment

Comment.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueCreateComment

delete

delete(owner: str, repo: str, id: int) -> None

Delete a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of comment to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueDeleteComment

delete_for_issue

delete_for_issue(owner: str, repo: str, index: int, id: int) -> None

Delete a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
index int

this parameter is ignored

required
id int

id of comment to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.
Deprecated

Deprecated in the vendored Spec; generated for compatibility.

Operation ID: issueDeleteCommentDeprecated

get

get(owner: str, repo: str, id: int) -> Comment | None

Get a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the comment

required

Returns:

Type Description
Comment | None

Comment.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueGetComment

list

list(
    owner: str, repo: str, index: int, *, since: datetime | None = None, before: datetime | None = None
) -> list[Comment]

List all comments on an issue.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
index int

index of the issue

required
since datetime | None

if provided, only comments updated since the specified time are returned.

None
before datetime | None

if provided, only comments updated before the provided time are returned.

None

Returns:

Type Description
list[Comment]

CommentList.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueGetComments

list_all

list_all(
    owner: str,
    repo: str,
    *,
    since: datetime | None = None,
    before: datetime | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> Paginated[Comment]

List all comments in a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
since datetime | None

if provided, only comments updated since the provided time are returned.

None
before datetime | None

if provided, only comments updated before the provided time are returned.

None
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
Paginated[Comment]

CommentList.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueGetRepoComments

update

update(owner: str, repo: str, id: int, *, body: str, updated_at: datetime | None = None) -> Comment | None

Edit a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the comment to edit

required
body str

The body of the comment

required
updated_at datetime | None

The time of the comment's update, needs admin or repository owner permission

None

Returns:

Type Description
Comment | None

Comment.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueEditComment

update_for_issue

update_for_issue(
    owner: str, repo: str, index: int, id: int, *, body: str, updated_at: datetime | None = None
) -> Comment | None

Edit a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
index int

this parameter is ignored

required
id int

id of the comment to edit

required
body str

The body of the comment

required
updated_at datetime | None

The time of the comment's update, needs admin or repository owner permission

None

Returns:

Type Description
Comment | None

Comment.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.
Deprecated

Deprecated in the vendored Spec; generated for compatibility.

Operation ID: issueEditCommentDeprecated

AsyncReposIssuesComments

The repos.issues.comments namespace.

create

create(owner: str, repo: str, index: int, *, body: str, updated_at: datetime | None = None) -> Comment

Add a comment to an issue.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
index int

index of the issue

required
body str

The body of the comment

required
updated_at datetime | None

The time of the comment's update, needs admin or repository owner permission

None

Returns:

Type Description
Comment

Comment.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueCreateComment

delete

delete(owner: str, repo: str, id: int) -> None

Delete a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of comment to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueDeleteComment

delete_for_issue

delete_for_issue(owner: str, repo: str, index: int, id: int) -> None

Delete a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
index int

this parameter is ignored

required
id int

id of comment to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.
Deprecated

Deprecated in the vendored Spec; generated for compatibility.

Operation ID: issueDeleteCommentDeprecated

get

get(owner: str, repo: str, id: int) -> Comment | None

Get a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the comment

required

Returns:

Type Description
Comment | None

Comment.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueGetComment

list

list(
    owner: str, repo: str, index: int, *, since: datetime | None = None, before: datetime | None = None
) -> list[Comment]

List all comments on an issue.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
index int

index of the issue

required
since datetime | None

if provided, only comments updated since the specified time are returned.

None
before datetime | None

if provided, only comments updated before the provided time are returned.

None

Returns:

Type Description
list[Comment]

CommentList.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueGetComments

list_all

list_all(
    owner: str,
    repo: str,
    *,
    since: datetime | None = None,
    before: datetime | None = None,
    page: int | None = None,
    limit: int | None = None,
) -> AsyncPaginated[Comment]

List all comments in a repository.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
since datetime | None

if provided, only comments updated since the provided time are returned.

None
before datetime | None

if provided, only comments updated before the provided time are returned.

None
page int | None

1-based page to start iteration at.

None
limit int | None

Page size; the instance caps it server-side.

None

Returns:

Type Description
AsyncPaginated[Comment]

CommentList.

Raises:

Type Description
NotFoundError
  1. APINotFound is a not found error response.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueGetRepoComments

update

update(owner: str, repo: str, id: int, *, body: str, updated_at: datetime | None = None) -> Comment | None

Edit a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
id int

id of the comment to edit

required
body str

The body of the comment

required
updated_at datetime | None

The time of the comment's update, needs admin or repository owner permission

None

Returns:

Type Description
Comment | None

Comment.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.

Operation ID: issueEditComment

update_for_issue

update_for_issue(
    owner: str, repo: str, index: int, id: int, *, body: str, updated_at: datetime | None = None
) -> Comment | None

Edit a comment.

Parameters:

Name Type Description Default
owner str

owner of the repo

required
repo str

name of the repo

required
index int

this parameter is ignored

required
id int

id of the comment to edit

required
body str

The body of the comment

required
updated_at datetime | None

The time of the comment's update, needs admin or repository owner permission

None

Returns:

Type Description
Comment | None

Comment.

Raises:

Type Description
ForbiddenError
  1. APIForbiddenError is a forbidden error response.
NotFoundError
  1. APINotFound is a not found error response.
ServerError
  1. APIInternalServerError is an error that is raised when an internal server error occurs.
Deprecated

Deprecated in the vendored Spec; generated for compatibility.

Operation ID: issueEditCommentDeprecated