Interface ChangeApi
- All Known Implementing Classes:
ChangeApi.NotImplemented
public interface ChangeApi
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
static class
static class
static class
A default implementation which allows source compatibility when adding new methods to the interface.static class
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
abandon()
void
abandon
(AbandonInput in) default ReviewerResult
addReviewer
(String reviewer) Adds a user to the attention set.Manage the attention set.check()
Returns the result of evaluating theSubmitRequirementInput
input on the change.default Map<String,
List<CommentInfo>> comments()
Deprecated.default List<CommentInfo>
Deprecated.Callers should usecommentsRequest()
insteadGet aChangeApi.CommentsRequest
entity that can be used to retrieve published comments.Create a merge patch set for the change.default RevisionApi
current()
Look up the current revision for the change.void
delete()
Deletes a change.default Map<String,
List<CommentInfo>> drafts()
Get all draft comments for the current user on a change.default List<CommentInfo>
Get all draft comments for the current user on a change as a list.Get aChangeApi.DraftsRequest
entity that can be used to retrieve draft comments.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
default ChangeInfo
get
(ListChangesOption... options) default ChangeInfo
get
(Iterable<ListChangesOption> options) default ChangeInfo
get
(EnumSet<ListChangesOption> options) get
(EnumSet<ListChangesOption> options, com.google.common.collect.ImmutableListMultimap<String, String> pluginOptions) Gets the custom keyed values on a change.Get hashtags on a change.id()
void
index()
default ChangeInfo
info()
get(ListChangesOption...)
with no options included.Look up a change message of a change by its id.messages()
Get all messages of a change with detailed account info.default ChangeInfoDifference
default ChangeInfoDifference
metaDiff
(String oldMetaRevId, String newMetaRevId, ListChangesOption... options) default ChangeInfoDifference
metaDiff
(String oldMetaRevId, String newMetaRevId, Collection<ListChangesOption> options) 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
default void
Check if this change is a pure revert of the change stored in revertOf.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 Response<RebaseChainInfo>
Rebase the current revisions of a change's chain using default options.Rebase the current revisions of a change's chain.default void
restore()
void
restore
(RestoreInput in) default ChangeApi
revert()
Create a new change that reverts this change.revert
(RevertInput in) Create a new change that reverts this change.default RevertSubmissionInfo
Look up the reviewer of the change.Retrieve reviewers (ReviewerState.REVIEWER
andReviewerState.CC
) on the change.default RevisionApi
revision
(int id) Look up a revision of a change by number.Look up a revision of a change by commit SHA-1 or other supported revision string.Get all robot comments on a change.void
Set custom keyed values on a changevoid
setHashtags
(HashtagsInput input) Set hashtags on a changevoid
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
void
setReadyForReview
(String message) default void
void
setWorkInProgress
(String message) default List<ChangeInfo>
default SubmittedTogetherInfo
submittedTogether
(EnumSet<SubmittedTogetherOption> options) submittedTogether
(EnumSet<ListChangesOption> listOptions, EnumSet<SubmittedTogetherOption> submitOptions) suggestCcs
(String query) suggestReviewers
(String query) topic()
void
-
Method Details
-
id
String id() -
current
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
Look up a revision of a change by number.- Throws:
RestApiException
- See Also:
-
revision
Look up a revision of a change by commit SHA-1 or other supported revision string.- Throws:
RestApiException
- See Also:
-
reviewer
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
- Throws:
RestApiException
-
abandon
- Throws:
RestApiException
-
restore
- Throws:
RestApiException
-
restore
- Throws:
RestApiException
-
move
- Throws:
RestApiException
-
move
- Throws:
RestApiException
-
setPrivate
- Throws:
RestApiException
-
setPrivate
- Throws:
RestApiException
-
setWorkInProgress
- Throws:
RestApiException
-
setReadyForReview
- Throws:
RestApiException
-
setWorkInProgress
- Throws:
RestApiException
-
setReadyForReview
- Throws:
RestApiException
-
revert
Create a new change that reverts this change.- Throws:
RestApiException
- See Also:
-
revert
Create a new change that reverts this change.- Throws:
RestApiException
- See Also:
-
revertSubmission
- Throws:
RestApiException
-
revertSubmission
- Throws:
RestApiException
-
createMergePatchSet
Create a merge patch set for the change.- Throws:
RestApiException
-
applyPatch
- Throws:
RestApiException
-
submittedTogether
- 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
Rebase the current revision of a change using default options.- Throws:
RestApiException
-
rebase
Rebase the current revision of a change.- Throws:
RestApiException
-
rebaseChain
Rebase the current revisions of a change's chain using default options.- Returns:
- a
RebaseChainInfo
contains theChangeInfo
data for the rebased the chain - Throws:
RestApiException
-
rebaseChain
Rebase the current revisions of a change's chain.- Returns:
- a
RebaseChainInfo
contains theChangeInfo
data for the rebased the chain - Throws:
RestApiException
-
delete
Deletes a change.- Throws:
RestApiException
-
topic
- Throws:
RestApiException
-
topic
- Throws:
RestApiException
-
includedIn
- Throws:
RestApiException
-
addReviewer
- Throws:
RestApiException
-
addReviewer
- Throws:
RestApiException
-
suggestReviewers
- Throws:
RestApiException
-
suggestReviewers
- Throws:
RestApiException
-
suggestCcs
- Throws:
RestApiException
-
reviewers
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
- Throws:
RestApiException
-
get
- Throws:
RestApiException
-
get
- Throws:
RestApiException
-
get
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 RestApiExceptionGets 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
get(ListChangesOption...)
with no options included.- Throws:
RestApiException
-
edit
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
-
getMessage
- Throws:
RestApiException
-
setMessage
Create a new patch set with a new commit message.- Throws:
RestApiException
-
setMessage
Create a new patch set with a new commit message.- Throws:
RestApiException
-
setHashtags
Set hashtags on a change- Throws:
RestApiException
-
getHashtags
Get hashtags on a change.- Returns:
- hashtags
- Throws:
RestApiException
-
setCustomKeyedValues
Set custom keyed values on a change- Throws:
RestApiException
-
getCustomKeyedValues
com.google.common.collect.ImmutableMap<String,String> getCustomKeyedValues() throws RestApiExceptionGets the custom keyed values on a change.- Returns:
- customKeyedValues
- Throws:
RestApiException
-
attention
Manage the attention set.- Parameters:
id
- The account identifier.- Throws:
RestApiException
-
addToAttentionSet
@CanIgnoreReturnValue AccountInfo addToAttentionSet(AttentionSetInput input) throws RestApiException Adds a user to the attention set.- Throws:
RestApiException
-
comments
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.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
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
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
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
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
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
- Throws:
RestApiException
-
check
- Throws:
RestApiException
-
checkSubmitRequirementRequest
- Throws:
RestApiException
-
checkSubmitRequirement
SubmitRequirementResultInfo checkSubmitRequirement(SubmitRequirementInput input) throws RestApiException Returns the result of evaluating theSubmitRequirementInput
input on the change.- Throws:
RestApiException
-
index
- Throws:
RestApiException
-
pureRevert
Check if this change is a pure revert of the change stored in revertOf.- Throws:
RestApiException
-
pureRevert
Check if this change is a pure revert of claimedOriginal (SHA1 in 40 digit hex).- Throws:
RestApiException
-
messages
Get all messages of a change with detailed account info.- Returns:
- a list of messages sorted by their creation time.
- Throws:
RestApiException
-
message
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.
-
commentsRequest()
instead