Interface ChangeApi
-
- All Known Implementing Classes:
ChangeApi.NotImplemented
public interface ChangeApi
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ChangeApi.NotImplemented
A default implementation which allows source compatibility when adding new methods to the interface.static class
ChangeApi.SuggestedReviewersRequest
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
abandon()
void
abandon(AbandonInput in)
AddReviewerResult
addReviewer(AddReviewerInput in)
default AddReviewerResult
addReviewer(String reviewer)
ChangeInfo
check()
ChangeInfo
check(FixInput fix)
Map<String,List<CommentInfo>>
comments()
Get all published comments on a change.List<CommentInfo>
commentsAsList()
Get all published comments on a change as a list.ChangeInfo
createMergePatchSet(MergePatchSetInput in)
Create a merge patch set for the change.default RevisionApi
current()
Look up the current revision for the change.void
delete()
Deletes a change.AccountInfo
deleteAssignee()
Delete the assignee of a change.Map<String,List<CommentInfo>>
drafts()
Get all draft comments for the current user on a change.List<CommentInfo>
draftsAsList()
Get all draft comments for the current user on a change as a list.ChangeEditApi
edit()
Provides access to an API regarding the change edit of this change.default ChangeInfo
get()
get(ListChangesOption...)
with all options included, except for the following.default ChangeInfo
get(com.google.common.collect.ImmutableListMultimap<String,String> pluginOptions)
default ChangeInfo
get(ListChangesOption... options)
default ChangeInfo
get(Iterable<ListChangesOption> options)
default ChangeInfo
get(EnumSet<ListChangesOption> options)
ChangeInfo
get(EnumSet<ListChangesOption> options, com.google.common.collect.ImmutableListMultimap<String,String> pluginOptions)
AccountInfo
getAssignee()
Get the assignee of a change.Set<String>
getHashtags()
Get hashtags on a change.List<AccountInfo>
getPastAssignees()
Get all past assignees.String
id()
void
ignore(boolean ignore)
Ignore or un-ignore this change.boolean
ignored()
Check if this change is ignored.IncludedInInfo
includedIn()
void
index()
default ChangeInfo
info()
get(ListChangesOption...)
with no options included.void
markAsReviewed(boolean reviewed)
Mark this change as reviewed/unreviewed.ChangeMessageApi
message(String id)
Look up a change message of a change by its id.List<ChangeMessageInfo>
messages()
Get all messages of a change with detailed account info.void
move(MoveInput in)
default void
move(String destination)
PureRevertInfo
pureRevert()
Check if this change is a pure revert of the change stored in revertOf.PureRevertInfo
pureRevert(String claimedOriginal)
Check if this change is a pure revert of claimedOriginal (SHA1 in 40 digit hex).default void
rebase()
Rebase the current revision of a change using default options.void
rebase(RebaseInput in)
Rebase the current revision of a change.default void
restore()
void
restore(RestoreInput in)
default ChangeApi
revert()
Create a new change that reverts this change.ChangeApi
revert(RevertInput in)
Create a new change that reverts this change.ReviewerApi
reviewer(String id)
Look up the reviewer of the change.List<ReviewerInfo>
reviewers()
Retrieve reviewers (ReviewerState.REVIEWER
andReviewerState.CC
) on the change.default RevisionApi
revision(int id)
Look up a revision of a change by number.RevisionApi
revision(String id)
Look up a revision of a change by commit SHA-1 or other supported revision string.Map<String,List<RobotCommentInfo>>
robotComments()
Get all robot comments on a change.AccountInfo
setAssignee(AssigneeInput input)
Set the assignee of a change.void
setHashtags(HashtagsInput input)
Set hashtags on a changevoid
setMessage(CommitMessageInput in)
Create a new patch set with a new commit message.default void
setMessage(String message)
Create a new patch set with a new commit message.default void
setPrivate(boolean value)
void
setPrivate(boolean value, String message)
default void
setReadyForReview()
void
setReadyForReview(String message)
default void
setWorkInProgress()
void
setWorkInProgress(String message)
default List<ChangeInfo>
submittedTogether()
default SubmittedTogetherInfo
submittedTogether(EnumSet<SubmittedTogetherOption> options)
SubmittedTogetherInfo
submittedTogether(EnumSet<ListChangesOption> listOptions, EnumSet<SubmittedTogetherOption> submitOptions)
default ChangeApi.SuggestedReviewersRequest
suggestCcs(String query)
ChangeApi.SuggestedReviewersRequest
suggestReviewers()
default ChangeApi.SuggestedReviewersRequest
suggestReviewers(String query)
String
topic()
void
topic(String topic)
-
-
-
Method Detail
-
id
String id()
-
current
default RevisionApi current() throws RestApiException
Look up the current revision for the change.Note: This method eagerly reads the revision. Methods that mutate the revision do not necessarily re-read the revision. Therefore, calling a getter method on an instance after calling a mutation method on that same instance is not guaranteed to reflect the mutation. It is not recommended to store references to
RevisionApi
instances.- Returns:
- API for accessing the revision.
- Throws:
RestApiException
- if an error occurred.
-
revision
default RevisionApi revision(int id) throws RestApiException
Look up a revision of a change by number.- Throws:
RestApiException
- See Also:
current()
-
revision
RevisionApi revision(String id) throws RestApiException
Look up a revision of a change by commit SHA-1 or other supported revision string.- Throws:
RestApiException
- See Also:
current()
-
reviewer
ReviewerApi reviewer(String id) throws RestApiException
Look up the reviewer of the change.- Parameters:
id
- ID of the account, can be a string of the format "Full Name <[email protected]>", just the email address, a full name if it is unique, an account ID, a user name or 'self' for the calling user.- Returns:
- API for accessing the reviewer.
- Throws:
RestApiException
- if id is not account ID or is a user that isn't known to be a reviewer for this change.
-
abandon
default void abandon() throws RestApiException
- Throws:
RestApiException
-
abandon
void abandon(AbandonInput in) throws RestApiException
- Throws:
RestApiException
-
restore
default void restore() throws RestApiException
- Throws:
RestApiException
-
restore
void restore(RestoreInput in) throws RestApiException
- Throws:
RestApiException
-
move
default void move(String destination) throws RestApiException
- Throws:
RestApiException
-
move
void move(MoveInput in) throws RestApiException
- Throws:
RestApiException
-
setPrivate
void setPrivate(boolean value, String message) throws RestApiException
- Throws:
RestApiException
-
setPrivate
default void setPrivate(boolean value) throws RestApiException
- Throws:
RestApiException
-
setWorkInProgress
void setWorkInProgress(String message) throws RestApiException
- Throws:
RestApiException
-
setReadyForReview
void setReadyForReview(String message) throws RestApiException
- Throws:
RestApiException
-
setWorkInProgress
default void setWorkInProgress() throws RestApiException
- Throws:
RestApiException
-
setReadyForReview
default void setReadyForReview() throws RestApiException
- Throws:
RestApiException
-
ignore
void ignore(boolean ignore) throws RestApiException
Ignore or un-ignore this change.- Parameters:
ignore
- ignore the change if true- Throws:
RestApiException
-
ignored
boolean ignored() throws RestApiException
Check if this change is ignored.- Returns:
- true if the change is ignored
- Throws:
RestApiException
-
markAsReviewed
void markAsReviewed(boolean reviewed) throws RestApiException
Mark this change as reviewed/unreviewed.- Parameters:
reviewed
- flag to decide if this change should be marked as reviewed (true
) or unreviewed (false
)- Throws:
RestApiException
-
revert
default ChangeApi revert() throws RestApiException
Create a new change that reverts this change.- Throws:
RestApiException
- See Also:
Changes.id(int)
-
revert
ChangeApi revert(RevertInput in) throws RestApiException
Create a new change that reverts this change.- Throws:
RestApiException
- See Also:
Changes.id(int)
-
createMergePatchSet
ChangeInfo createMergePatchSet(MergePatchSetInput in) throws RestApiException
Create a merge patch set for the change.- Throws:
RestApiException
-
submittedTogether
default List<ChangeInfo> submittedTogether() throws RestApiException
- Throws:
RestApiException
-
submittedTogether
default SubmittedTogetherInfo submittedTogether(EnumSet<SubmittedTogetherOption> options) throws RestApiException
- Throws:
RestApiException
-
submittedTogether
SubmittedTogetherInfo submittedTogether(EnumSet<ListChangesOption> listOptions, EnumSet<SubmittedTogetherOption> submitOptions) throws RestApiException
- Throws:
RestApiException
-
rebase
default void rebase() throws RestApiException
Rebase the current revision of a change using default options.- Throws:
RestApiException
-
rebase
void rebase(RebaseInput in) throws RestApiException
Rebase the current revision of a change.- Throws:
RestApiException
-
delete
void delete() throws RestApiException
Deletes a change.- Throws:
RestApiException
-
topic
String topic() throws RestApiException
- Throws:
RestApiException
-
topic
void topic(String topic) throws RestApiException
- Throws:
RestApiException
-
includedIn
IncludedInInfo includedIn() throws RestApiException
- Throws:
RestApiException
-
addReviewer
default AddReviewerResult addReviewer(String reviewer) throws RestApiException
- Throws:
RestApiException
-
addReviewer
AddReviewerResult addReviewer(AddReviewerInput in) throws RestApiException
- Throws:
RestApiException
-
suggestReviewers
ChangeApi.SuggestedReviewersRequest suggestReviewers() throws RestApiException
- Throws:
RestApiException
-
suggestReviewers
default ChangeApi.SuggestedReviewersRequest suggestReviewers(String query) throws RestApiException
- Throws:
RestApiException
-
suggestCcs
default ChangeApi.SuggestedReviewersRequest suggestCcs(String query) throws RestApiException
- Throws:
RestApiException
-
reviewers
List<ReviewerInfo> reviewers() throws RestApiException
Retrieve reviewers (ReviewerState.REVIEWER
andReviewerState.CC
) on the change.- Throws:
RestApiException
-
get
ChangeInfo get(EnumSet<ListChangesOption> options, com.google.common.collect.ImmutableListMultimap<String,String> pluginOptions) throws RestApiException
- Throws:
RestApiException
-
get
default ChangeInfo get(com.google.common.collect.ImmutableListMultimap<String,String> pluginOptions) throws RestApiException
- Throws:
RestApiException
-
get
default ChangeInfo get(EnumSet<ListChangesOption> options) throws RestApiException
- Throws:
RestApiException
-
get
default ChangeInfo get(Iterable<ListChangesOption> options) throws RestApiException
- Throws:
RestApiException
-
get
default ChangeInfo get(ListChangesOption... options) throws RestApiException
- Throws:
RestApiException
-
get
default ChangeInfo get() throws RestApiException
get(ListChangesOption...)
with all options included, except for the following.CHECK
is omitted, to skip consistency checks.SKIP_MERGEABLE
is omitted, so themergeable
bit is set.SKIP_DIFFSTAT
is omitted to ensure diffstat calculations.
- Throws:
RestApiException
-
info
default ChangeInfo info() throws RestApiException
get(ListChangesOption...)
with no options included.- Throws:
RestApiException
-
edit
ChangeEditApi edit() throws RestApiException
Provides access to an API regarding the change edit of this change.- Returns:
- a
ChangeEditApi
for the change edit of this change - Throws:
RestApiException
- if the API isn't accessible
-
setMessage
default void setMessage(String message) throws RestApiException
Create a new patch set with a new commit message.- Throws:
RestApiException
-
setMessage
void setMessage(CommitMessageInput in) throws RestApiException
Create a new patch set with a new commit message.- Throws:
RestApiException
-
setHashtags
void setHashtags(HashtagsInput input) throws RestApiException
Set hashtags on a change- Throws:
RestApiException
-
getHashtags
Set<String> getHashtags() throws RestApiException
Get hashtags on a change.- Returns:
- hashtags
- Throws:
RestApiException
-
setAssignee
AccountInfo setAssignee(AssigneeInput input) throws RestApiException
Set the assignee of a change.- Throws:
RestApiException
-
getAssignee
AccountInfo getAssignee() throws RestApiException
Get the assignee of a change.- Throws:
RestApiException
-
getPastAssignees
List<AccountInfo> getPastAssignees() throws RestApiException
Get all past assignees.- Throws:
RestApiException
-
deleteAssignee
AccountInfo deleteAssignee() throws RestApiException
Delete the assignee of a change.- Returns:
- the assignee that was deleted, or null if there was no assignee.
- Throws:
RestApiException
-
comments
Map<String,List<CommentInfo>> comments() throws RestApiException
Get all published comments on a change.- Returns:
- comments in a map keyed by path; comments have the
revision
field set to indicate their patch set. - Throws:
RestApiException
-
commentsAsList
List<CommentInfo> commentsAsList() throws RestApiException
Get all published comments on a change as a list.- Returns:
- comments as a list; comments have the
revision
field set to indicate their patch set. - Throws:
RestApiException
-
robotComments
Map<String,List<RobotCommentInfo>> robotComments() throws RestApiException
Get all robot comments on a change.- Returns:
- robot comments in a map keyed by path; robot comments have the
revision
field set to indicate their patch set. - Throws:
RestApiException
-
drafts
Map<String,List<CommentInfo>> drafts() throws RestApiException
Get all draft comments for the current user on a change.- Returns:
- drafts in a map keyed by path; comments have the
revision
field set to indicate their patch set. - Throws:
RestApiException
-
draftsAsList
List<CommentInfo> draftsAsList() throws RestApiException
Get all draft comments for the current user on a change as a list.- Returns:
- drafts as a list; comments have the
revision
field set to indicate their patch set. - Throws:
RestApiException
-
check
ChangeInfo check() throws RestApiException
- Throws:
RestApiException
-
check
ChangeInfo check(FixInput fix) throws RestApiException
- Throws:
RestApiException
-
index
void index() throws RestApiException
- Throws:
RestApiException
-
pureRevert
PureRevertInfo pureRevert() throws RestApiException
Check if this change is a pure revert of the change stored in revertOf.- Throws:
RestApiException
-
pureRevert
PureRevertInfo pureRevert(String claimedOriginal) throws RestApiException
Check if this change is a pure revert of claimedOriginal (SHA1 in 40 digit hex).- Throws:
RestApiException
-
messages
List<ChangeMessageInfo> messages() throws RestApiException
Get all messages of a change with detailed account info.- Returns:
- a list of messages sorted by their creation time.
- Throws:
RestApiException
-
message
ChangeMessageApi message(String id) throws RestApiException
Look up a change message of a change by its id.- Parameters:
id
- the id of the change message. In NoteDb, this id is theObjectId
of a commit on the change meta branch.- Returns:
- API for accessing a change message.
- Throws:
RestApiException
- if the id is invalid.
-
-