rbtools.api.resource.diff_file_attachment¶
Resource definitions for diff file attachments.
Added in version 6.0: This was moved from rbtools.api.resource.
Classes
Params for the diff file attachment list GET operation. |
|
|
Item resource for diff file attachments. |
|
List resource for diff file attachments. |
- class rbtools.api.resource.diff_file_attachment.DiffFileAttachmentGetListParams[source]¶
Bases:
BaseGetListParamsParams for the diff file attachment list GET operation.
Added in version 6.0.
- __firstlineno__ = 119¶
- __static_attributes__ = ()¶
- class rbtools.api.resource.diff_file_attachment.DiffFileAttachmentItemResource(transport: Transport, payload: JSONDict, url: str, token: str | None = None, **kwargs)[source]¶
Bases:
ItemResourceItem resource for diff file attachments.
This corresponds to Review Board’s Diff File Attachment Resource.
Added in version 6.0.
- __firstlineno__ = 35¶
- __static_attributes__ = ()¶
- extra_data: ResourceExtraDataField¶
Extra data as part of the file attachment.
- get_added_in_filediff(**kwargs: Unpack[BaseGetParams]) FileDiffItemResource[source]¶
Get the file diff that this attachment was added in.
- Parameters:
**kwargs (
dict) – Query arguments to include with the request.- Returns:
The file diff item resource.
- Return type:
rbtools.api.resource.FileDiffItemResource- Raises:
rbtools.api.errors.APIError – The Review Board API returned an error.
rbtools.api.errors.ServerInterfaceError – An error occurred while communicating with the server.
- class rbtools.api.resource.diff_file_attachment.DiffFileAttachmentListResource(transport: Transport, payload: JSONDict, url: str, token: str | None = None, item_mime_type: str | None = None, **kwargs)[source]¶
Bases:
ListResource[DiffFileAttachmentItemResource]List resource for diff file attachments.
This corresponds to Review Board’s Diff File Attachment List Resource.
Added in version 5.0.
- __firstlineno__ = 136¶
- __static_attributes__ = ()¶
- upload_attachment(*, filename: str, content: bytes, filediff_id: str, source_file: bool = False, **kwargs: QueryArgs) HttpRequest[source]¶
Upload a new attachment.
- Parameters:
filename (
str) – The name of the file.content (
bytes) – The content of the file to upload.filediff_id (
str) – The ID of the filediff to attach the file to.source_file (
bool, optional) – Whether to upload the source version of a file.**kwargs (
dictofrbtools.api.request.QueryArgs) – Query arguments to include with the request.
- Returns:
The newly created diff file attachment.
- Return type:
- Raises:
rbtools.api.errors.APIError – The Review Board API returned an error.
rbtools.api.errors.ServerInterfaceError – An error occurred while communicating with the server.