Package com.atlassian.bitbucket.content
Class FileEditHookRequest
java.lang.Object
com.atlassian.bitbucket.hook.repository.AbstractRepositoryHookRequest
com.atlassian.bitbucket.content.FileEditHookRequest
- All Implemented Interfaces:
RepositoryHookRequest
Request that is provided to
repository-hook plugin modules when a file is
edited.- Since:
- 5.0
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.atlassian.bitbucket.hook.repository.AbstractRepositoryHookRequest
AbstractRepositoryHookRequest.AbstractBuilder<B extends AbstractRepositoryHookRequest.AbstractBuilder<B>> -
Method Summary
Methods inherited from class com.atlassian.bitbucket.hook.repository.AbstractRepositoryHookRequest
getContext, getRepository, getScmHookDetails, getTrigger, isDryRun
-
Method Details
-
getBranch
- Returns:
- the branch on which the edit operation would happen
-
getContent
- Returns:
- a supplier providing access to the file content
-
getRefChanges
- Specified by:
getRefChangesin interfaceRepositoryHookRequest- Overrides:
getRefChangesin classAbstractRepositoryHookRequest- Returns:
- the proposed ref changes. Can be
emptyfor some dry-run requests where the target hash is not yet known because the relevant commit hasn't been created yet. As an example, this is the case formerge requests. In these cases, the specialized request type should provide sufficient information about the proposed change. ForMergeHookRequest, this would beMergeHookRequest.getFromRef()andMergeHookRequest.getToRef().
-
getMessage
- Returns:
- the commit message. Can be
Optional.empty()if this is adry-runrequest.
-
getPath
- Returns:
- the path of the edited or created file
-
getSourceCommitId
- Returns:
- the commit ID of the existing file in the repository, or
Optional#emptyif this is a new file
-