Package org.gitlab4j.api
Class SystemHooksApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.SystemHooksApi
-
- All Implemented Interfaces:
org.gitlab4j.models.Constants
public class SystemHooksApi extends AbstractApi
This class implements the client side API for the GitLab System Hooks Keys API calls.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gitlab4j.models.Constants
org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoCancelPendingPipelines, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectFeatureVisibilityAccessLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
-
-
Field Summary
-
Fields inherited from class org.gitlab4j.api.AbstractApi
gitLabApi
-
-
Constructor Summary
Constructors Constructor Description SystemHooksApi(GitLabApi gitLabApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.gitlab4j.api.models.SystemHook
addSystemHook(java.lang.String url, java.lang.String token, java.lang.Boolean pushEvents, java.lang.Boolean tagPushEvents, java.lang.Boolean enableSslVerification)
Add a new system hook.org.gitlab4j.api.models.SystemHook
addSystemHook(java.lang.String url, java.lang.String token, org.gitlab4j.api.models.SystemHook systemHook)
Add a new system hook.void
addSystemHookUrlVariable(java.lang.Long hookId, java.lang.String key, java.lang.String value)
Add a new URL variable.void
deleteSystemHook(java.lang.Long hookId)
Deletes a system hook.void
deleteSystemHook(org.gitlab4j.api.models.SystemHook hook)
Deletes a system hook.void
deleteSystemHookUrlVariable(java.lang.Long hookId, java.lang.String key)
Delete a URL variable.org.gitlab4j.api.models.SystemHook
getSystemHook(java.lang.Long hookId)
Get a list of all system hooks.java.util.List<org.gitlab4j.api.models.SystemHook>
getSystemHooks()
Get a list of all system hooks.Pager<org.gitlab4j.api.models.SystemHook>
getSystemHooks(int itemsPerPage)
Get a Pager of all system hooks.java.util.List<org.gitlab4j.api.models.SystemHook>
getSystemHooks(int page, int perPage)
Get a list of all system hooks using the specified page and per page settings.java.util.stream.Stream<org.gitlab4j.api.models.SystemHook>
getSystemHookStream()
Get a Stream of all system hooks.void
testSystemHook(java.lang.Long hookId)
Test a system hook.void
testSystemHook(org.gitlab4j.api.models.SystemHook hook)
Test a system hook.org.gitlab4j.api.models.SystemHook
updateSystemHook(org.gitlab4j.api.models.SystemHook systemHook, java.lang.String token)
Add a new system hook.-
Methods inherited from class org.gitlab4j.api.AbstractApi
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getLabelIdOrName, getNamespaceIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, putWithFormData, upload, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
SystemHooksApi
public SystemHooksApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getSystemHooks
public java.util.List<org.gitlab4j.api.models.SystemHook> getSystemHooks() throws GitLabApiException
Get a list of all system hooks. This method requires admin access.GitLab Endpoint: GET /hooks
- Returns:
- a list of SystemHook
- Throws:
GitLabApiException
- if any exception occurs
-
getSystemHooks
public java.util.List<org.gitlab4j.api.models.SystemHook> getSystemHooks(int page, int perPage) throws GitLabApiException
Get a list of all system hooks using the specified page and per page settings. This method requires admin access.GitLab Endpoint: GET /hooks
- Parameters:
page
- the page to getperPage
- the number of deploy keys per page- Returns:
- the list of SystemHook in the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getSystemHooks
public Pager<org.gitlab4j.api.models.SystemHook> getSystemHooks(int itemsPerPage) throws GitLabApiException
Get a Pager of all system hooks. This method requires admin access.GitLab Endpoint: GET /hooks
- Parameters:
itemsPerPage
- the number of SystemHook instances that will be fetched per page- Returns:
- a Pager of SystemHook
- Throws:
GitLabApiException
- if any exception occurs
-
getSystemHookStream
public java.util.stream.Stream<org.gitlab4j.api.models.SystemHook> getSystemHookStream() throws GitLabApiException
Get a Stream of all system hooks. This method requires admin access.GitLab Endpoint: GET /hooks
- Returns:
- a Stream of SystemHook
- Throws:
GitLabApiException
- if any exception occurs
-
getSystemHook
public org.gitlab4j.api.models.SystemHook getSystemHook(java.lang.Long hookId) throws GitLabApiException
Get a list of all system hooks. This method requires admin access.GitLab Endpoint: GET /hooks
- Parameters:
hookId
- the ID of the system hook.- Returns:
- the SystemHook
- Throws:
GitLabApiException
- if any exception occurs
-
addSystemHook
public org.gitlab4j.api.models.SystemHook addSystemHook(java.lang.String url, java.lang.String token, java.lang.Boolean pushEvents, java.lang.Boolean tagPushEvents, java.lang.Boolean enableSslVerification) throws GitLabApiException
Add a new system hook. This method requires admin access.GitLab Endpoint: POST /hooks
- Parameters:
url
- the hook URL, requiredtoken
- secret token to validate received payloads, optionalpushEvents
- when true, the hook will fire on push events, optionaltagPushEvents
- when true, the hook will fire on new tags being pushed, optionalenableSslVerification
- do SSL verification when triggering the hook, optional- Returns:
- an SystemHook instance with info on the added system hook
- Throws:
GitLabApiException
- if any exception occurs
-
addSystemHook
public org.gitlab4j.api.models.SystemHook addSystemHook(java.lang.String url, java.lang.String token, org.gitlab4j.api.models.SystemHook systemHook) throws GitLabApiException
Add a new system hook. This method requires admin access.GitLab Endpoint: POST /hooks
- Parameters:
url
- the hook URL, requiredtoken
- secret token to validate received payloads, optionalsystemHook
- the systemHook to create- Returns:
- an SystemHook instance with info on the added system hook
- Throws:
GitLabApiException
- if any exception occurs
-
updateSystemHook
public org.gitlab4j.api.models.SystemHook updateSystemHook(org.gitlab4j.api.models.SystemHook systemHook, java.lang.String token) throws GitLabApiException
Add a new system hook. This method requires admin access.GitLab Endpoint: PUT /hooks/:hook_id
- Parameters:
systemHook
- the systemHook to updatetoken
- secret token to validate received payloads, optional- Returns:
- an SystemHook instance with info on the added system hook
- Throws:
GitLabApiException
- if any exception occurs
-
deleteSystemHook
public void deleteSystemHook(org.gitlab4j.api.models.SystemHook hook) throws GitLabApiException
Deletes a system hook. This method requires admin access.GitLab Endpoint: DELETE /hooks/:hook_id
- Parameters:
hook
- the SystemHook instance to delete- Throws:
GitLabApiException
- if any exception occurs
-
deleteSystemHook
public void deleteSystemHook(java.lang.Long hookId) throws GitLabApiException
Deletes a system hook. This method requires admin access.GitLab Endpoint: DELETE /hooks/:hook_id
- Parameters:
hookId
- the ID of the system hook to delete- Throws:
GitLabApiException
- if any exception occurs
-
testSystemHook
public void testSystemHook(org.gitlab4j.api.models.SystemHook hook) throws GitLabApiException
Test a system hook. This method requires admin access.GitLab Endpoint: GET /hooks/:hook_id
- Parameters:
hook
- the SystemHook instance to test- Throws:
GitLabApiException
- if any exception occurs
-
testSystemHook
public void testSystemHook(java.lang.Long hookId) throws GitLabApiException
Test a system hook. This method requires admin access.GitLab Endpoint: GET /hooks/:hook_id
- Parameters:
hookId
- the ID of the system hook to test- Throws:
GitLabApiException
- if any exception occurs
-
addSystemHookUrlVariable
public void addSystemHookUrlVariable(java.lang.Long hookId, java.lang.String key, java.lang.String value) throws GitLabApiException
Add a new URL variable.GitLab Endpoint: PUT /hooks/:hook_id/url_variables/:key
- Parameters:
hookId
- the ID of the system hookkey
- Key of the URL variablevalue
- Value of the URL variable.- Throws:
GitLabApiException
- if any exception occurs
-
deleteSystemHookUrlVariable
public void deleteSystemHookUrlVariable(java.lang.Long hookId, java.lang.String key) throws GitLabApiException
Delete a URL variable.GitLab Endpoint: DELETE /hooks/:hook_id/url_variables/:key
- Parameters:
hookId
- the ID of the system hookkey
- Key of the URL variable- Throws:
GitLabApiException
- if any exception occurs
-
-