public class DeployTokensApi extends AbstractApi
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.DeploymentStatus, Constants.DeployTokenScope, Constants.Encoding, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestSearchIn, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.StateEvent, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
gitLabApi
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Constructor and Description |
---|
DeployTokensApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
DeployToken |
addGroupDeployToken(Object groupIdOrPath,
String name,
Date expiresAt,
String username,
List<Constants.DeployTokenScope> scopes)
Creates a new deploy token for a group.
|
DeployToken |
addProjectDeployToken(Object projectIdOrPath,
String name,
Date expiresAt,
String username,
List<Constants.DeployTokenScope> scopes)
Creates a new deploy token for a project.
|
void |
deleteGroupDeployToken(Object groupIdOrPath,
Integer tokenId)
Removes a deploy token from the group.
|
void |
deleteProjectDeployToken(Object projectIdOrPath,
Integer tokenId)
Removes a deploy token from the group.
|
List<DeployToken> |
getDeployTokens()
Get a list of all deploy tokens across the GitLab instance.
|
Pager<DeployToken> |
getDeployTokens(int itemsPerPage)
Get a Pager of all deploy tokens across all projects of the GitLab instance.
|
Stream<DeployToken> |
getDeployTokensStream()
Get a Stream of all deploy tokens across all projects of the GitLab instance.
|
List<DeployToken> |
getGroupDeployTokens(Object groupIdOrPath)
Get a list of the deploy tokens for the specified group.
|
Pager<DeployToken> |
getGroupDeployTokens(Object groupIdOrPath,
int itemsPerPage)
Get a Pager of the deploy tokens for the specified group.
|
Stream<DeployToken> |
getGroupDeployTokensStream(Object groupIdOrPath)
Get a list of the deploy tokens for the specified group.
|
List<DeployToken> |
getProjectDeployTokens(Object projectIdOrPath)
Get a list of the deploy tokens for the specified project.
|
Pager<DeployToken> |
getProjectDeployTokens(Object projectIdOrPath,
int itemsPerPage)
Get a Pager of the deploy tokens for the specified project.
|
Stream<DeployToken> |
getProjectDeployTokensStream(Object projectIdOrPath)
Get a list of the deploy tokens for the specified project.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getLabelIdOrName, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
public DeployTokensApi(GitLabApi gitLabApi)
public List<DeployToken> getDeployTokens() throws GitLabApiException
GitLab Endpoint: GET /deploy_tokens
GitLabApiException
- if any exception occurspublic Pager<DeployToken> getDeployTokens(int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /deploy_tokens
itemsPerPage
- the number of DeployToken instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<DeployToken> getDeployTokensStream() throws GitLabApiException
GitLab Endpoint: GET /deploy_tokens
GitLabApiException
- if any exception occurspublic List<DeployToken> getProjectDeployTokens(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/deploy_tokens
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic Pager<DeployToken> getProjectDeployTokens(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/deploy_tokens
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance@param projectId the ID of the projectitemsPerPage
- the number of DeployToken instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<DeployToken> getProjectDeployTokensStream(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/deploy_tokens
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic DeployToken addProjectDeployToken(Object projectIdOrPath, String name, Date expiresAt, String username, List<Constants.DeployTokenScope> scopes) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/deploy_tokens
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the new deploy token’s name, requiredexpiresAt
- expiration date for the deploy token. Currently documented as not required but api fails if not provided. Does not expire if no value is provided.username
- the username for deploy token. Currently documented as not required but api fails if not provided. Default is gitlab+deploy-token-{n}scopes
- indicates the deploy token scopes. Must be at least one of Constants.DeployTokenScope
.GitLabApiException
- if any exception occurspublic void deleteProjectDeployToken(Object projectIdOrPath, Integer tokenId) throws GitLabApiException
GitLab Endpoint: DELETE /projects/:id/deploy_tokens/:token_id
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancetokenId
- the ID of the deploy token to deleteGitLabApiException
- if any exception occurspublic List<DeployToken> getGroupDeployTokens(Object groupIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /groups/:id/deploy_tokens
groupIdOrPath
- the group in the form of an Integer(ID), String(path), or Group instanceGitLabApiException
- if any exception occurspublic Pager<DeployToken> getGroupDeployTokens(Object groupIdOrPath, int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /groups/:id/deploy_tokens
groupIdOrPath
- the group in the form of an Integer(ID), String(path), or Group instance@param groupId the ID of the groupitemsPerPage
- the number of DeployToken instances that will be fetched per pageGitLabApiException
- if any exception occurspublic Stream<DeployToken> getGroupDeployTokensStream(Object groupIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /groups/:id/deploy_tokens
groupIdOrPath
- the group in the form of an Integer(ID), String(path), or Group instanceGitLabApiException
- if any exception occurspublic DeployToken addGroupDeployToken(Object groupIdOrPath, String name, Date expiresAt, String username, List<Constants.DeployTokenScope> scopes) throws GitLabApiException
GitLab Endpoint: POST /groups/:id/deploy_tokens
groupIdOrPath
- the group in the form of an Integer(ID), String(path), or Group instancename
- the new deploy token’s name, requiredexpiresAt
- expiration date for the deploy token. Currently documented as not required but api fails if not provided. Does not expire if no value is provided.username
- the username for deploy token. Currently documented as not required but api fails if not provided. Default is gitlab+deploy-token-{n}scopes
- indicates the deploy token scopes. Must be at least one of Constants.DeployTokenScope
.GitLabApiException
- if any exception occurspublic void deleteGroupDeployToken(Object groupIdOrPath, Integer tokenId) throws GitLabApiException
GitLab Endpoint: DELETE /groups/:id/deploy_tokens/:token_id
groupIdOrPath
- the group in the form of an Integer(ID), String(path), or Group instancetokenId
- the ID of the deploy token to deleteGitLabApiException
- if any exception occursCopyright © 2020. All rights reserved.