Interface ChangeApi
public interface ChangeApi
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptiondefault voidabandon()voidabandon(AbandonInput in) default ReviewerResultaddReviewer(String reviewer) Adds a user to the attention set.Manage the attention set.check()Returns the result of evaluating theSubmitRequirementInputinput on the change.default Map<String, List<CommentInfo>> comments()Deprecated.default List<CommentInfo> Deprecated.Callers should usecommentsRequest()insteadGet aChangeApi.CommentsRequestentity that can be used to retrieve published comments.Create a merge patch set for the change.default RevisionApicurrent()Look up the current revision for the change.voiddelete()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.DraftsRequestentity that can be used to retrieve draft comments.edit()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 ChangeInfodefault ChangeInfoget(ListChangesOption... options) default ChangeInfoget(Iterable<ListChangesOption> options) default ChangeInfoget(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.Gets the validation options on a change.id()voidindex()default ChangeInfoinfo()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 ChangeInfoDifferencedefault ChangeInfoDifferencemetaDiff(String oldMetaRevId, String newMetaRevId, ListChangesOption... options) default ChangeInfoDifferencemetaDiff(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.voiddefault voidCheck 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 voidrebase()Rebase the current revision of a change using default options.voidrebase(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 voidrestore()voidrestore(RestoreInput in) default ChangeApirevert()Create a new change that reverts this change.revert(RevertInput in) Create a new change that reverts this change.default RevertSubmissionInfoLook up the reviewer of the change.Retrieve reviewers (ReviewerState.REVIEWERandReviewerState.CC) on the change.default RevisionApirevision(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.voidSet custom keyed values on a changevoidsetHashtags(HashtagsInput input) Set hashtags on a changevoidCreate 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 voidvoidsetReadyForReview(String message) default voidvoidsetWorkInProgress(String message) default List<ChangeInfo> default SubmittedTogetherInfosubmittedTogether(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
RevisionApiinstances.- 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
RebaseChainInfocontains theChangeInfodata for the rebased the chain - Throws:
RestApiException
-
rebaseChain
Rebase the current revisions of a change's chain.- Returns:
- a
RebaseChainInfocontains theChangeInfodata 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.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
- Throws:
RestApiException
-
get
- Throws:
RestApiException
-
get
- Throws:
RestApiException
-
get
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 RestApiExceptionGets 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
get(ListChangesOption...)with no options included.- Throws:
RestApiException
-
edit
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
-
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
-
getValidationOptions
Gets the validation options on a change.- Returns:
- validationOptions
- 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
revisionfield 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
revisionfield set to indicate their patch set. - Throws:
RestApiException
-
commentsRequest
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
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
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
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
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
- Throws:
RestApiException
-
check
- Throws:
RestApiException
-
checkSubmitRequirementRequest
- Throws:
RestApiException
-
checkSubmitRequirement
SubmitRequirementResultInfo checkSubmitRequirement(SubmitRequirementInput input) throws RestApiException Returns the result of evaluating theSubmitRequirementInputinput 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 theObjectIdof a commit on the change meta branch.- Returns:
- API for accessing a change message.
- Throws:
RestApiException- if the id is invalid.
-
commentsRequest()instead