Interface ChangeApi
-
- All Known Implementing Classes:
ChangeApi.NotImplemented
public interface ChangeApi
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ChangeApi.CheckSubmitRequirementRequest
static class
ChangeApi.CommentsRequest
static class
ChangeApi.DraftsRequest
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 Deprecated Methods Modifier and Type Method Description default void
abandon()
void
abandon(AbandonInput in)
ReviewerResult
addReviewer(ReviewerInput in)
default ReviewerResult
addReviewer(String reviewer)
AccountInfo
addToAttentionSet(AttentionSetInput input)
Adds a user to the attention set.AttentionSetApi
attention(String id)
Manage the attention set.ChangeInfo
check()
ChangeInfo
check(FixInput fix)
SubmitRequirementResultInfo
checkSubmitRequirement(SubmitRequirementInput input)
Returns the result of evaluating theSubmitRequirementInput
input on the change.ChangeApi.CheckSubmitRequirementRequest
checkSubmitRequirementRequest()
default Map<String,List<CommentInfo>>
comments()
Deprecated.Callers should usecommentsRequest()
insteaddefault List<CommentInfo>
commentsAsList()
Deprecated.Callers should usecommentsRequest()
insteadChangeApi.CommentsRequest
commentsRequest()
Get aChangeApi.CommentsRequest
entity that can be used to retrieve published comments.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.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.DraftsRequest
draftsRequest()
Get aChangeApi.DraftsRequest
entity that can be used to retrieve draft comments.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()
IncludedInInfo
includedIn()
void
index()
default ChangeInfo
info()
get(ListChangesOption...)
with no options included.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.default ChangeInfoDifference
metaDiff(String oldMetaRevId, String newMetaRevId)
default ChangeInfoDifference
metaDiff(String oldMetaRevId, String newMetaRevId, ListChangesOption... options)
default ChangeInfoDifference
metaDiff(String oldMetaRevId, String newMetaRevId, Collection<ListChangesOption> options)
ChangeInfoDifference
metaDiff(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.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.default RevertSubmissionInfo
revertSubmission()
RevertSubmissionInfo
revertSubmission(RevertInput in)
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
-
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 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 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.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_DIFFSTAT
is 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 againstnewMetaRevId
newMetaRevId
- 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
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
-
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
revision
field 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
revision
field set to indicate their patch set. - Throws:
RestApiException
-
commentsRequest
ChangeApi.CommentsRequest commentsRequest() throws RestApiException
Get aChangeApi.CommentsRequest
entity that can be used to retrieve published comments.- Returns:
- A
ChangeApi.CommentsRequest
entity 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
revision
field 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
revision
field 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
revision
field set to indicate their patch set. - Throws:
RestApiException
-
draftsRequest
ChangeApi.DraftsRequest draftsRequest() throws RestApiException
Get aChangeApi.DraftsRequest
entity that can be used to retrieve draft comments.- Returns:
- A
ChangeApi.DraftsRequest
entity 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 theSubmitRequirementInput
input 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 theObjectId
of a commit on the change meta branch.- Returns:
- API for accessing a change message.
- Throws:
RestApiException
- if the id is invalid.
-
-