rbtools.api.resource.file_diff¶
Resource definitions for file diffs.
Added in version 6.0: This was moved from rbtools.api.resource.
Classes
Parameters for the file diff list GET operation. |
|
|
Item resource for file diffs. |
|
List resource for file diffs. |
- class rbtools.api.resource.file_diff.FileDiffGetListParams[source]¶
Bases:
BaseGetParamsParameters for the file diff list GET operation.
Added in version 6.0.
- __firstlineno__ = 241¶
- __static_attributes__ = ()¶
- class rbtools.api.resource.file_diff.FileDiffItemResource(transport: Transport, payload: JSONDict, url: str, token: str | None = None, **kwargs)[source]¶
Bases:
GetPatchMixin,ItemResourceItem resource for file diffs.
This corresponds to Review Board’s File Diff Resource.
Changed in version 6.0: Renamed from FileDiffResource.
- __firstlineno__ = 37¶
- __static_attributes__ = ()¶
- dest_detail: str¶
Additional information of the destination file.
This is parsed from the diff, but is usually not used for anything.
- extra_data: ResourceExtraDataField¶
Extra data as part of the diff.
- get_dest_attachment(**kwargs: Unpack[BaseGetParams]) FileAttachmentItemResource[source]¶
Get the file attachment for the modified file.
For binary files where an uploaded attachment exists, this will return the modified version of the file.
- Parameters:
**kwargs (
dict) – Query arguments to include with the request.- Returns:
The file attachment for the modified version.
- Return type:
rbtools.api.resource.FileAttachmentItemResource- Raises:
rbtools.api.errors.APIError – The Review Board API returned an error.
rbtools.api.errors.ServerInterfaceError – An error occurred while communicating with the server.
- get_diff_comments(**kwargs: Unpack[DiffCommentGetListParams]) DiffCommentListResource[source]¶
Get the comments for this file diff.
- Parameters:
**kwargs (
dict) – Query arguments to include with the request.- Returns:
The comments on this file diff.
- Return type:
rbtools.api.resource.DiffCommentListResource- Raises:
rbtools.api.errors.APIError – The Review Board API returned an error.
rbtools.api.errors.ServerInterfaceError – An error occurred while communicating with the server.
- get_diff_data(**kwargs: QueryArgs) HttpRequest[source]¶
Retrieve the actual raw diff data for the file.
- Parameters:
**kwargs (
dictofrbtools.api.request.QueryArgs) – Query arguments to include with the request.- Returns:
A resource wrapping the diff data.
- Return type:
rbtools.api.resource.ItemResource- Raises:
rbtools.api.errors.APIError – The Review Board API returned an error.
rbtools.api.errors.ServerInterfaceError – An error occurred while communicating with the server.
- get_original_file(**kwargs: QueryArgs) PlainTextResource[source]¶
Get the original version of the file.
- Parameters:
**kwargs (
dict) – Query arguments to include with the request.- Returns:
The original file.
- Return type:
rbtools.api.resource.PlainTextResource- Raises:
rbtools.api.errors.APIError – The Review Board API returned an error.
rbtools.api.errors.ServerInterfaceError – An error occurred while communicating with the server.
- get_patched_file(**kwargs: QueryArgs) PlainTextResource[source]¶
Get the patched version of the file.
- Parameters:
**kwargs (
dict) – Query arguments to include with the request.- Returns:
The patched file.
- Return type:
rbtools.api.resource.PlainTextResource- Raises:
rbtools.api.errors.APIError – The Review Board API returned an error.
rbtools.api.errors.ServerInterfaceError – An error occurred while communicating with the server.
- get_source_attachment(**kwargs: Unpack[BaseGetParams]) FileAttachmentItemResource[source]¶
Get the file attachment for the original file.
For binary files where an uploaded attachment exists, this will return the original version of the file.
- Parameters:
**kwargs (
dict) – Query arguments to include with the request.- Returns:
The file attachment for the original version.
- Return type:
rbtools.api.resource.FileAttachmentItemResource- Raises:
rbtools.api.errors.APIError – The Review Board API returned an error.
rbtools.api.errors.ServerInterfaceError – An error occurred while communicating with the server.
- source_revision: str¶
The revision of the file being modified.
This is a valid revision in the repository.
- status: Literal['copied', 'deleted', 'modified', 'moved', 'unknown']¶
The status of the file.
- class rbtools.api.resource.file_diff.FileDiffListResource(transport: Transport, payload: JSONDict, url: str, token: str | None = None, item_mime_type: str | None = None, **kwargs)[source]¶
Bases:
ListResource[FileDiffItemResource]List resource for file diffs.
This corresponds to Review Board’s File Diff List Resource.
Added in version 6.0.
- __annotations_cache__ = {}¶
- __firstlineno__ = 261¶
- __static_attributes__ = ()¶