Interface ChangeApi
-
- All Known Implementing Classes:
ChangeApi.NotImplemented
public interface ChangeApi
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classChangeApi.CheckSubmitRequirementRequeststatic classChangeApi.CommentsRequeststatic classChangeApi.DraftsRequeststatic classChangeApi.NotImplementedA default implementation which allows source compatibility when adding new methods to the interface.static classChangeApi.SuggestedReviewersRequest
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidabandon()voidabandon(AbandonInput in)ReviewerResultaddReviewer(ReviewerInput in)default ReviewerResultaddReviewer(String reviewer)AccountInfoaddToAttentionSet(AttentionSetInput input)Adds a user to the attention set.AttentionSetApiattention(String id)Manage the attention set.ChangeInfocheck()ChangeInfocheck(FixInput fix)SubmitRequirementResultInfocheckSubmitRequirement(SubmitRequirementInput input)Returns the result of evaluating theSubmitRequirementInputinput on the change.ChangeApi.CheckSubmitRequirementRequestcheckSubmitRequirementRequest()default Map<String,List<CommentInfo>>comments()Deprecated.Callers should usecommentsRequest()insteaddefault List<CommentInfo>commentsAsList()Deprecated.Callers should usecommentsRequest()insteadChangeApi.CommentsRequestcommentsRequest()Get aChangeApi.CommentsRequestentity that can be used to retrieve published comments.ChangeInfocreateMergePatchSet(MergePatchSetInput in)Create a merge patch set for the change.default RevisionApicurrent()Look up the current revision for the change.voiddelete()Deletes a change.AccountInfodeleteAssignee()Delete the assignee of a change.default Map<String,List<CommentInfo>>drafts()Get all draft comments for the current user on a change.default List<CommentInfo>draftsAsList()Get all draft comments for the current user on a change as a list.ChangeApi.DraftsRequestdraftsRequest()Get aChangeApi.DraftsRequestentity that can be used to retrieve draft comments.ChangeEditApiedit()Provides access to an API regarding the change edit of this change.default ChangeInfoget()get(ListChangesOption...)with all options included, except for the following.default ChangeInfoget(com.google.common.collect.ImmutableListMultimap<String,String> pluginOptions)default ChangeInfoget(ListChangesOption... options)default ChangeInfoget(Iterable<ListChangesOption> options)default ChangeInfoget(EnumSet<ListChangesOption> options)ChangeInfoget(EnumSet<ListChangesOption> options, com.google.common.collect.ImmutableListMultimap<String,String> pluginOptions)AccountInfogetAssignee()Get the assignee of a change.Set<String>getHashtags()Get hashtags on a change.List<AccountInfo>getPastAssignees()Get all past assignees.Stringid()IncludedInInfoincludedIn()voidindex()default ChangeInfoinfo()get(ListChangesOption...)with no options included.ChangeMessageApimessage(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.default ChangeInfoDifferencemetaDiff(String oldMetaRevId, String newMetaRevId)default ChangeInfoDifferencemetaDiff(String oldMetaRevId, String newMetaRevId, ListChangesOption... options)default ChangeInfoDifferencemetaDiff(String oldMetaRevId, String newMetaRevId, Collection<ListChangesOption> options)ChangeInfoDifferencemetaDiff(String oldMetaRevId, String newMetaRevId, EnumSet<ListChangesOption> options, com.google.common.collect.ImmutableListMultimap<String,String> pluginOptions)Gets the diff between a change's metadata with the two given refs.voidmove(MoveInput in)default voidmove(String destination)PureRevertInfopureRevert()Check if this change is a pure revert of the change stored in revertOf.PureRevertInfopureRevert(String claimedOriginal)Check if this change is a pure revert of claimedOriginal (SHA1 in 40 digit hex).default voidrebase()Rebase the current revision of a change using default options.voidrebase(RebaseInput in)Rebase the current revision of a change.default voidrestore()voidrestore(RestoreInput in)default ChangeApirevert()Create a new change that reverts this change.ChangeApirevert(RevertInput in)Create a new change that reverts this change.default RevertSubmissionInforevertSubmission()RevertSubmissionInforevertSubmission(RevertInput in)ReviewerApireviewer(String id)Look up the reviewer of the change.List<ReviewerInfo>reviewers()Retrieve reviewers (ReviewerState.REVIEWERandReviewerState.CC) on the change.default RevisionApirevision(int id)Look up a revision of a change by number.RevisionApirevision(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.AccountInfosetAssignee(AssigneeInput input)Set the assignee of a change.voidsetHashtags(HashtagsInput input)Set hashtags on a changevoidsetMessage(CommitMessageInput in)Create a new patch set with a new commit message.default voidsetMessage(String message)Create a new patch set with a new commit message.default voidsetPrivate(boolean value)voidsetPrivate(boolean value, String message)default voidsetReadyForReview()voidsetReadyForReview(String message)default voidsetWorkInProgress()voidsetWorkInProgress(String message)default List<ChangeInfo>submittedTogether()default SubmittedTogetherInfosubmittedTogether(EnumSet<SubmittedTogetherOption> options)SubmittedTogetherInfosubmittedTogether(EnumSet<ListChangesOption> listOptions, EnumSet<SubmittedTogetherOption> submitOptions)default ChangeApi.SuggestedReviewersRequestsuggestCcs(String query)ChangeApi.SuggestedReviewersRequestsuggestReviewers()default ChangeApi.SuggestedReviewersRequestsuggestReviewers(String query)Stringtopic()voidtopic(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
RevisionApiinstances.- 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
-
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)
-
revertSubmission
default RevertSubmissionInfo revertSubmission() throws RestApiException
- Throws:
RestApiException
-
revertSubmission
RevertSubmissionInfo revertSubmission(RevertInput in) throws RestApiException
- Throws:
RestApiException
-
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 RestApiExceptionRebase 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 RestApiExceptionDeletes 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 ReviewerResult addReviewer(String reviewer) throws RestApiException
- Throws:
RestApiException
-
addReviewer
ReviewerResult addReviewer(ReviewerInput 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.REVIEWERandReviewerState.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.CHECKis omitted, to skip consistency checks.SKIP_DIFFSTATis omitted to ensure diffstat calculations.
- Throws:
RestApiException
-
metaDiff
default ChangeInfoDifference metaDiff(String oldMetaRevId, String newMetaRevId) throws RestApiException
- Throws:
RestApiException
-
metaDiff
default ChangeInfoDifference metaDiff(String oldMetaRevId, String newMetaRevId, ListChangesOption... options) throws RestApiException
- Throws:
RestApiException
-
metaDiff
default ChangeInfoDifference metaDiff(String oldMetaRevId, String newMetaRevId, Collection<ListChangesOption> options) throws RestApiException
- Throws:
RestApiException
-
metaDiff
ChangeInfoDifference metaDiff(String oldMetaRevId, String newMetaRevId, EnumSet<ListChangesOption> options, com.google.common.collect.ImmutableListMultimap<String,String> pluginOptions) throws RestApiException
Gets the diff between a change's metadata with the two given refs.- Parameters:
oldMetaRevId- the SHA-1 of the 'before' metadata diffed againstnewMetaRevIdnewMetaRevId- the SHA-1 of the 'after' metadata diffed againstoldMetaRevId- 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
ChangeEditApifor 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
-
attention
AttentionSetApi attention(String id) throws RestApiException
Manage the attention set.- Parameters:
id- The account identifier.- Throws:
RestApiException
-
addToAttentionSet
AccountInfo addToAttentionSet(AttentionSetInput input) throws RestApiException
Adds a user to the attention set.- 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
@Deprecated default Map<String,List<CommentInfo>> comments() throws RestApiException
Deprecated.Callers should usecommentsRequest()insteadGet all published comments on a change.- Returns:
- comments in a map keyed by path; comments have the
revisionfield set to indicate their patch set. - Throws:
RestApiException
-
commentsAsList
@Deprecated default List<CommentInfo> commentsAsList() throws RestApiException
Deprecated.Callers should usecommentsRequest()insteadGet all published comments on a change as a list.- Returns:
- comments as a list; comments have the
revisionfield set to indicate their patch set. - Throws:
RestApiException
-
commentsRequest
ChangeApi.CommentsRequest commentsRequest() throws RestApiException
Get aChangeApi.CommentsRequestentity that can be used to retrieve published comments.- Returns:
- A
ChangeApi.CommentsRequestentity that can be used to retrieve the comments using theChangeApi.CommentsRequest.get()orChangeApi.CommentsRequest.getAsList(). - 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
revisionfield set to indicate their patch set. - Throws:
RestApiException
-
drafts
default 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
revisionfield set to indicate their patch set. - Throws:
RestApiException
-
draftsAsList
default 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
revisionfield set to indicate their patch set. - Throws:
RestApiException
-
draftsRequest
ChangeApi.DraftsRequest draftsRequest() throws RestApiException
Get aChangeApi.DraftsRequestentity that can be used to retrieve draft comments.- Returns:
- A
ChangeApi.DraftsRequestentity that can be used to retrieve the draft comments usingChangeApi.CommentsRequest.get()orChangeApi.CommentsRequest.getAsList(). - Throws:
RestApiException
-
check
ChangeInfo check() throws RestApiException
- Throws:
RestApiException
-
check
ChangeInfo check(FixInput fix) throws RestApiException
- Throws:
RestApiException
-
checkSubmitRequirementRequest
ChangeApi.CheckSubmitRequirementRequest checkSubmitRequirementRequest() throws RestApiException
- Throws:
RestApiException
-
checkSubmitRequirement
SubmitRequirementResultInfo checkSubmitRequirement(SubmitRequirementInput input) throws RestApiException
Returns the result of evaluating theSubmitRequirementInputinput on the change.- 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 theObjectIdof a commit on the change meta branch.- Returns:
- API for accessing a change message.
- Throws:
RestApiException- if the id is invalid.
-
-