Skip to content

assets

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

ReposIssuesCommentsAssets

The repos.issues.comments.assets namespace.

create

create(
    owner: str, repo: str, id: int, *, name: str | None = None, updated_at: datetime | None = None, attachment: FilePart
) -> Attachment

Create a comment attachment.

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
name str | None

name of the attachment

None
updated_at datetime | None

time of the attachment's creation. This is a timestamp in RFC 3339 format

None
attachment FilePart

attachment to upload

required

Returns:

Type Description
Attachment

Attachment.

Raises:

Type Description
BadRequestError
  1. APIError is error format response.
NotFoundError
  1. APIError is error format response.
PayloadTooLargeError
  1. QuotaExceeded.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.

Operation ID: issueCreateIssueCommentAttachment

delete

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

Delete a comment attachment.

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
attachment_id int

id of the attachment to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APIError is error format response.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.

Operation ID: issueDeleteIssueCommentAttachment

get

get(owner: str, repo: str, id: int, attachment_id: int) -> Attachment

Get a comment attachment.

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
attachment_id int

id of the attachment to get

required

Returns:

Type Description
Attachment

Attachment.

Raises:

Type Description
NotFoundError
  1. APIError is error format response.

Operation ID: issueGetIssueCommentAttachment

list

list(owner: str, repo: str, id: int) -> list[Attachment]

List comment's attachments.

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
list[Attachment]

AttachmentList.

Raises:

Type Description
NotFoundError
  1. APIError is error format response.

Operation ID: issueListIssueCommentAttachments

update

update(
    owner: str,
    repo: str,
    id: int,
    attachment_id: int,
    *,
    browser_download_url: str | None = None,
    name: str | None = None,
) -> Attachment

Edit a comment attachment.

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
attachment_id int

id of the attachment to edit

required
browser_download_url str | None

(Can only be set if existing attachment is of external type)

None
name str | None
None

Returns:

Type Description
Attachment

Attachment.

Raises:

Type Description
NotFoundError
  1. APIError is error format response.
PayloadTooLargeError
  1. QuotaExceeded.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.

Operation ID: issueEditIssueCommentAttachment

AsyncReposIssuesCommentsAssets

The repos.issues.comments.assets namespace.

create

create(
    owner: str, repo: str, id: int, *, name: str | None = None, updated_at: datetime | None = None, attachment: FilePart
) -> Attachment

Create a comment attachment.

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
name str | None

name of the attachment

None
updated_at datetime | None

time of the attachment's creation. This is a timestamp in RFC 3339 format

None
attachment FilePart

attachment to upload

required

Returns:

Type Description
Attachment

Attachment.

Raises:

Type Description
BadRequestError
  1. APIError is error format response.
NotFoundError
  1. APIError is error format response.
PayloadTooLargeError
  1. QuotaExceeded.
UnprocessableEntityError
  1. APIValidationError is error format response related to input validation.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.

Operation ID: issueCreateIssueCommentAttachment

delete

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

Delete a comment attachment.

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
attachment_id int

id of the attachment to delete

required

Returns:

Type Description
None

No content.

Raises:

Type Description
NotFoundError
  1. APIError is error format response.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.

Operation ID: issueDeleteIssueCommentAttachment

get

get(owner: str, repo: str, id: int, attachment_id: int) -> Attachment

Get a comment attachment.

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
attachment_id int

id of the attachment to get

required

Returns:

Type Description
Attachment

Attachment.

Raises:

Type Description
NotFoundError
  1. APIError is error format response.

Operation ID: issueGetIssueCommentAttachment

list

list(owner: str, repo: str, id: int) -> list[Attachment]

List comment's attachments.

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
list[Attachment]

AttachmentList.

Raises:

Type Description
NotFoundError
  1. APIError is error format response.

Operation ID: issueListIssueCommentAttachments

update

update(
    owner: str,
    repo: str,
    id: int,
    attachment_id: int,
    *,
    browser_download_url: str | None = None,
    name: str | None = None,
) -> Attachment

Edit a comment attachment.

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
attachment_id int

id of the attachment to edit

required
browser_download_url str | None

(Can only be set if existing attachment is of external type)

None
name str | None
None

Returns:

Type Description
Attachment

Attachment.

Raises:

Type Description
NotFoundError
  1. APIError is error format response.
PayloadTooLargeError
  1. QuotaExceeded.
LockedError
  1. APIRepoArchivedError is an error that is raised when an archived repo should be modified.

Operation ID: issueEditIssueCommentAttachment