rbtools.api.resource.draft_diff_commit¶
Resource definitions for draft diff commits.
Added in version 6.0: This was moved from rbtools.api.resource.
Classes
|
Item resource for draft diff commits. |
|
List resource for draft diff commits. |
- class rbtools.api.resource.draft_diff_commit.DraftDiffCommitItemResource(transport: Transport, payload: JSONDict, url: str, token: str | None = None, **kwargs)[source]¶
Bases:
BaseDiffCommitItemResourceItem resource for draft diff commits.
This corresponds to Review Board’s Draft Diff Commit Resource.
Added in version 4.2.
- __annotations_cache__ = {}¶
- __firstlineno__ = 34¶
- __static_attributes__ = ()¶
- get_draft_files(**kwargs: Unpack[FileDiffGetListParams]) FileDiffListResource[source]¶
Get the files for this commit.
- Parameters:
**kwargs (
dict) – Query arguments to include with the request.- Returns:
The file diff list resource.
- Return type:
rbtools.api.resource.FileDiffListResource- 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.draft_diff_commit.DraftDiffCommitListResource(transport: Transport, payload: JSONDict, url: str, token: str | None = None, item_mime_type: str | None = None, **kwargs)[source]¶
Bases:
ListResource[DraftDiffCommitItemResource]List resource for draft diff commits.
This corresponds to Review Board’s Draft Diff Commit List Resource.
- __annotations_cache__ = {}¶
- __firstlineno__ = 70¶
- __static_attributes__ = ()¶
- upload_commit(validation_info: str, diff: bytes, commit_id: str, parent_id: str, author_name: str, author_email: str, author_date: str, commit_message: str, committer_name: str | None = None, committer_email: str | None = None, committer_date: str | None = None, parent_diff: bytes | None = None, **kwargs: QueryArgs) HttpRequest[source]¶
Upload a commit.
- Parameters:
validation_info (
str) – The validation info, orNoneif this is the first commit in a series.diff (
bytes) – The diff contents.commit_id (
str) – The ID of the commit being uploaded.parent_id (
str) – The ID of the parent commit.author_name (
str) – The name of the author.author_email (
str) – The e-mail address of the author.author_date (
str) – The date and time the commit was authored in ISO 8601 format.commit_message (
str) – The commit message.committer_name (
str, optional) – The name of the committer (if applicable).committer_email (
str, optional) – The e-mail address of the committer (if applicable).committer_date (
str, optional) – The date and time the commit was committed in ISO 8601 format (if applicable).parent_diff (
bytes, optional) – The contents of the parent diff.**kwargs (
dictofrbtools.api.request.QueryArgs) – Query arguments to include with the request.
- Returns:
The created resource.
- Return type:
- Raises:
rbtools.api.errors.APIError – An error occurred while uploading the commit.