Package org.gitlab4j.api
Class ProjectApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.ProjectApi
-
- All Implemented Interfaces:
org.gitlab4j.models.Constants
public class ProjectApi extends AbstractApi implements org.gitlab4j.models.Constants
This class provides an entry point to all the GitLab API project 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 ProjectApi(GitLabApi gitLabApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.gitlab4j.api.models.Badge
addBadge(java.lang.Object projectIdOrPath, java.lang.String linkUrl, java.lang.String imageUrl)
Add a badge to a project.org.gitlab4j.api.models.Badge
addBadge(java.lang.Object projectIdOrPath, java.lang.String name, java.lang.String linkUrl, java.lang.String imageUrl)
Add a badge to a project.org.gitlab4j.api.models.ProjectHook
addHook(java.lang.Object projectIdOrPath, java.lang.String url, java.lang.Boolean doPushEvents, java.lang.Boolean doIssuesEvents, java.lang.Boolean doMergeRequestsEvents)
Adds a hook to project.org.gitlab4j.api.models.ProjectHook
addHook(java.lang.Object projectIdOrPath, java.lang.String url, java.lang.Boolean doPushEvents, java.lang.Boolean doIssuesEvents, java.lang.Boolean doMergeRequestsEvents, java.lang.Boolean doNoteEvents)
Adds a hook to project.org.gitlab4j.api.models.ProjectHook
addHook(java.lang.Object projectIdOrPath, java.lang.String url, org.gitlab4j.api.models.ProjectHook enabledHooks, java.lang.Boolean enableSslVerification, java.lang.String secretToken)
Adds a hook to project.org.gitlab4j.api.models.Member
addMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Integer accessLevel)
Adds a user to a project team.org.gitlab4j.api.models.Member
addMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Integer accessLevel, java.util.Date expiresAt)
Adds a user to a project team.org.gitlab4j.api.models.Member
addMember(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel)
Adds a user to a project team.org.gitlab4j.api.models.Member
addMember(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel, java.util.Date expiresAt)
Adds a user to a project team.org.gitlab4j.api.models.AccessRequest
approveAccessRequest(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel)
Approve access for the specified user to the specified project.org.gitlab4j.api.models.Project
archiveProject(java.lang.Object projectIdOrPath)
Archive a projectorg.gitlab4j.api.models.ApprovalRule
createApprovalRule(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ApprovalRuleParams params)
Create a project-level approval rule.org.gitlab4j.api.models.Project
createForkedFromRelationship(java.lang.Object projectIdOrPath, java.lang.Long forkedFromId)
Create a forked from/to relation between existing projects.org.gitlab4j.api.models.Project
createProject(java.lang.Long namespaceId, java.lang.String projectName)
Create a new project belonging to the namespace ID.org.gitlab4j.api.models.Project
createProject(java.lang.Long namespaceId, org.gitlab4j.api.models.Project project)
Create a new project belonging to the namespace ID and project configuration.org.gitlab4j.api.models.Project
createProject(java.lang.String projectName)
Create a new project with the current user's namespace.org.gitlab4j.api.models.Project
createProject(java.lang.String name, java.lang.Long namespaceId, java.lang.String description, java.lang.Boolean issuesEnabled, java.lang.Boolean mergeRequestsEnabled, java.lang.Boolean wikiEnabled, java.lang.Boolean snippetsEnabled, java.lang.Boolean isPublic, java.lang.Integer visibilityLevel, java.lang.String importUrl)
Deprecated.As of release 4.2.0, replaced bycreateProject(String, Long, String, Boolean, Boolean, Boolean, Boolean, Visibility, Integer, String)
org.gitlab4j.api.models.Project
createProject(java.lang.String name, java.lang.Long namespaceId, java.lang.String description, java.lang.Boolean issuesEnabled, java.lang.Boolean mergeRequestsEnabled, java.lang.Boolean wikiEnabled, java.lang.Boolean snippetsEnabled, org.gitlab4j.api.models.Visibility visibility, java.lang.Integer visibilityLevel, java.lang.Boolean printingMergeRequestLinkEnabled, java.lang.String importUrl)
Creates a Projectorg.gitlab4j.api.models.Project
createProject(java.lang.String name, java.lang.Long namespaceId, java.lang.String description, java.lang.Boolean issuesEnabled, java.lang.Boolean mergeRequestsEnabled, java.lang.Boolean wikiEnabled, java.lang.Boolean snippetsEnabled, org.gitlab4j.api.models.Visibility visibility, java.lang.Integer visibilityLevel, java.lang.String importUrl)
Creates a Projectorg.gitlab4j.api.models.Project
createProject(java.lang.String name, java.lang.String path)
Creates a new project owned by the authenticated user.org.gitlab4j.api.models.Project
createProject(org.gitlab4j.api.models.Project project)
Creates new project owned by the current user.org.gitlab4j.api.models.Project
createProject(org.gitlab4j.api.models.Project project, java.lang.String importUrl)
Creates new project owned by the current user.org.gitlab4j.api.models.ProjectAccessToken
createProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.String name, java.util.List<org.gitlab4j.models.Constants.ProjectAccessTokenScope> scopes, java.util.Date expiresAt)
Creates a new project access token.org.gitlab4j.api.models.ProjectAccessToken
createProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.String name, java.util.List<org.gitlab4j.models.Constants.ProjectAccessTokenScope> scopes, java.util.Date expiresAt, java.lang.Long accessLevel)
Creates a new project access token.org.gitlab4j.api.models.Project
createProjectFromTemplate(java.lang.Integer namespaceId, java.lang.String projectName, java.lang.Integer groupWithProjectTemplatesId, java.lang.String templateName, org.gitlab4j.api.models.Visibility visibility)
Create a new project from a template, belonging to the namespace ID.org.gitlab4j.api.models.PushRules
createPushRules(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.PushRules pushRule)
Adds a push rule to a specified project.org.gitlab4j.api.models.RemoteMirror
createRemoteMirror(java.lang.Object projectIdOrPath, java.lang.String url, java.lang.Boolean enabled, java.lang.Boolean onlyProtectedBranches, java.lang.Boolean keepDivergentRefs)
Create a remote mirror for a project.org.gitlab4j.api.models.Snippet
createSnippet(java.lang.Object projectIdOrPath, java.lang.String title, java.lang.String filename, java.lang.String description, java.lang.String content, org.gitlab4j.api.models.Visibility visibility)
Creates a new project snippet.org.gitlab4j.api.models.Variable
createVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, java.lang.Boolean isProtected)
Create a new project variable.org.gitlab4j.api.models.Variable
createVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, java.lang.Boolean isProtected, java.lang.String environmentScope)
Create a new project variable.org.gitlab4j.api.models.Variable
createVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, org.gitlab4j.api.models.Variable.Type variableType, java.lang.Boolean isProtected, java.lang.Boolean isMasked)
Create a new project variable.org.gitlab4j.api.models.Variable
createVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, org.gitlab4j.api.models.Variable.Type variableType, java.lang.Boolean isProtected, java.lang.Boolean isMasked, java.lang.String environmentScope)
Create a new project variable.void
deleteApprovalRule(java.lang.Object projectIdOrPath, java.lang.Long approvalRuleId)
Delete the specified the project-level approval rule.void
deleteCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key)
Delete a custom attribute for the specified project.void
deleteForkedFromRelationship(java.lang.Object projectIdOrPath)
Delete an existing forked from relationship.void
deleteHook(java.lang.Object projectIdOrPath, java.lang.Long hookId)
Deletes a hook from the project.void
deleteHook(org.gitlab4j.api.models.ProjectHook hook)
Deletes a hook from the project.void
deleteIssue(java.lang.Object projectIdOrPath, java.lang.Long issueId)
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.deleteIssue(Object, Long)
void
deleteProject(java.lang.Object projectIdOrPath)
Removes project with all resources(issues, merge requests etc).void
deletePushRules(java.lang.Object projectIdOrPath)
Removes a push rule from a project.void
deleteSnippet(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
void
deleteVariable(java.lang.Object projectIdOrPath, java.lang.String key)
Deletes a project variable.void
denyAccessRequest(java.lang.Object projectIdOrPath, java.lang.Long userId)
Deny access for the specified user to the specified project.org.gitlab4j.api.models.Badge
editBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId, java.lang.String linkUrl, java.lang.String imageUrl)
Edit a badge of a project.org.gitlab4j.api.models.Badge
editBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId, java.lang.String name, java.lang.String linkUrl, java.lang.String imageUrl)
Edit a badge of a project.org.gitlab4j.api.models.Project
forkProject(java.lang.Object projectIdOrPath, java.lang.Long namespaceId)
Forks a project into the user namespace of the authenticated user or the one provided.org.gitlab4j.api.models.Project
forkProject(java.lang.Object projectIdOrPath, java.lang.String namespace)
Forks a project into the user namespace of the authenticated user or the one provided.org.gitlab4j.api.models.Project
forkProject(java.lang.Object projectIdOrPath, java.lang.String namespace, java.lang.String path, java.lang.String name)
Forks a project into the user namespace of the authenticated user or the one provided.java.util.Optional<org.gitlab4j.api.models.CustomAttribute>
geOptionalCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key)
Deprecated.UsegetOptionalCustomAttribute(Object, String)
insteadjava.util.List<org.gitlab4j.api.models.AccessRequest>
getAccessRequests(java.lang.Object projectIdOrPath)
Get a List of the project access requests viewable by the authenticated user.Pager<org.gitlab4j.api.models.AccessRequest>
getAccessRequests(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of the project access requests viewable by the authenticated user.java.util.stream.Stream<org.gitlab4j.api.models.AccessRequest>
getAccessRequestsStream(java.lang.Object projectIdOrPath)
Get a Stream of the project access requests viewable by the authenticated user.java.util.List<org.gitlab4j.api.models.Member>
getAllMembers(java.lang.Object projectIdOrPath)
Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups.Pager<org.gitlab4j.api.models.Member>
getAllMembers(java.lang.Object projectIdOrPath, int itemsPerPage)
Gets a Pager of project members viewable by the authenticated user, including inherited members through ancestor groups.java.util.List<org.gitlab4j.api.models.Member>
getAllMembers(java.lang.Object projectIdOrPath, int page, int perPage)
Deprecated.Will be removed in version 6.0java.util.List<org.gitlab4j.api.models.Member>
getAllMembers(java.lang.Object projectIdOrPath, java.lang.String query, java.util.List<java.lang.Long> userIds)
Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups.Pager<org.gitlab4j.api.models.Member>
getAllMembers(java.lang.Object projectIdOrPath, java.lang.String query, java.util.List<java.lang.Long> userIds, int itemsPerPage)
Gets a Pager of project members viewable by the authenticated user, including inherited members through ancestor groups.java.util.stream.Stream<org.gitlab4j.api.models.Member>
getAllMembersStream(java.lang.Object projectIdOrPath)
Gets a Stream of project members viewable by the authenticated user, including inherited members through ancestor groups.java.util.stream.Stream<org.gitlab4j.api.models.Member>
getAllMembersStream(java.lang.Object projectIdOrPath, java.lang.String query, java.util.List<java.lang.Long> userIds)
Gets a Stream of project members viewable by the authenticated user, including inherited members through ancestor groups.java.util.List<org.gitlab4j.api.models.ApprovalRule>
getApprovalRules(java.lang.Object projectIdOrPath)
Get a list of the project-level approval rules.Pager<org.gitlab4j.api.models.ApprovalRule>
getApprovalRules(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of the project-level approval rules.java.util.stream.Stream<org.gitlab4j.api.models.ApprovalRule>
getApprovalRulesStream(java.lang.Object projectIdOrPath)
Get a Stream of the project-level approval rules.org.gitlab4j.api.models.ProjectApprovalsConfig
getApprovalsConfiguration(java.lang.Object projectIdOrPath)
Get the project's approval information.org.gitlab4j.api.models.AuditEvent
getAuditEvent(java.lang.Object projectIdOrPath, java.lang.Long auditEventId)
Get a specific audit event of a project.java.util.List<org.gitlab4j.api.models.AuditEvent>
getAuditEvents(java.lang.Object projectIdOrPath, java.util.Date created_after, java.util.Date created_before)
Get a List of the project audit events viewable by Maintainer or an Owner of the group.Pager<org.gitlab4j.api.models.AuditEvent>
getAuditEvents(java.lang.Object projectIdOrPath, java.util.Date created_after, java.util.Date created_before, int itemsPerPage)
Get a Pager of the group audit events viewable by Maintainer or an Owner of the group.java.util.stream.Stream<org.gitlab4j.api.models.AuditEvent>
getAuditEventsStream(java.lang.Object projectIdOrPath, java.util.Date created_after, java.util.Date created_before)
Get a Stream of the group audit events viewable by Maintainer or an Owner of the group.java.io.InputStream
getAvatar(java.lang.Object projectIdOrPath)
Gets the project avatar.org.gitlab4j.api.models.Badge
getBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId)
Gets a badge of a project.java.util.List<org.gitlab4j.api.models.Badge>
getBadges(java.lang.Object projectIdOrPath)
Gets a list of a project’s badges and its group badges.java.util.List<org.gitlab4j.api.models.Badge>
getBadges(java.lang.Object projectIdOrPath, java.lang.String bagdeName)
Gets a list of a project’s badges and its group badges, case-sensitively filtered on bagdeName if non-null.org.gitlab4j.api.models.CustomAttribute
getCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key)
Get a single custom attribute for the specified project.java.util.List<org.gitlab4j.api.models.CustomAttribute>
getCustomAttributes(java.lang.Object projectIdOrPath)
Get all custom attributes for the specified project.Pager<org.gitlab4j.api.models.CustomAttribute>
getCustomAttributes(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of custom attributes for the specified project.java.util.stream.Stream<org.gitlab4j.api.models.CustomAttribute>
getCustomAttributesStream(java.lang.Object projectIdOrPath)
Get a Stream of all custom attributes for the specified project.java.util.List<org.gitlab4j.api.models.Project>
getForks(java.lang.Object projectIdOrPath)
Get a list of projects that were forked from the specified project.Pager<org.gitlab4j.api.models.Project>
getForks(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of projects that were forked from the specified project.java.util.List<org.gitlab4j.api.models.Project>
getForks(java.lang.Object projectIdOrPath, int page, int perPage)
Get a list of projects that were forked from the specified project and in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.Project>
getForksStream(java.lang.Object projectIdOrPath)
Get a Stream of projects that were forked from the specified project.org.gitlab4j.api.models.ProjectHook
getHook(java.lang.Object projectIdOrPath, java.lang.Long hookId)
Get a specific hook for project.java.util.List<org.gitlab4j.api.models.ProjectHook>
getHooks(java.lang.Object projectIdOrPath)
Get a list of the project hooks for the specified project.Pager<org.gitlab4j.api.models.ProjectHook>
getHooks(java.lang.Object projectIdOrPath, int itemsPerPage)
Get Pager of project hooks.java.util.List<org.gitlab4j.api.models.ProjectHook>
getHooks(java.lang.Object projectIdOrPath, int page, int perPage)
Get list of project hooks in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.ProjectHook>
getHooksStream(java.lang.Object projectIdOrPath)
Get a Stream of the project hooks for the specified project.org.gitlab4j.api.models.Issue
getIssue(java.lang.Object projectIdOrPath, java.lang.Long issueId)
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssue(Object, Long)
java.util.List<org.gitlab4j.api.models.Issue>
getIssues(java.lang.Object projectIdOrPath)
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssues(Object)
Pager<org.gitlab4j.api.models.Issue>
getIssues(java.lang.Object projectIdOrPath, int itemsPerPage)
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssues(Object, int)
java.util.List<org.gitlab4j.api.models.Issue>
getIssues(java.lang.Object projectIdOrPath, int page, int perPage)
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssues(Object, int, int)
java.util.stream.Stream<org.gitlab4j.api.models.Issue>
getIssuesStream(java.lang.Object projectIdOrPath)
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssues(Object)
org.gitlab4j.api.models.Member
getMember(java.lang.Object projectIdOrPath, java.lang.Long userId)
Gets a project team member.org.gitlab4j.api.models.Member
getMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Boolean includeInherited)
Gets a project team member, optionally including inherited member.java.util.List<org.gitlab4j.api.models.Project>
getMemberProjects()
Get a list of projects that the authenticated user is a member of.Pager<org.gitlab4j.api.models.Project>
getMemberProjects(int itemsPerPage)
Get a Pager of projects that the authenticated user is a member of.java.util.List<org.gitlab4j.api.models.Project>
getMemberProjects(int page, int perPage)
Get a list of projects that the authenticated user is a member of in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.Project>
getMemberProjectsStream()
Get a Stream of projects that the authenticated user is a member of.java.util.List<org.gitlab4j.api.models.Member>
getMembers(java.lang.Object projectIdOrPath)
Get a list of project team members.Pager<org.gitlab4j.api.models.Member>
getMembers(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of project team members.java.util.List<org.gitlab4j.api.models.Member>
getMembers(java.lang.Object projectIdOrPath, int page, int perPage)
Get a list of project team members in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.Member>
getMembersStream(java.lang.Object projectIdOrPath)
Get a Stream of project team members.java.util.Optional<org.gitlab4j.api.models.Badge>
getOptionalBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId)
Get an Optional instance with the value for the specified badge.java.util.Optional<org.gitlab4j.api.models.CustomAttribute>
getOptionalCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key)
Get an Optional instance with the value for a single custom attribute for the specified project.java.util.Optional<org.gitlab4j.api.models.ProjectHook>
getOptionalHook(java.lang.Object projectIdOrPath, java.lang.Long hookId)
Get a specific hook for project as an Optional instance.java.util.Optional<org.gitlab4j.api.models.Member>
getOptionalMember(java.lang.Object projectIdOrPath, java.lang.Long userId)
Gets a project team member.java.util.Optional<org.gitlab4j.api.models.Member>
getOptionalMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Boolean includeInherited)
Gets a project team member, optionally including inherited member.java.util.Optional<org.gitlab4j.api.models.Project>
getOptionalProject(java.lang.Object projectIdOrPath)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.java.util.Optional<org.gitlab4j.api.models.Project>
getOptionalProject(java.lang.Object projectIdOrPath, java.lang.Boolean includeStatistics)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.java.util.Optional<org.gitlab4j.api.models.Project>
getOptionalProject(java.lang.Object projectIdOrPath, java.lang.Boolean includeStatistics, java.lang.Boolean includeLicense, java.lang.Boolean withCustomAttributes)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.java.util.Optional<org.gitlab4j.api.models.Project>
getOptionalProject(java.lang.String namespace, java.lang.String project)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.java.util.Optional<org.gitlab4j.api.models.Project>
getOptionalProject(java.lang.String namespace, java.lang.String project, java.lang.Boolean includeStatistics)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.java.util.Optional<org.gitlab4j.api.models.ProjectFetches>
getOptionalProjectStatistics(java.lang.Object projectIdOrPath)
Get an Optional instance with the value for the project fetch statistics for the last 30 days.java.util.Optional<java.lang.String>
getOptionalRawSnippetContent(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
Get the raw project snippet plain text as an Optional instance.java.util.Optional<org.gitlab4j.api.models.Snippet>
getOptionalSnippet(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
Get a single of project snippet as an Optional instance.java.util.Optional<org.gitlab4j.api.models.Variable>
getOptionalVariable(java.lang.Object projectIdOrPath, java.lang.String key)
Get the details of a variable as an Optional instance.java.util.List<org.gitlab4j.api.models.Project>
getOwnedProjects()
Get a list of projects owned by the authenticated user.Pager<org.gitlab4j.api.models.Project>
getOwnedProjects(int itemsPerPage)
Get a Pager of projects owned by the authenticated user.java.util.List<org.gitlab4j.api.models.Project>
getOwnedProjects(int page, int perPage)
Get a list of projects owned by the authenticated user in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.Project>
getOwnedProjectsStream()
Get a Stream of projects owned by the authenticated user.org.gitlab4j.api.models.Project
getProject(java.lang.Object projectIdOrPath)
Get a specific project, which is owned by the authentication user.org.gitlab4j.api.models.Project
getProject(java.lang.Object projectIdOrPath, java.lang.Boolean includeStatistics)
Get a specific project, which is owned by the authentication user.org.gitlab4j.api.models.Project
getProject(java.lang.Object projectIdOrPath, java.lang.Boolean includeStatistics, java.lang.Boolean includeLicense, java.lang.Boolean withCustomAttributes)
Get a specific project, which is owned by the authentication user.org.gitlab4j.api.models.Project
getProject(java.lang.String namespace, java.lang.String project)
Get a specific project, which is owned by the authentication user.org.gitlab4j.api.models.Project
getProject(java.lang.String namespace, java.lang.String project, java.lang.Boolean includeStatistics)
Get a specific project, which is owned by the authentication user.org.gitlab4j.api.models.ProjectAccessToken
getProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.Long tokenId)
Gets the specific project access token.java.util.List<org.gitlab4j.api.models.Event>
getProjectEvents(java.lang.Object projectIdOrPath)
Get the project events for specific project.Pager<org.gitlab4j.api.models.Event>
getProjectEvents(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of project events for specific project.java.util.List<org.gitlab4j.api.models.Event>
getProjectEvents(java.lang.Object projectIdOrPath, int page, int perPage)
Get the project events for specific project.java.util.stream.Stream<org.gitlab4j.api.models.Event>
getProjectEventsStream(java.lang.Object projectIdOrPath)
Get a Stream of the project events for specific project.java.util.List<org.gitlab4j.api.models.ProjectGroup>
getProjectGroups(java.lang.Object projectIdOrPath)
Get a list of the ancestor groups for a given project.Pager<org.gitlab4j.api.models.ProjectGroup>
getProjectGroups(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of the ancestor groups for a given project.java.util.List<org.gitlab4j.api.models.ProjectGroup>
getProjectGroups(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ProjectGroupsFilter filter)
Get a list of the ancestor groups for a given project matching the specified filter.Pager<org.gitlab4j.api.models.ProjectGroup>
getProjectGroups(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ProjectGroupsFilter filter, int itemsPerPage)
Get a Pager of the ancestor groups for a given project matching the specified filter.java.util.stream.Stream<org.gitlab4j.api.models.ProjectGroup>
getProjectGroupsStream(java.lang.Object projectIdOrPath)
Get a Stream of the ancestor groups for a given project.java.util.stream.Stream<org.gitlab4j.api.models.ProjectGroup>
getProjectGroupsStream(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ProjectGroupsFilter filter)
Get a Stream of the ancestor groups for a given project matching the specified filter.java.util.Map<java.lang.String,java.lang.Float>
getProjectLanguages(java.lang.Object projectIdOrPath)
Get languages used in a project with percentage value.java.util.List<org.gitlab4j.api.models.Project>
getProjects()
Get a list of projects accessible by the authenticated user.Pager<org.gitlab4j.api.models.Project>
getProjects(int itemsPerPage)
Get a Pager instance of projects accessible by the authenticated user.java.util.List<org.gitlab4j.api.models.Project>
getProjects(int page, int perPage)
Get a list of projects accessible by the authenticated user and in the specified page range.java.util.List<org.gitlab4j.api.models.Project>
getProjects(java.lang.Boolean archived, org.gitlab4j.api.models.Visibility visibility, java.lang.String orderBy, java.lang.String sort, java.lang.String search, java.lang.Boolean simple, java.lang.Boolean owned, java.lang.Boolean membership, java.lang.Boolean starred, java.lang.Boolean statistics)
Deprecated.Will be removed in version 6.0, replaced bygetProjects(Boolean, Visibility, Constants.ProjectOrderBy, Constants.SortOrder, String, Boolean, Boolean, Boolean, Boolean, Boolean)
java.util.List<org.gitlab4j.api.models.Project>
getProjects(java.lang.Boolean archived, org.gitlab4j.api.models.Visibility visibility, org.gitlab4j.models.Constants.ProjectOrderBy orderBy, org.gitlab4j.models.Constants.SortOrder sort, java.lang.String search, java.lang.Boolean simple, java.lang.Boolean owned, java.lang.Boolean membership, java.lang.Boolean starred, java.lang.Boolean statistics)
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters.Pager<org.gitlab4j.api.models.Project>
getProjects(java.lang.Boolean archived, org.gitlab4j.api.models.Visibility visibility, org.gitlab4j.models.Constants.ProjectOrderBy orderBy, org.gitlab4j.models.Constants.SortOrder sort, java.lang.String search, java.lang.Boolean simple, java.lang.Boolean owned, java.lang.Boolean membership, java.lang.Boolean starred, java.lang.Boolean statistics, int itemsPerPage)
Get a Pager of projects accessible by the authenticated user and matching the supplied filter parameters.java.util.List<org.gitlab4j.api.models.Project>
getProjects(java.lang.Boolean archived, org.gitlab4j.api.models.Visibility visibility, org.gitlab4j.models.Constants.ProjectOrderBy orderBy, org.gitlab4j.models.Constants.SortOrder sort, java.lang.String search, java.lang.Boolean simple, java.lang.Boolean owned, java.lang.Boolean membership, java.lang.Boolean starred, java.lang.Boolean statistics, int page, int perPage)
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters.java.util.List<org.gitlab4j.api.models.Project>
getProjects(java.lang.String search)
Get a list of projects accessible by the authenticated user that match the provided search string.Pager<org.gitlab4j.api.models.Project>
getProjects(java.lang.String search, int itemsPerPage)
Get a Pager of projects accessible by the authenticated user that match the provided search string.java.util.List<org.gitlab4j.api.models.Project>
getProjects(java.lang.String search, int page, int perPage)
Get a list of projects accessible by the authenticated user that match the provided search string.java.util.List<org.gitlab4j.api.models.Project>
getProjects(org.gitlab4j.api.models.ProjectFilter filter)
Get a list of all visible projects across GitLab for the authenticated user using the provided filter.Pager<org.gitlab4j.api.models.Project>
getProjects(org.gitlab4j.api.models.ProjectFilter filter, int itemsPerPage)
Get a Pager of all visible projects across GitLab for the authenticated user using the provided filter.java.util.List<org.gitlab4j.api.models.Project>
getProjects(org.gitlab4j.api.models.ProjectFilter filter, int page, int perPage)
Get a list of all visible projects across GitLab for the authenticated user in the specified page range using the provided filter.java.util.stream.Stream<org.gitlab4j.api.models.Project>
getProjectsStream()
Get a Stream of projects accessible by the authenticated user.java.util.stream.Stream<org.gitlab4j.api.models.Project>
getProjectsStream(java.lang.String search)
Get a Stream of projects accessible by the authenticated user that match the provided search string.java.util.stream.Stream<org.gitlab4j.api.models.Project>
getProjectsStream(org.gitlab4j.api.models.ProjectFilter filter)
Get a Stream of all visible projects across GitLab for the authenticated user using the provided filter.org.gitlab4j.api.models.ProjectFetches
getProjectStatistics(java.lang.Object projectIdOrPath)
Get the project fetch statistics for the last 30 days.java.util.List<org.gitlab4j.api.models.ProjectUser>
getProjectUsers(java.lang.Object projectIdOrPath)
Get a list of project users.Pager<org.gitlab4j.api.models.ProjectUser>
getProjectUsers(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of project users.java.util.List<org.gitlab4j.api.models.ProjectUser>
getProjectUsers(java.lang.Object projectIdOrPath, java.lang.String search)
Get a list of project users matching the specified search string.Pager<org.gitlab4j.api.models.ProjectUser>
getProjectUsers(java.lang.Object projectIdOrPath, java.lang.String search, int itemsPerPage)
Get a Pager of project users matching the specified search string.java.util.stream.Stream<org.gitlab4j.api.models.ProjectUser>
getProjectUsersStream(java.lang.Object projectIdOrPath)
Get a Stream of project users.java.util.stream.Stream<org.gitlab4j.api.models.ProjectUser>
getProjectUsersStream(java.lang.Object projectIdOrPath, java.lang.String search)
Get a Stream of project users matching the specified search string.org.gitlab4j.api.models.PushRules
getPushRules(java.lang.Object projectIdOrPath)
Get the project's push rules.java.lang.String
getRawSnippetContent(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
Get the raw project snippet as plain text.java.util.List<org.gitlab4j.api.models.RemoteMirror>
getRemoteMirrors(java.lang.Object projectIdOrPath)
Get all remote mirrors and their statuses for the specified project.Pager<org.gitlab4j.api.models.RemoteMirror>
getRemoteMirrors(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of remote mirrors and their statuses for the specified project.java.util.stream.Stream<org.gitlab4j.api.models.RemoteMirror>
getRemoteMirrorsStream(java.lang.Object projectIdOrPath)
Get a Stream of all remote mirrors and their statuses for the specified project.org.gitlab4j.api.models.Snippet
getSnippet(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
Get a single of project snippet.java.util.List<org.gitlab4j.api.models.Snippet>
getSnippets(java.lang.Object projectIdOrPath)
Get a list of the project snippets.Pager<org.gitlab4j.api.models.Snippet>
getSnippets(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of project's snippets.java.util.List<org.gitlab4j.api.models.Snippet>
getSnippets(java.lang.Object projectIdOrPath, int page, int perPage)
Get a list of project snippets.java.util.stream.Stream<org.gitlab4j.api.models.Snippet>
getSnippetsStream(java.lang.Object projectIdOrPath)
Get a Stream of the project snippets.java.util.List<org.gitlab4j.api.models.Project>
getStarredProjects()
Get a list of projects starred by the authenticated user.Pager<org.gitlab4j.api.models.Project>
getStarredProjects(int itemsPerPage)
Get a Pager of projects starred by the authenticated user.java.util.List<org.gitlab4j.api.models.Project>
getStarredProjects(int page, int perPage)
Get a list of projects starred by the authenticated user in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.Project>
getStarredProjectsStream()
Get a Stream of projects starred by the authenticated user.java.util.List<org.gitlab4j.api.models.UploadedFile>
getUploadFiles(java.lang.Object projectIdOrPath)
Get all uploads of the project sorted by created_at in descending order.java.util.List<org.gitlab4j.api.models.Project>
getUserProjects(java.lang.Object userIdOrUsername, org.gitlab4j.api.models.ProjectFilter filter)
Get a list of visible projects owned by the given user.Pager<org.gitlab4j.api.models.Project>
getUserProjects(java.lang.Object userIdOrUsername, org.gitlab4j.api.models.ProjectFilter filter, int itemsPerPage)
Get a Pager of visible projects owned by the given user.java.util.List<org.gitlab4j.api.models.Project>
getUserProjects(java.lang.Object userIdOrUsername, org.gitlab4j.api.models.ProjectFilter filter, int page, int perPage)
Get a list of visible projects owned by the given user in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.Project>
getUserProjectsStream(java.lang.Object userIdOrUsername, org.gitlab4j.api.models.ProjectFilter filter)
Get a Stream of visible projects owned by the given user.org.gitlab4j.api.models.Variable
getVariable(java.lang.Object projectIdOrPath, java.lang.String key)
Get the details of a project variable.java.util.List<org.gitlab4j.api.models.Variable>
getVariables(java.lang.Object projectIdOrPath)
Get list of a project's variables.Pager<org.gitlab4j.api.models.Variable>
getVariables(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of variables belonging to the specified project.java.util.List<org.gitlab4j.api.models.Variable>
getVariables(java.lang.Object projectIdOrPath, int page, int perPage)
Get a list of variables for the specified project in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.Variable>
getVariablesStream(java.lang.Object projectIdOrPath)
Get a Stream of variables belonging to the specified project.java.util.List<org.gitlab4j.api.models.ProjectAccessToken>
listProjectAccessTokens(java.lang.Object projectIdOrPath)
Lists the projects access tokens for the project.java.util.List<org.gitlab4j.api.models.Iteration>
listProjectIterations(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.IterationFilter filter)
Lists project iterations.org.gitlab4j.api.models.ProjectHook
modifyHook(org.gitlab4j.api.models.ProjectHook hook)
Modifies a hook for project.org.gitlab4j.api.models.Badge
previewBadge(java.lang.Object projectIdOrPath, java.lang.String linkUrl, java.lang.String imageUrl)
Returns how the link_url and image_url final URLs would be after resolving the placeholder interpolation.void
removeBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId)
Remove a badge from a project.void
removeMember(java.lang.Object projectIdOrPath, java.lang.Long userId)
Removes user from project team.org.gitlab4j.api.models.AccessRequest
requestAccess(java.lang.Object projectIdOrPath)
Requests access for the authenticated user to the specified project.void
revokeProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.Long tokenId)
Revokes the project access token.org.gitlab4j.api.models.ProjectAccessToken
rotateProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.Long tokenId)
Rotates the given project access token.org.gitlab4j.api.models.ProjectAccessToken
rotateProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.Long tokenId, java.util.Date expiresAt)
Rotates the given project access token.org.gitlab4j.api.models.ProjectApprovalsConfig
setApprovalsConfiguration(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ProjectApprovalsConfig config)
Set the project's approvals configuration.org.gitlab4j.api.models.CustomAttribute
setCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value)
Set a custom attribute for the specified project.org.gitlab4j.api.models.Project
setProjectAvatar(java.lang.Object projectIdOrPath, java.io.File avatarFile)
Uploads and sets the project avatar for the specified project.void
shareProject(java.lang.Object projectIdOrPath, java.lang.Long groupId, org.gitlab4j.api.models.AccessLevel accessLevel, java.util.Date expiresAt)
Share a project with the specified group.org.gitlab4j.api.models.Project
starProject(java.lang.Object projectIdOrPath)
Star a project.org.gitlab4j.api.models.Project
transferProject(java.lang.Object projectIdOrPath, java.lang.String namespace)
Transfer a project to a new namespace.void
triggerHousekeeping(java.lang.Object projectIdOrPath)
Start the Housekeeping task for a project.org.gitlab4j.api.models.Project
unarchiveProject(java.lang.Object projectIdOrPath)
Unarchive a projectvoid
unshareProject(java.lang.Object projectIdOrPath, java.lang.Long groupId)
Unshare the project from the group.org.gitlab4j.api.models.Project
unstarProject(java.lang.Object projectIdOrPath)
Unstar a project.org.gitlab4j.api.models.ApprovalRule
updateApprovalRule(java.lang.Object projectIdOrPath, java.lang.Long approvalRuleId, org.gitlab4j.api.models.ApprovalRuleParams params)
Update the specified the project-level approval rule.org.gitlab4j.api.models.Member
updateMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Integer accessLevel)
Updates a member of a project.org.gitlab4j.api.models.Member
updateMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Integer accessLevel, java.util.Date expiresAt)
Updates a member of a project.org.gitlab4j.api.models.Member
updateMember(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel)
Updates a member of a project.org.gitlab4j.api.models.Member
updateMember(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel, java.util.Date expiresAt)
Updates a member of a project.org.gitlab4j.api.models.Project
updateProject(org.gitlab4j.api.models.Project project)
Updates a project.org.gitlab4j.api.models.PushRules
updatePushRules(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.PushRules pushRule)
Updates a push rule for the specified project.org.gitlab4j.api.models.RemoteMirror
updateRemoteMirror(java.lang.Object projectIdOrPath, java.lang.Long mirrorId, java.lang.Boolean enabled, java.lang.Boolean onlyProtectedBranches, java.lang.Boolean keepDivergentRefs)
Toggle a remote mirror on or off, or change which types of branches are mirrored.org.gitlab4j.api.models.Snippet
updateSnippet(java.lang.Object projectIdOrPath, java.lang.Long snippetId, java.lang.String title, java.lang.String filename, java.lang.String description, java.lang.String code, org.gitlab4j.api.models.Visibility visibility)
Updates an existing project snippet.org.gitlab4j.api.models.Variable
updateVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, java.lang.Boolean isProtected)
Update a project variable.org.gitlab4j.api.models.Variable
updateVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, java.lang.Boolean isProtected, java.lang.String environmentScope)
Update a project variable.org.gitlab4j.api.models.Variable
updateVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, org.gitlab4j.api.models.Variable.Type variableType, java.lang.Boolean isProtected, java.lang.Boolean masked)
Update a project variable.org.gitlab4j.api.models.Variable
updateVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, org.gitlab4j.api.models.Variable.Type variableType, java.lang.Boolean isProtected, java.lang.Boolean masked, java.lang.String environmentScope)
Update a project variable.org.gitlab4j.api.models.FileUpload
uploadFile(java.lang.Object projectIdOrPath, java.io.File fileToUpload)
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.org.gitlab4j.api.models.FileUpload
uploadFile(java.lang.Object projectIdOrPath, java.io.File fileToUpload, java.lang.String mediaType)
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.org.gitlab4j.api.models.FileUpload
uploadFile(java.lang.Object projectIdOrPath, java.io.InputStream inputStream, java.lang.String filename, java.lang.String mediaType)
Uploads some data in anInputStream
to the specified project, to be used in an issue or merge request description, or a comment.-
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
-
ProjectApi
public ProjectApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getProjectStatistics
public org.gitlab4j.api.models.ProjectFetches getProjectStatistics(java.lang.Object projectIdOrPath) throws GitLabApiException
Get the project fetch statistics for the last 30 days. Retrieving the statistics requires write access to the repository. Currently only HTTP fetches statistics are returned. Fetches statistics includes both clones and pulls count and are HTTP only, SSH fetches are not included.GitLab Endpoint: GET /project/:id/statistics
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a ProjectFetches instance with the project fetch statistics for the last 30 days
- Throws:
GitLabApiException
- if any exception occurs during execution
-
getOptionalProjectStatistics
public java.util.Optional<org.gitlab4j.api.models.ProjectFetches> getOptionalProjectStatistics(java.lang.Object projectIdOrPath)
Get an Optional instance with the value for the project fetch statistics for the last 30 days.GitLab Endpoint: GET /project/:id/statistics
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- an Optional instance with the value for the project fetch statistics for the last 30 day
-
getProjects
public java.util.List<org.gitlab4j.api.models.Project> getProjects() throws GitLabApiException
Get a list of projects accessible by the authenticated user.
WARNING: Do not use this method to fetch projects from https://gitlab.com, gitlab.com has many 100,000's of public projects and it will take hours to fetch all of them. Instead usegetProjects(int itemsPerPage)
which will return a Pager of Project instances.GitLab Endpoint: GET /projects
- Returns:
- a list of projects accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public java.util.List<org.gitlab4j.api.models.Project> getProjects(int page, int perPage) throws GitLabApiException
Get a list of projects accessible by the authenticated user and in the specified page range.GitLab Endpoint: GET /projects
- Parameters:
page
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public Pager<org.gitlab4j.api.models.Project> getProjects(int itemsPerPage) throws GitLabApiException
Get a Pager instance of projects accessible by the authenticated user.GitLab Endpoint: GET /projects
- Parameters:
itemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager instance of projects accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Project> getProjectsStream() throws GitLabApiException
Get a Stream of projects accessible by the authenticated user.GitLab Endpoint: GET /projects
- Returns:
- a Stream of projects accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
@Deprecated public java.util.List<org.gitlab4j.api.models.Project> getProjects(java.lang.Boolean archived, org.gitlab4j.api.models.Visibility visibility, java.lang.String orderBy, java.lang.String sort, java.lang.String search, java.lang.Boolean simple, java.lang.Boolean owned, java.lang.Boolean membership, java.lang.Boolean starred, java.lang.Boolean statistics) throws GitLabApiException
Deprecated.Will be removed in version 6.0, replaced bygetProjects(Boolean, Visibility, Constants.ProjectOrderBy, Constants.SortOrder, String, Boolean, Boolean, Boolean, Boolean, Boolean)
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.GitLab Endpoint: GET /projects
- Parameters:
archived
- limit by archived statusvisibility
- limit by visibility public, internal, or privateorderBy
- return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields, default is created_atsort
- return projects sorted in asc or desc order. Default is descsearch
- return list of projects matching the search criteriasimple
- return only the ID, URL, name, and path of each projectowned
- limit by projects owned by the current usermembership
- limit by projects that the current user is a member ofstarred
- limit by projects starred by the current userstatistics
- include project statistics- Returns:
- a list of projects accessible by the authenticated user and matching the supplied parameters
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public java.util.List<org.gitlab4j.api.models.Project> getProjects(java.lang.Boolean archived, org.gitlab4j.api.models.Visibility visibility, org.gitlab4j.models.Constants.ProjectOrderBy orderBy, org.gitlab4j.models.Constants.SortOrder sort, java.lang.String search, java.lang.Boolean simple, java.lang.Boolean owned, java.lang.Boolean membership, java.lang.Boolean starred, java.lang.Boolean statistics) throws GitLabApiException
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.GitLab Endpoint: GET /projects
- Parameters:
archived
- limit by archived statusvisibility
- limit by visibility public, internal, or privateorderBy
- return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_ATsort
- return projects sorted in asc or desc order. Default is descsearch
- return list of projects matching the search criteriasimple
- return only the ID, URL, name, and path of each projectowned
- limit by projects owned by the current usermembership
- limit by projects that the current user is a member ofstarred
- limit by projects starred by the current userstatistics
- include project statistics- Returns:
- a list of projects accessible by the authenticated user and matching the supplied parameters
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public java.util.List<org.gitlab4j.api.models.Project> getProjects(java.lang.Boolean archived, org.gitlab4j.api.models.Visibility visibility, org.gitlab4j.models.Constants.ProjectOrderBy orderBy, org.gitlab4j.models.Constants.SortOrder sort, java.lang.String search, java.lang.Boolean simple, java.lang.Boolean owned, java.lang.Boolean membership, java.lang.Boolean starred, java.lang.Boolean statistics, int page, int perPage) throws GitLabApiException
Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.GitLab Endpoint: GET /projects
- Parameters:
archived
- limit by archived statusvisibility
- limit by visibility public, internal, or privateorderBy
- return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_ATsort
- return projects sorted in asc or desc order. Default is descsearch
- return list of projects matching the search criteriasimple
- return only the ID, URL, name, and path of each projectowned
- limit by projects owned by the current usermembership
- limit by projects that the current user is a member ofstarred
- limit by projects starred by the current userstatistics
- include project statisticspage
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects accessible by the authenticated user and matching the supplied parameters
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public Pager<org.gitlab4j.api.models.Project> getProjects(java.lang.Boolean archived, org.gitlab4j.api.models.Visibility visibility, org.gitlab4j.models.Constants.ProjectOrderBy orderBy, org.gitlab4j.models.Constants.SortOrder sort, java.lang.String search, java.lang.Boolean simple, java.lang.Boolean owned, java.lang.Boolean membership, java.lang.Boolean starred, java.lang.Boolean statistics, int itemsPerPage) throws GitLabApiException
Get a Pager of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.GitLab Endpoint: GET /projects
- Parameters:
archived
- limit by archived statusvisibility
- limit by visibility public, internal, or privateorderBy
- return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_ATsort
- return projects sorted in asc or desc order. Default is descsearch
- return list of projects matching the search criteriasimple
- return only the ID, URL, name, and path of each projectowned
- limit by projects owned by the current usermembership
- limit by projects that the current user is a member ofstarred
- limit by projects starred by the current userstatistics
- include project statisticsitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of projects accessible by the authenticated user and matching the supplied parameters
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public java.util.List<org.gitlab4j.api.models.Project> getProjects(java.lang.String search) throws GitLabApiException
Get a list of projects accessible by the authenticated user that match the provided search string.GitLab Endpoint: GET /projects?search=search
- Parameters:
search
- the project name search criteria- Returns:
- a list of projects accessible by the authenticated user that match the provided search string
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public java.util.List<org.gitlab4j.api.models.Project> getProjects(java.lang.String search, int page, int perPage) throws GitLabApiException
Get a list of projects accessible by the authenticated user that match the provided search string.GitLab Endpoint: GET /projects?search=search
- Parameters:
search
- the project name search criteriapage
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects accessible by the authenticated user that match the provided search string
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public Pager<org.gitlab4j.api.models.Project> getProjects(java.lang.String search, int itemsPerPage) throws GitLabApiException
Get a Pager of projects accessible by the authenticated user that match the provided search string.GitLab Endpoint: GET /projects?search=search
- Parameters:
search
- the project name search criteriaitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of projects accessible by the authenticated user that match the provided search string
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Project> getProjectsStream(java.lang.String search) throws GitLabApiException
Get a Stream of projects accessible by the authenticated user that match the provided search string.GitLab Endpoint: GET /projects?search=search
- Parameters:
search
- the project name search criteria- Returns:
- a Stream of projects accessible by the authenticated user that match the provided search string
- Throws:
GitLabApiException
- if any exception occurs
-
getMemberProjects
public java.util.List<org.gitlab4j.api.models.Project> getMemberProjects() throws GitLabApiException
Get a list of projects that the authenticated user is a member of.GitLab Endpoint: GET /projects?membership=true
- Returns:
- a list of projects that the authenticated user is a member of
- Throws:
GitLabApiException
- if any exception occurs
-
getMemberProjects
public java.util.List<org.gitlab4j.api.models.Project> getMemberProjects(int page, int perPage) throws GitLabApiException
Get a list of projects that the authenticated user is a member of in the specified page range.GitLab Endpoint: GET /projects?membership=true
- Parameters:
page
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects that the authenticated user is a member of
- Throws:
GitLabApiException
- if any exception occurs
-
getMemberProjects
public Pager<org.gitlab4j.api.models.Project> getMemberProjects(int itemsPerPage) throws GitLabApiException
Get a Pager of projects that the authenticated user is a member of.GitLab Endpoint: GET /projects?membership=true
- Parameters:
itemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager o Project instances that the authenticated user is a member of
- Throws:
GitLabApiException
- if any exception occurs
-
getMemberProjectsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Project> getMemberProjectsStream() throws GitLabApiException
Get a Stream of projects that the authenticated user is a member of.GitLab Endpoint: GET /projects?membership=true
- Returns:
- a list of projects that the authenticated user is a member of
- Throws:
GitLabApiException
- if any exception occurs
-
getOwnedProjects
public java.util.List<org.gitlab4j.api.models.Project> getOwnedProjects() throws GitLabApiException
Get a list of projects owned by the authenticated user.GitLab Endpoint: GET /projects?owned=true
- Returns:
- a list of projects owned by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getOwnedProjects
public java.util.List<org.gitlab4j.api.models.Project> getOwnedProjects(int page, int perPage) throws GitLabApiException
Get a list of projects owned by the authenticated user in the specified page range.GitLab Endpoint: GET /projects?owned=true
- Parameters:
page
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects owned by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getOwnedProjects
public Pager<org.gitlab4j.api.models.Project> getOwnedProjects(int itemsPerPage) throws GitLabApiException
Get a Pager of projects owned by the authenticated user.GitLab Endpoint: GET /projects?owned=true
- Parameters:
itemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a list of projects owned by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getOwnedProjectsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Project> getOwnedProjectsStream() throws GitLabApiException
Get a Stream of projects owned by the authenticated user.GitLab Endpoint: GET /projects?owned=true
- Returns:
- a Stream of projects owned by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getStarredProjects
public java.util.List<org.gitlab4j.api.models.Project> getStarredProjects() throws GitLabApiException
Get a list of projects starred by the authenticated user.GitLab Endpoint: GET /projects?starred=true
- Returns:
- a list of projects starred by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getStarredProjects
public java.util.List<org.gitlab4j.api.models.Project> getStarredProjects(int page, int perPage) throws GitLabApiException
Get a list of projects starred by the authenticated user in the specified page range.GitLab Endpoint: GET /projects?starred=true
- Parameters:
page
- the page to getperPage
- the number of projects per page- Returns:
- a list of projects starred by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getStarredProjects
public Pager<org.gitlab4j.api.models.Project> getStarredProjects(int itemsPerPage) throws GitLabApiException
Get a Pager of projects starred by the authenticated user.GitLab Endpoint: GET /projects?starred=true
- Parameters:
itemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of projects starred by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getStarredProjectsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Project> getStarredProjectsStream() throws GitLabApiException
Get a Stream of projects starred by the authenticated user.GitLab Endpoint: GET /projects?starred=true
- Returns:
- a Stream of projects starred by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public java.util.List<org.gitlab4j.api.models.Project> getProjects(org.gitlab4j.api.models.ProjectFilter filter) throws GitLabApiException
Get a list of all visible projects across GitLab for the authenticated user using the provided filter.GitLab Endpoint: GET /projects
- Parameters:
filter
- the ProjectFilter instance holding the filter values for the query- Returns:
- a list of all visible projects across GitLab for the authenticated use
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public java.util.List<org.gitlab4j.api.models.Project> getProjects(org.gitlab4j.api.models.ProjectFilter filter, int page, int perPage) throws GitLabApiException
Get a list of all visible projects across GitLab for the authenticated user in the specified page range using the provided filter.GitLab Endpoint: GET /projects
- Parameters:
filter
- the ProjectFilter instance holding the filter values for the querypage
- the page to getperPage
- the number of projects per page- Returns:
- a list of all visible projects across GitLab for the authenticated use
- Throws:
GitLabApiException
- if any exception occurs
-
getProjects
public Pager<org.gitlab4j.api.models.Project> getProjects(org.gitlab4j.api.models.ProjectFilter filter, int itemsPerPage) throws GitLabApiException
Get a Pager of all visible projects across GitLab for the authenticated user using the provided filter.GitLab Endpoint: GET /projects
- Parameters:
filter
- the ProjectFilter instance holding the filter values for the queryitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of all visible projects across GitLab for the authenticated use
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Project> getProjectsStream(org.gitlab4j.api.models.ProjectFilter filter) throws GitLabApiException
Get a Stream of all visible projects across GitLab for the authenticated user using the provided filter.GitLab Endpoint: GET /projects
- Parameters:
filter
- the ProjectFilter instance holding the filter values for the query- Returns:
- a Stream of all visible projects across GitLab for the authenticated use
- Throws:
GitLabApiException
- if any exception occurs
-
getUserProjects
public java.util.List<org.gitlab4j.api.models.Project> getUserProjects(java.lang.Object userIdOrUsername, org.gitlab4j.api.models.ProjectFilter filter) throws GitLabApiException
Get a list of visible projects owned by the given user.GitLab Endpoint: GET /users/:user_id/projects
- Parameters:
userIdOrUsername
- the user ID, username of the user, or a User instance holding the user ID or usernamefilter
- the ProjectFilter instance holding the filter values for the query- Returns:
- a list of visible projects owned by the given user
- Throws:
GitLabApiException
- if any exception occurs
-
getUserProjects
public java.util.List<org.gitlab4j.api.models.Project> getUserProjects(java.lang.Object userIdOrUsername, org.gitlab4j.api.models.ProjectFilter filter, int page, int perPage) throws GitLabApiException
Get a list of visible projects owned by the given user in the specified page range.GitLab Endpoint: GET /users/:user_id/projects
- Parameters:
userIdOrUsername
- the user ID, username of the user, or a User instance holding the user ID or usernamefilter
- the ProjectFilter instance holding the filter values for the querypage
- the page to getperPage
- the number of projects per page- Returns:
- a list of visible projects owned by the given user
- Throws:
GitLabApiException
- if any exception occurs
-
getUserProjects
public Pager<org.gitlab4j.api.models.Project> getUserProjects(java.lang.Object userIdOrUsername, org.gitlab4j.api.models.ProjectFilter filter, int itemsPerPage) throws GitLabApiException
Get a Pager of visible projects owned by the given user.GitLab Endpoint: GET /users/:user_id/projects
- Parameters:
userIdOrUsername
- the user ID, username of the user, or a User instance holding the user ID or usernamefilter
- the ProjectFilter instance holding the filter values for the queryitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of visible projects owned by the given user
- Throws:
GitLabApiException
- if any exception occurs
-
getUserProjectsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Project> getUserProjectsStream(java.lang.Object userIdOrUsername, org.gitlab4j.api.models.ProjectFilter filter) throws GitLabApiException
Get a Stream of visible projects owned by the given user.GitLab Endpoint: GET /users/:user_id/projects
- Parameters:
userIdOrUsername
- the user ID, username of the user, or a User instance holding the user ID or usernamefilter
- the ProjectFilter instance holding the filter values for the query- Returns:
- a Stream of visible projects owned by the given user
- Throws:
GitLabApiException
- if any exception occurs
-
getProject
public org.gitlab4j.api.models.Project getProject(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public java.util.Optional<org.gitlab4j.api.models.Project> getOptionalProject(java.lang.Object projectIdOrPath)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- an Optional instance with the specified project as a value
-
getProject
public org.gitlab4j.api.models.Project getProject(java.lang.Object projectIdOrPath, java.lang.Boolean includeStatistics) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceincludeStatistics
- include project statistics- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public java.util.Optional<org.gitlab4j.api.models.Project> getOptionalProject(java.lang.Object projectIdOrPath, java.lang.Boolean includeStatistics)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceincludeStatistics
- include project statistics- Returns:
- an Optional instance with the specified project as a value
-
getProject
public org.gitlab4j.api.models.Project getProject(java.lang.Object projectIdOrPath, java.lang.Boolean includeStatistics, java.lang.Boolean includeLicense, java.lang.Boolean withCustomAttributes) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceincludeStatistics
- include project statisticsincludeLicense
- include project license datawithCustomAttributes
- include custom attributes in response (admins only)- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public java.util.Optional<org.gitlab4j.api.models.Project> getOptionalProject(java.lang.Object projectIdOrPath, java.lang.Boolean includeStatistics, java.lang.Boolean includeLicense, java.lang.Boolean withCustomAttributes)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceincludeStatistics
- include project statisticsincludeLicense
- include project license datawithCustomAttributes
- include custom attributes in response (admins only)- Returns:
- an Optional instance with the specified project as a value
-
getProject
public org.gitlab4j.api.models.Project getProject(java.lang.String namespace, java.lang.String project) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
namespace
- the name of the project namespace or groupproject
- the name of the project to get- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public java.util.Optional<org.gitlab4j.api.models.Project> getOptionalProject(java.lang.String namespace, java.lang.String project)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
namespace
- the name of the project namespace or groupproject
- the name of the project- Returns:
- an Optional instance with the specified project as a value
-
getProject
public org.gitlab4j.api.models.Project getProject(java.lang.String namespace, java.lang.String project, java.lang.Boolean includeStatistics) throws GitLabApiException
Get a specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
namespace
- the name of the project namespace or groupproject
- the name of the project to getincludeStatistics
- include project statistics- Returns:
- the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalProject
public java.util.Optional<org.gitlab4j.api.models.Project> getOptionalProject(java.lang.String namespace, java.lang.String project, java.lang.Boolean includeStatistics)
Get an Optional instance with the value for the specific project, which is owned by the authentication user.GitLab Endpoint: GET /projects/:id
- Parameters:
namespace
- the name of the project namespace or groupproject
- the name of the projectincludeStatistics
- include project statistics- Returns:
- an Optional instance with the specified project as a value
-
createProject
public org.gitlab4j.api.models.Project createProject(java.lang.Long namespaceId, java.lang.String projectName) throws GitLabApiException
Create a new project belonging to the namespace ID. A namespace ID is either a user or group ID.- Parameters:
namespaceId
- the namespace ID to create the project underprojectName
- the name of the project top create- Returns:
- the created project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public org.gitlab4j.api.models.Project createProject(java.lang.Long namespaceId, org.gitlab4j.api.models.Project project) throws GitLabApiException
Create a new project belonging to the namespace ID and project configuration. A namespace ID is either a user or group ID.- Parameters:
namespaceId
- the namespace ID to create the project underproject
- the Project instance holding the new project configuration- Returns:
- the created project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public org.gitlab4j.api.models.Project createProject(java.lang.String projectName) throws GitLabApiException
Create a new project with the current user's namespace.- Parameters:
projectName
- the name of the project top create- Returns:
- the created project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public org.gitlab4j.api.models.Project createProject(java.lang.String name, java.lang.String path) throws GitLabApiException
Creates a new project owned by the authenticated user.- Parameters:
name
- the name of the project top create. Equals path if not provided.path
- repository name for new project. Generated based on name if not provided (generated lowercased with dashes).- Returns:
- the created project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public org.gitlab4j.api.models.Project createProject(org.gitlab4j.api.models.Project project) throws GitLabApiException
Creates new project owned by the current user.- Parameters:
project
- the Project instance with the configuration for the new project- Returns:
- a Project instance with the newly created project info
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public org.gitlab4j.api.models.Project createProject(org.gitlab4j.api.models.Project project, java.lang.String importUrl) throws GitLabApiException
Creates new project owned by the current user. The following properties on the Project instance are utilized in the creation of the project: name (name or path are required) - new project name path (name or path are required) - new project path defaultBranch (optional) - master by default description (optional) - short project description visibility (optional) - Limit by visibility public, internal, or private visibilityLevel (optional) issuesEnabled (optional) - Enable issues for this project mergeMethod (optional) - Set the merge method used mergeRequestsEnabled (optional) - Enable merge requests for this project wikiEnabled (optional) - Enable wiki for this project snippetsEnabled (optional) - Enable snippets for this project jobsEnabled (optional) - Enable jobs for this project containerRegistryEnabled (optional) - Enable container registry for this project sharedRunnersEnabled (optional) - Enable shared runners for this project publicJobs (optional) - If true, jobs can be viewed by non-project-members onlyAllowMergeIfPipelineSucceeds (optional) - Set whether merge requests can only be merged with successful jobs onlyAllowMergeIfAllDiscussionsAreResolved (optional) - Set whether merge requests can only be merged when all the discussions are resolved lfsEnabled (optional) - Enable LFS requestAccessEnabled (optional) - Allow users to request member access repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins approvalsBeforeMerge (optional) - How many approvers should approve merge request by default printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push initialize_with_readme (optional) - Initialize project with README file packagesEnabled (optional) - Enable or disable mvn packages repository feature buildGitStrategy (optional) - set the build git strategy buildCoverageRegex (optional) - set build coverage regex ciConfigPath (optional) - Set path to CI configuration file autoDevopsEnabled (optional) - Enable Auto DevOps for this project squashOption (optional) - set squash option for merge requests- Parameters:
project
- the Project instance with the configuration for the new projectimportUrl
- the URL to import the repository from- Returns:
- a Project instance with the newly created project info
- Throws:
GitLabApiException
- if any exception occurs
-
getAvatar
public java.io.InputStream getAvatar(java.lang.Object projectIdOrPath) throws GitLabApiException
Gets the project avatar. Only working with GitLab 16.9 and above.GitLab Endpoint: GET /projects/:id/avatar
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- an InputStream to read the raw file from
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public org.gitlab4j.api.models.Project createProject(java.lang.String name, java.lang.Long namespaceId, java.lang.String description, java.lang.Boolean issuesEnabled, java.lang.Boolean mergeRequestsEnabled, java.lang.Boolean wikiEnabled, java.lang.Boolean snippetsEnabled, org.gitlab4j.api.models.Visibility visibility, java.lang.Integer visibilityLevel, java.lang.String importUrl) throws GitLabApiException
Creates a Project- Parameters:
name
- The name of the projectnamespaceId
- The Namespace for the new project, otherwise null indicates to use the GitLab default (user)description
- A description for the project, null otherwiseissuesEnabled
- Whether Issues should be enabled, otherwise null indicates to use GitLab defaultmergeRequestsEnabled
- Whether Merge Requests should be enabled, otherwise null indicates to use GitLab defaultwikiEnabled
- Whether a Wiki should be enabled, otherwise null indicates to use GitLab defaultsnippetsEnabled
- Whether Snippets should be enabled, otherwise null indicates to use GitLab defaultvisibility
- The visibility of the project, otherwise null indicates to use GitLab defaultvisibilityLevel
- The visibility level of the project, otherwise null indicates to use GitLab defaultimportUrl
- The Import URL for the project, otherwise null- Returns:
- the GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
public org.gitlab4j.api.models.Project createProject(java.lang.String name, java.lang.Long namespaceId, java.lang.String description, java.lang.Boolean issuesEnabled, java.lang.Boolean mergeRequestsEnabled, java.lang.Boolean wikiEnabled, java.lang.Boolean snippetsEnabled, org.gitlab4j.api.models.Visibility visibility, java.lang.Integer visibilityLevel, java.lang.Boolean printingMergeRequestLinkEnabled, java.lang.String importUrl) throws GitLabApiException
Creates a Project- Parameters:
name
- The name of the projectnamespaceId
- The Namespace for the new project, otherwise null indicates to use the GitLab default (user)description
- A description for the project, null otherwiseissuesEnabled
- Whether Issues should be enabled, otherwise null indicates to use GitLab defaultmergeRequestsEnabled
- Whether Merge Requests should be enabled, otherwise null indicates to use GitLab defaultwikiEnabled
- Whether a Wiki should be enabled, otherwise null indicates to use GitLab defaultsnippetsEnabled
- Whether Snippets should be enabled, otherwise null indicates to use GitLab defaultvisibility
- The visibility of the project, otherwise null indicates to use GitLab defaultvisibilityLevel
- The visibility level of the project, otherwise null indicates to use GitLab defaultprintingMergeRequestLinkEnabled
- Show link to create/view merge request when pushing from the command lineimportUrl
- The Import URL for the project, otherwise null- Returns:
- the GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
createProject
@Deprecated public org.gitlab4j.api.models.Project createProject(java.lang.String name, java.lang.Long namespaceId, java.lang.String description, java.lang.Boolean issuesEnabled, java.lang.Boolean mergeRequestsEnabled, java.lang.Boolean wikiEnabled, java.lang.Boolean snippetsEnabled, java.lang.Boolean isPublic, java.lang.Integer visibilityLevel, java.lang.String importUrl) throws GitLabApiException
Deprecated.As of release 4.2.0, replaced bycreateProject(String, Long, String, Boolean, Boolean, Boolean, Boolean, Visibility, Integer, String)
Creates a Project- Parameters:
name
- The name of the projectnamespaceId
- The Namespace for the new project, otherwise null indicates to use the GitLab default (user)description
- A description for the project, null otherwiseissuesEnabled
- Whether Issues should be enabled, otherwise null indicates to use GitLab defaultmergeRequestsEnabled
- Whether Merge Requests should be enabled, otherwise null indicates to use GitLab defaultwikiEnabled
- Whether a Wiki should be enabled, otherwise null indicates to use GitLab defaultsnippetsEnabled
- Whether Snippets should be enabled, otherwise null indicates to use GitLab defaultisPublic
- Whether the project is public or private, if true same as setting visibilityLevel = 20, otherwise null indicates to use GitLab defaultvisibilityLevel
- The visibility level of the project, otherwise null indicates to use GitLab defaultimportUrl
- The Import URL for the project, otherwise null- Returns:
- the GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
createProjectFromTemplate
public org.gitlab4j.api.models.Project createProjectFromTemplate(java.lang.Integer namespaceId, java.lang.String projectName, java.lang.Integer groupWithProjectTemplatesId, java.lang.String templateName, org.gitlab4j.api.models.Visibility visibility) throws GitLabApiException
Create a new project from a template, belonging to the namespace ID. A namespace ID is either a user or group ID.- Parameters:
namespaceId
- the namespace ID to create the project underprojectName
- the name of the project top creategroupWithProjectTemplatesId
- Id of the Gitlab Group, which contains the relevant templates.templateName
- name of the template to usevisibility
- Visibility of the new create project- Returns:
- the created project
- Throws:
GitLabApiException
- if any exception occurs
-
updateProject
public org.gitlab4j.api.models.Project updateProject(org.gitlab4j.api.models.Project project) throws GitLabApiException
Updates a project. The following properties on the Project instance are utilized in the edit of the project, null values are not updated: id (required) - existing project id, either id or path must be provided name (optional) - project name path (optional) - project path, either id or path must be provided defaultBranch (optional) - master by default description (optional) - short project description visibility (optional) - Limit by visibility public, internal, or private issuesEnabled (optional) - Enable issues for this project mergeMethod (optional) - Set the merge method used mergeRequestsEnabled (optional) - Enable merge requests for this project wikiEnabled (optional) - Enable wiki for this project snippetsEnabled (optional) - Enable snippets for this project jobsEnabled (optional) - Enable jobs for this project containerRegistryEnabled (optional) - Enable container registry for this project sharedRunnersEnabled (optional) - Enable shared runners for this project publicJobs (optional) - If true, jobs can be viewed by non-project-members onlyAllowMergeIfPipelineSucceeds (optional) - Set whether merge requests can only be merged with successful jobs onlyAllowMergeIfAllDiscussionsAreResolved (optional) - Set whether merge requests can only be merged when all the discussions are resolved lfsEnabled (optional) - Enable LFS requestAccessEnabled (optional) - Allow users to request member access repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins approvalsBeforeMerge (optional) - How many approvers should approve merge request by default printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push packagesEnabled (optional) - Enable or disable mvn packages repository feature buildGitStrategy (optional) - set the build git strategy buildCoverageRegex (optional) - set build coverage regex ciConfigPath (optional) - Set path to CI configuration file ciForwardDeploymentEnabled (optional) - When a new deployment job starts, skip older deployment jobs that are still pending squashOption (optional) - set squash option for merge requests NOTE: The following parameters specified by the GitLab API edit project are not supported: import_url tag_list array avatar initialize_with_readme- Parameters:
project
- the Project instance with the configuration for the new project- Returns:
- a Project instance with the newly updated project info
- Throws:
GitLabApiException
- if any exception occurs
-
deleteProject
public void deleteProject(java.lang.Object projectIdOrPath) throws GitLabApiException
Removes project with all resources(issues, merge requests etc).GitLab Endpoint: DELETE /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Throws:
GitLabApiException
- if any exception occurs
-
forkProject
public org.gitlab4j.api.models.Project forkProject(java.lang.Object projectIdOrPath, java.lang.String namespace) throws GitLabApiException
Forks a project into the user namespace of the authenticated user or the one provided. The forking operation for a project is asynchronous and is completed in a background job. The request will return immediately.GitLab Endpoint: POST /projects/:id/fork
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancenamespace
- path of the namespace that the project will be forked to- Returns:
- the newly forked Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
forkProject
public org.gitlab4j.api.models.Project forkProject(java.lang.Object projectIdOrPath, java.lang.Long namespaceId) throws GitLabApiException
Forks a project into the user namespace of the authenticated user or the one provided. The forking operation for a project is asynchronous and is completed in a background job. The request will return immediately.GitLab Endpoint: POST /projects/:id/fork
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancenamespaceId
- ID of the namespace that the project will be forked to- Returns:
- the newly forked Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
forkProject
public org.gitlab4j.api.models.Project forkProject(java.lang.Object projectIdOrPath, java.lang.String namespace, java.lang.String path, java.lang.String name) throws GitLabApiException
Forks a project into the user namespace of the authenticated user or the one provided. The forking operation for a project is asynchronous and is completed in a background job. The request will return immediately.GitLab Endpoint: POST /projects/:id/fork
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancenamespace
- path of the namespace that the project will be forked topath
- the path that will be assigned to the resultant project after forkingname
- the name that will be assigned to the resultant project after forking- Returns:
- the newly forked Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
createForkedFromRelationship
public org.gitlab4j.api.models.Project createForkedFromRelationship(java.lang.Object projectIdOrPath, java.lang.Long forkedFromId) throws GitLabApiException
Create a forked from/to relation between existing projects.GitLab Endpoint: POST /projects/:id/fork/:forkFromId
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceforkedFromId
- the ID of the project that was forked from- Returns:
- the updated Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteForkedFromRelationship
public void deleteForkedFromRelationship(java.lang.Object projectIdOrPath) throws GitLabApiException
Delete an existing forked from relationship.GitLab Endpoint: DELETE /projects/:id/fork
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Throws:
GitLabApiException
- if any exception occurs
-
getMembers
public java.util.List<org.gitlab4j.api.models.Member> getMembers(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of project team members.GitLab Endpoint: GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- the members belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getMembers
public java.util.List<org.gitlab4j.api.models.Member> getMembers(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of project team members in the specified page range.GitLab Endpoint: GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Member instances per page- Returns:
- the members belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getMembers
public Pager<org.gitlab4j.api.models.Member> getMembers(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project team members.GitLab Endpoint: GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- the members belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getMembersStream
public java.util.stream.Stream<org.gitlab4j.api.models.Member> getMembersStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of project team members.GitLab Endpoint: GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of the members belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembers
public java.util.List<org.gitlab4j.api.models.Member> getAllMembers(java.lang.Object projectIdOrPath) throws GitLabApiException
Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.GitLab Endpoint: GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembers
@Deprecated public java.util.List<org.gitlab4j.api.models.Member> getAllMembers(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Deprecated.Will be removed in version 6.0Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.GitLab Endpoint: GET /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Member instances per page- Returns:
- the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembers
public Pager<org.gitlab4j.api.models.Member> getAllMembers(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Gets a Pager of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.GitLab Endpoint: GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembersStream
public java.util.stream.Stream<org.gitlab4j.api.models.Member> getAllMembersStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Gets a Stream of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.GitLab Endpoint: GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembers
public java.util.List<org.gitlab4j.api.models.Member> getAllMembers(java.lang.Object projectIdOrPath, java.lang.String query, java.util.List<java.lang.Long> userIds) throws GitLabApiException
Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.GitLab Endpoint: GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancequery
- a query string to search for membersuserIds
- filter the results on the given user IDs- Returns:
- the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembers
public Pager<org.gitlab4j.api.models.Member> getAllMembers(java.lang.Object projectIdOrPath, java.lang.String query, java.util.List<java.lang.Long> userIds, int itemsPerPage) throws GitLabApiException
Gets a Pager of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.GitLab Endpoint: GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancequery
- a query string to search for membersuserIds
- filter the results on the given user IDsitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getAllMembersStream
public java.util.stream.Stream<org.gitlab4j.api.models.Member> getAllMembersStream(java.lang.Object projectIdOrPath, java.lang.String query, java.util.List<java.lang.Long> userIds) throws GitLabApiException
Gets a Stream of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.GitLab Endpoint: GET /projects/:id/members/all
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancequery
- a query string to search for membersuserIds
- filter the results on the given user IDs- Returns:
- a Stream of the project members viewable by the authenticated user, including inherited members through ancestor groups
- Throws:
GitLabApiException
- if any exception occurs
-
getMember
public org.gitlab4j.api.models.Member getMember(java.lang.Object projectIdOrPath, java.lang.Long userId) throws GitLabApiException
Gets a project team member.GitLab Endpoint: GET /projects/:id/members/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member- Returns:
- the member specified by the project ID/user ID pair
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalMember
public java.util.Optional<org.gitlab4j.api.models.Member> getOptionalMember(java.lang.Object projectIdOrPath, java.lang.Long userId)
Gets a project team member.GitLab Endpoint: GET /projects/:id/members/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member- Returns:
- the member specified by the project ID/user ID pair
-
getMember
public org.gitlab4j.api.models.Member getMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Boolean includeInherited) throws GitLabApiException
Gets a project team member, optionally including inherited member.GitLab Endpoint: GET /projects/:id/members/all/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the memberincludeInherited
- if true will the member even if inherited thru an ancestor group- Returns:
- the member specified by the project ID/user ID pair
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalMember
public java.util.Optional<org.gitlab4j.api.models.Member> getOptionalMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Boolean includeInherited)
Gets a project team member, optionally including inherited member.GitLab Endpoint: GET /projects/:id/members/all/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the memberincludeInherited
- if true will the member even if inherited thru an ancestor group- Returns:
- the member specified by the project ID/user ID pair as the value of an Optional
-
addMember
public org.gitlab4j.api.models.Member addMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Integer accessLevel) throws GitLabApiException
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.GitLab Endpoint: POST /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member to add, requiredaccessLevel
- the access level for the new member, required- Returns:
- the added member
- Throws:
GitLabApiException
- if any exception occurs
-
addMember
public org.gitlab4j.api.models.Member addMember(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel) throws GitLabApiException
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.GitLab Endpoint: POST /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member to add, requiredaccessLevel
- the access level for the new member, required- Returns:
- the added member
- Throws:
GitLabApiException
- if any exception occurs
-
addMember
public org.gitlab4j.api.models.Member addMember(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel, java.util.Date expiresAt) throws GitLabApiException
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.GitLab Endpoint: POST /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member to addaccessLevel
- the access level for the new memberexpiresAt
- the date the membership in the group will expire- Returns:
- the added member
- Throws:
GitLabApiException
- if any exception occurs
-
addMember
public org.gitlab4j.api.models.Member addMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Integer accessLevel, java.util.Date expiresAt) throws GitLabApiException
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership.GitLab Endpoint: POST /projects/:id/members
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member to addaccessLevel
- the access level for the new memberexpiresAt
- the date the membership in the group will expire- Returns:
- the added member
- Throws:
GitLabApiException
- if any exception occurs
-
updateMember
public org.gitlab4j.api.models.Member updateMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Integer accessLevel) throws GitLabApiException
Updates a member of a project.GitLab Endpoint: PUT /projects/:projectId/members/:userId
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, required- Returns:
- the updated member
- Throws:
GitLabApiException
- if any exception occurs
-
updateMember
public org.gitlab4j.api.models.Member updateMember(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel) throws GitLabApiException
Updates a member of a project.GitLab Endpoint: PUT /projects/:projectId/members/:userId
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, required- Returns:
- the updated member
- Throws:
GitLabApiException
- if any exception occurs
-
updateMember
public org.gitlab4j.api.models.Member updateMember(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel, java.util.Date expiresAt) throws GitLabApiException
Updates a member of a project.GitLab Endpoint: PUT /projects/:projectId/members/:userId
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, requiredexpiresAt
- the date the membership in the group will expire, optional- Returns:
- the updated member
- Throws:
GitLabApiException
- if any exception occurs
-
updateMember
public org.gitlab4j.api.models.Member updateMember(java.lang.Object projectIdOrPath, java.lang.Long userId, java.lang.Integer accessLevel, java.util.Date expiresAt) throws GitLabApiException
Updates a member of a project.GitLab Endpoint: PUT /projects/:projectId/members/:userId
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requireduserId
- the user ID of the member to update, requiredaccessLevel
- the new access level for the member, requiredexpiresAt
- the date the membership in the group will expire, optional- Returns:
- the updated member
- Throws:
GitLabApiException
- if any exception occurs
-
removeMember
public void removeMember(java.lang.Object projectIdOrPath, java.lang.Long userId) throws GitLabApiException
Removes user from project team.GitLab Endpoint: DELETE /projects/:id/members/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requireduserId
- the user ID of the member to remove- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsers
public java.util.List<org.gitlab4j.api.models.ProjectUser> getProjectUsers(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of project users. This list includes all project members and all users assigned to project parent groups.GitLab Endpoint: GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- the users belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsers
public Pager<org.gitlab4j.api.models.ProjectUser> getProjectUsers(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project users. This Pager includes all project members and all users assigned to project parent groups.GitLab Endpoint: GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the users matching the search string and belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsersStream
public java.util.stream.Stream<org.gitlab4j.api.models.ProjectUser> getProjectUsersStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of project users. This Stream includes all project members and all users assigned to project parent groups.GitLab Endpoint: GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Stream of the users belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsers
public java.util.List<org.gitlab4j.api.models.ProjectUser> getProjectUsers(java.lang.Object projectIdOrPath, java.lang.String search) throws GitLabApiException
Get a list of project users matching the specified search string. This list includes all project members and all users assigned to project parent groups.GitLab Endpoint: GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredsearch
- the string to match specific users- Returns:
- the users matching the search string and belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsers
public Pager<org.gitlab4j.api.models.ProjectUser> getProjectUsers(java.lang.Object projectIdOrPath, java.lang.String search, int itemsPerPage) throws GitLabApiException
Get a Pager of project users matching the specified search string. This Pager includes all project members and all users assigned to project parent groups.GitLab Endpoint: GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancesearch
- the string to match specific usersitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the users matching the search string and belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectUsersStream
public java.util.stream.Stream<org.gitlab4j.api.models.ProjectUser> getProjectUsersStream(java.lang.Object projectIdOrPath, java.lang.String search) throws GitLabApiException
Get a Stream of project users matching the specified search string. This Stream includes all project members and all users assigned to project parent groups.GitLab Endpoint: GET /projects/:id/users
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredsearch
- the string to match specific users- Returns:
- a Stream of the users matching the search string and belonging to the specified project and its parent groups
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectGroups
public java.util.List<org.gitlab4j.api.models.ProjectGroup> getProjectGroups(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of the ancestor groups for a given project.GitLab Endpoint: GET /projects/:id/groups
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- the ancestor groups for a given project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectGroups
public Pager<org.gitlab4j.api.models.ProjectGroup> getProjectGroups(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of the ancestor groups for a given project.GitLab Endpoint: GET /projects/:id/groups
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the ancestor groups for a given project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectGroupsStream
public java.util.stream.Stream<org.gitlab4j.api.models.ProjectGroup> getProjectGroupsStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of the ancestor groups for a given project.GitLab Endpoint: GET /projects/:id/groups
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Stream of the ancestor groups for a given project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectGroups
public java.util.List<org.gitlab4j.api.models.ProjectGroup> getProjectGroups(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ProjectGroupsFilter filter) throws GitLabApiException
Get a list of the ancestor groups for a given project matching the specified filter.GitLab Endpoint: GET /projects/:id/groups
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredfilter
- the ProjectGroupsFilter to match against- Returns:
- the ancestor groups for a given project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectGroups
public Pager<org.gitlab4j.api.models.ProjectGroup> getProjectGroups(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ProjectGroupsFilter filter, int itemsPerPage) throws GitLabApiException
Get a Pager of the ancestor groups for a given project matching the specified filter.GitLab Endpoint: GET /projects/:id/groups
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancefilter
- the ProjectGroupsFilter to match againstitemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of the ancestor groups for a given project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectGroupsStream
public java.util.stream.Stream<org.gitlab4j.api.models.ProjectGroup> getProjectGroupsStream(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ProjectGroupsFilter filter) throws GitLabApiException
Get a Stream of the ancestor groups for a given project matching the specified filter.GitLab Endpoint: GET /projects/:id/groups
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredfilter
- the ProjectGroupsFilter to match against- Returns:
- a Stream of the ancestor groups for a given project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectEvents
public java.util.List<org.gitlab4j.api.models.Event> getProjectEvents(java.lang.Object projectIdOrPath) throws GitLabApiException
Get the project events for specific project. Sorted from newest to latest.GitLab Endpoint: GET /projects/:id/events
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- the project events for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectEvents
public java.util.List<org.gitlab4j.api.models.Event> getProjectEvents(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get the project events for specific project. Sorted from newest to latest in the specified page range.GitLab Endpoint: GET /projects/:id/events
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of Event instances per page- Returns:
- the project events for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectEvents
public Pager<org.gitlab4j.api.models.Event> getProjectEvents(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project events for specific project. Sorted from newest to latest.GitLab Endpoint: GET /projects/:id/events
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requireditemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of project events for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectEventsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Event> getProjectEventsStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of the project events for specific project. Sorted from newest to latest.GitLab Endpoint: GET /projects/:id/events
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Stream of the project events for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getHooks
public java.util.List<org.gitlab4j.api.models.ProjectHook> getHooks(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of the project hooks for the specified project.GitLab Endpoint: GET /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a list of project hooks for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getHooks
public java.util.List<org.gitlab4j.api.models.ProjectHook> getHooks(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get list of project hooks in the specified page range.GitLab Endpoint: GET /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of ProjectHook instances per page- Returns:
- a list of project hooks for the specified project in the specified page range
- Throws:
GitLabApiException
- if any exception occurs
-
getHooks
public Pager<org.gitlab4j.api.models.ProjectHook> getHooks(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get Pager of project hooks.GitLab Endpoint: GET /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requireditemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of project hooks for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getHooksStream
public java.util.stream.Stream<org.gitlab4j.api.models.ProjectHook> getHooksStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of the project hooks for the specified project.GitLab Endpoint: GET /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Stream of project hooks for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getHook
public org.gitlab4j.api.models.ProjectHook getHook(java.lang.Object projectIdOrPath, java.lang.Long hookId) throws GitLabApiException
Get a specific hook for project.GitLab Endpoint: GET /projects/:id/hooks/:hook_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredhookId
- the ID of the hook to get- Returns:
- the project hook for the specified project ID/hook ID pair
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalHook
public java.util.Optional<org.gitlab4j.api.models.ProjectHook> getOptionalHook(java.lang.Object projectIdOrPath, java.lang.Long hookId)
Get a specific hook for project as an Optional instance.GitLab Endpoint: GET /projects/:id/hooks/:hook_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredhookId
- the ID of the hook to get- Returns:
- the project hook for the specified project ID/hook ID pair as an Optional instance
-
addHook
public org.gitlab4j.api.models.ProjectHook addHook(java.lang.Object projectIdOrPath, java.lang.String url, org.gitlab4j.api.models.ProjectHook enabledHooks, java.lang.Boolean enableSslVerification, java.lang.String secretToken) throws GitLabApiException
Adds a hook to project.GitLab Endpoint: POST /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredurl
- the callback URL for the hookenabledHooks
- a ProjectHook instance specifying which hooks to enableenableSslVerification
- enable SSL verificationsecretToken
- the secret token to pass back to the hook- Returns:
- the added ProjectHook instance
- Throws:
GitLabApiException
- if any exception occurs
-
addHook
public org.gitlab4j.api.models.ProjectHook addHook(java.lang.Object projectIdOrPath, java.lang.String url, java.lang.Boolean doPushEvents, java.lang.Boolean doIssuesEvents, java.lang.Boolean doMergeRequestsEvents) throws GitLabApiException
Adds a hook to project. Convenience method foraddHook(Object, String, ProjectHook, Boolean, String)
GitLab Endpoint: POST /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredurl
- the callback URL for the hookdoPushEvents
- flag specifying whether to do push eventsdoIssuesEvents
- flag specifying whether to do issues eventsdoMergeRequestsEvents
- flag specifying whether to do merge requests events- Returns:
- the added ProjectHook instance
- Throws:
GitLabApiException
- if any exception occurs
-
addHook
public org.gitlab4j.api.models.ProjectHook addHook(java.lang.Object projectIdOrPath, java.lang.String url, java.lang.Boolean doPushEvents, java.lang.Boolean doIssuesEvents, java.lang.Boolean doMergeRequestsEvents, java.lang.Boolean doNoteEvents) throws GitLabApiException
Adds a hook to project. Convenience method foraddHook(Object, String, ProjectHook, Boolean, String)
GitLab Endpoint: POST /projects/:id/hooks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredurl
- the callback URL for the hookdoPushEvents
- flag specifying whether to do push eventsdoIssuesEvents
- flag specifying whether to do issues eventsdoMergeRequestsEvents
- flag specifying whether to do merge requests eventsdoNoteEvents
- flag specifying whether to do note events- Returns:
- the added ProjectHook instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteHook
public void deleteHook(java.lang.Object projectIdOrPath, java.lang.Long hookId) throws GitLabApiException
Deletes a hook from the project.GitLab Endpoint: DELETE /projects/:id/hooks/:hook_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredhookId
- the project hook ID to delete- Throws:
GitLabApiException
- if any exception occurs
-
deleteHook
public void deleteHook(org.gitlab4j.api.models.ProjectHook hook) throws GitLabApiException
Deletes a hook from the project.GitLab Endpoint: DELETE /projects/:id/hooks/:hook_id
- Parameters:
hook
- the ProjectHook instance to remove- Throws:
GitLabApiException
- if any exception occurs
-
modifyHook
public org.gitlab4j.api.models.ProjectHook modifyHook(org.gitlab4j.api.models.ProjectHook hook) throws GitLabApiException
Modifies a hook for project.GitLab Endpoint: PUT /projects/:id/hooks/:hook_id
- Parameters:
hook
- the ProjectHook instance that contains the project hook info to modify- Returns:
- the modified project hook
- Throws:
GitLabApiException
- if any exception occurs
-
getIssues
@Deprecated public java.util.List<org.gitlab4j.api.models.Issue> getIssues(java.lang.Object projectIdOrPath) throws GitLabApiException
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssues(Object)
Get a list of the project's issues.GitLab Endpoint: GET /projects/:id/issues
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a list of project's issues
- Throws:
GitLabApiException
- if any exception occurs
-
getIssues
@Deprecated public java.util.List<org.gitlab4j.api.models.Issue> getIssues(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssues(Object, int, int)
Get a list of project's issues using the specified page and per page settings.GitLab Endpoint: GET /projects/:id/issues
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of issues per page- Returns:
- the list of issues in the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getIssues
@Deprecated public Pager<org.gitlab4j.api.models.Issue> getIssues(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssues(Object, int)
Get a Pager of project's issues.GitLab Endpoint: GET /projects/:id/issues
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requireditemsPerPage
- the number of issues per page- Returns:
- the list of issues in the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getIssuesStream
@Deprecated public java.util.stream.Stream<org.gitlab4j.api.models.Issue> getIssuesStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssues(Object)
Get a Stream of the project's issues.GitLab Endpoint: GET /projects/:id/issues
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Stream of the project's issues
- Throws:
GitLabApiException
- if any exception occurs
-
getIssue
@Deprecated public org.gitlab4j.api.models.Issue getIssue(java.lang.Object projectIdOrPath, java.lang.Long issueId) throws GitLabApiException
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.getIssue(Object, Long)
Get a single project issue.GitLab Endpoint: GET /projects/:id/issues/:issue_iid
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredissueId
- the internal ID of a project's issue- Returns:
- the specified Issue instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteIssue
@Deprecated public void deleteIssue(java.lang.Object projectIdOrPath, java.lang.Long issueId) throws GitLabApiException
Deprecated.Will be removed in version 6.0, replaced byIssuesApi.deleteIssue(Object, Long)
Delete a project issue.GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredissueId
- the internal ID of a project's issue- Throws:
GitLabApiException
- if any exception occurs
-
getSnippets
public java.util.List<org.gitlab4j.api.models.Snippet> getSnippets(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of the project snippets.GitLab Endpoint: GET /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a list of the project's snippets
- Throws:
GitLabApiException
- if any exception occurs
-
getSnippets
public java.util.List<org.gitlab4j.api.models.Snippet> getSnippets(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of project snippets.GitLab Endpoint: GET /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of snippets per page- Returns:
- a list of project's snippets for the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getSnippets
public Pager<org.gitlab4j.api.models.Snippet> getSnippets(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project's snippets.GitLab Endpoint: GET /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requireditemsPerPage
- the number of snippets per page- Returns:
- the Pager of snippets
- Throws:
GitLabApiException
- if any exception occurs
-
getSnippetsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Snippet> getSnippetsStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of the project snippets.GitLab Endpoint: GET /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Stream of the project's snippets
- Throws:
GitLabApiException
- if any exception occurs
-
getSnippet
public org.gitlab4j.api.models.Snippet getSnippet(java.lang.Object projectIdOrPath, java.lang.Long snippetId) throws GitLabApiException
Get a single of project snippet.GitLab Endpoint: GET /projects/:id/snippets/:snippet_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredsnippetId
- the ID of the project's snippet- Returns:
- the specified project Snippet
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalSnippet
public java.util.Optional<org.gitlab4j.api.models.Snippet> getOptionalSnippet(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
Get a single of project snippet as an Optional instance.GitLab Endpoint: GET /projects/:id/snippets/:snippet_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredsnippetId
- the ID of the project's snippet- Returns:
- the specified project Snippet as an Optional instance
-
createSnippet
public org.gitlab4j.api.models.Snippet createSnippet(java.lang.Object projectIdOrPath, java.lang.String title, java.lang.String filename, java.lang.String description, java.lang.String content, org.gitlab4j.api.models.Visibility visibility) throws GitLabApiException
Creates a new project snippet. The user must have permission to create new snippets.GitLab Endpoint: POST /projects/:id/snippets
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredtitle
- the title of a snippet, requiredfilename
- the name of a snippet file, requireddescription
- the description of a snippet, optionalcontent
- the content of a snippet, requiredvisibility
- the snippet's visibility, required- Returns:
- a Snippet instance with info on the created snippet
- Throws:
GitLabApiException
- if any exception occurs
-
updateSnippet
public org.gitlab4j.api.models.Snippet updateSnippet(java.lang.Object projectIdOrPath, java.lang.Long snippetId, java.lang.String title, java.lang.String filename, java.lang.String description, java.lang.String code, org.gitlab4j.api.models.Visibility visibility) throws GitLabApiException
Updates an existing project snippet. The user must have permission to change an existing snippet.GitLab Endpoint: PUT /projects/:id/snippets/:snippet_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredsnippetId
- the ID of a project's snippet, requiredtitle
- the title of a snippet, optionalfilename
- the name of a snippet file, optionaldescription
- the description of a snippet, optioptionalonalcode
- the content of a snippet, optionalvisibility
- the snippet's visibility, reqoptionaluired- Returns:
- a Snippet instance with info on the updated snippet
- Throws:
GitLabApiException
- if any exception occurs
-
deleteSnippet
public void deleteSnippet(java.lang.Object projectIdOrPath, java.lang.Long snippetId) throws GitLabApiException
- Throws:
GitLabApiException
-
getRawSnippetContent
public java.lang.String getRawSnippetContent(java.lang.Object projectIdOrPath, java.lang.Long snippetId) throws GitLabApiException
Get the raw project snippet as plain text.GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/raw
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredsnippetId
- the ID of the project's snippet- Returns:
- the raw project snippet plain text as an Optional instance
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalRawSnippetContent
public java.util.Optional<java.lang.String> getOptionalRawSnippetContent(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
Get the raw project snippet plain text as an Optional instance.GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/raw
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredsnippetId
- the ID of the project's snippet- Returns:
- the raw project snippet plain text as an Optional instance
-
shareProject
public void shareProject(java.lang.Object projectIdOrPath, java.lang.Long groupId, org.gitlab4j.api.models.AccessLevel accessLevel, java.util.Date expiresAt) throws GitLabApiException
Share a project with the specified group.GitLab Endpoint: POST /projects/:id/share
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredgroupId
- the ID of the group to share with, requiredaccessLevel
- the permissions level to grant the group, requiredexpiresAt
- the share expiration date, optional- Throws:
GitLabApiException
- if any exception occurs
-
unshareProject
public void unshareProject(java.lang.Object projectIdOrPath, java.lang.Long groupId) throws GitLabApiException
Unshare the project from the group.GitLab Endpoint: DELETE /projects/:id/share/:group_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredgroupId
- the ID of the group to unshare, required- Throws:
GitLabApiException
- if any exception occurs
-
archiveProject
public org.gitlab4j.api.models.Project archiveProject(java.lang.Object projectIdOrPath) throws GitLabApiException
Archive a projectGitLab Endpoint: POST /projects/:id/archive
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- the archived GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
unarchiveProject
public org.gitlab4j.api.models.Project unarchiveProject(java.lang.Object projectIdOrPath) throws GitLabApiException
Unarchive a projectGitLab Endpoint: POST /projects/:id/unarchive
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- the unarchived GitLab Project
- Throws:
GitLabApiException
- if any exception occurs
-
getUploadFiles
public java.util.List<org.gitlab4j.api.models.UploadedFile> getUploadFiles(java.lang.Object projectIdOrPath) throws GitLabApiException
Get all uploads of the project sorted by created_at in descending order. You must have at least the Maintainer role to use this endpoint.GitLab Endpoint: GET /groups/:id/uploads
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- list of uploaded files
- Throws:
GitLabApiException
- if any exception occurs
-
uploadFile
public org.gitlab4j.api.models.FileUpload uploadFile(java.lang.Object projectIdOrPath, java.io.File fileToUpload) throws GitLabApiException
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.GitLab Endpoint: POST /projects/:id/uploads
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredfileToUpload
- the File instance of the file to upload, required- Returns:
- a FileUpload instance with information on the just uploaded file
- Throws:
GitLabApiException
- if any exception occurs
-
uploadFile
public org.gitlab4j.api.models.FileUpload uploadFile(java.lang.Object projectIdOrPath, java.io.File fileToUpload, java.lang.String mediaType) throws GitLabApiException
Uploads a file to the specified project to be used in an issue or merge request description, or a comment.GitLab Endpoint: POST /projects/:id/uploads
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredfileToUpload
- the File instance of the file to upload, requiredmediaType
- unused; will be removed in the next major version- Returns:
- a FileUpload instance with information on the just uploaded file
- Throws:
GitLabApiException
- if any exception occurs
-
uploadFile
public org.gitlab4j.api.models.FileUpload uploadFile(java.lang.Object projectIdOrPath, java.io.InputStream inputStream, java.lang.String filename, java.lang.String mediaType) throws GitLabApiException
Uploads some data in anInputStream
to the specified project, to be used in an issue or merge request description, or a comment.GitLab Endpoint: POST /projects/:id/uploads
- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance, requiredinputStream
- the data to upload, requiredfilename
- The filename of the file to uploadmediaType
- unused; will be removed in the next major version- Returns:
- a FileUpload instance with information on the just uploaded file
- Throws:
GitLabApiException
- if any exception occurs
-
getPushRules
public org.gitlab4j.api.models.PushRules getPushRules(java.lang.Object projectIdOrPath) throws GitLabApiException
Get the project's push rules.GitLab Endpoint: GET /projects/:id/push_rule
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- the push rules for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
createPushRules
public org.gitlab4j.api.models.PushRules createPushRules(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.PushRules pushRule) throws GitLabApiException
Adds a push rule to a specified project.
The following properties on the PushRules instance are utilized in the creation of the push rule:GitLab Endpoint: POST /projects/:id/push_rule
denyDeleteTag (optional) - Deny deleting a tag memberCheck (optional) - Restrict commits by author (email) to existing GitLab users preventSecrets (optional) - GitLab will reject any files that are likely to contain secrets commitMessageRegex (optional) - All commit messages must match this, e.g. Fixed \d+\..* commitMessageNegativeRegex (optional) - No commit message is allowed to match this, e.g. ssh\:\/\/ branchNameRegex (optional) - All branch names must match this, e.g. `(feature authorEmailRegex (optional) - All commit author emails must match this, e.g. @my-company.com$ fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar maxFileSize (optional) - Maximum file size (MB) commitCommitterCheck (optional) - Users can only push commits to this repository that were committed with one of their own verified emails. rejectUnsignedCommits (optional) - Reject commit when it is not signed through GPG
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredpushRule
- the PushRule instance containing the push rule configuration to add- Returns:
- a PushRules instance with the newly created push rule info
- Throws:
GitLabApiException
- if any exception occurs
-
updatePushRules
public org.gitlab4j.api.models.PushRules updatePushRules(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.PushRules pushRule) throws GitLabApiException
Updates a push rule for the specified project.
The following properties on the PushRules instance are utilized when updating the push rule:GitLab Endpoint: PUT /projects/:id/push_rule/:push_rule_id
denyDeleteTag (optional) - Deny deleting a tag memberCheck (optional) - Restrict commits by author (email) to existing GitLab users preventSecrets (optional) - GitLab will reject any files that are likely to contain secrets commitMessageRegex (optional) - All commit messages must match this, e.g. Fixed \d+\..* commitMessageNegativeRegex (optional) - No commit message is allowed to match this, e.g. ssh\:\/\/ branchNameRegex (optional) - All branch names must match this, e.g. `(feature authorEmailRegex (optional) - All commit author emails must match this, e.g. @my-company.com$ fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar maxFileSize (optional) - Maximum file size (MB) commitCommitterCheck (optional) - Users can only push commits to this repository that were committed with one of their own verified emails. rejectUnsignedCommits (optional) - Reject commit when it is not signed through GPG
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredpushRule
- the PushRules instance containing the push rule configuration to update- Returns:
- a PushRules instance with the newly created push rule info
- Throws:
GitLabApiException
- if any exception occurs
-
deletePushRules
public void deletePushRules(java.lang.Object projectIdOrPath) throws GitLabApiException
Removes a push rule from a project. This is an idempotent method and can be called multiple times. Either the push rule is available or not.GitLab Endpoint: DELETE /projects/:id/push_rule
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Throws:
GitLabApiException
- if any exception occurs
-
getForks
public java.util.List<org.gitlab4j.api.models.Project> getForks(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of projects that were forked from the specified project.GitLab Endpoint: GET /projects/:id/forks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a List of forked projects
- Throws:
GitLabApiException
- if any exception occurs
-
getForks
public java.util.List<org.gitlab4j.api.models.Project> getForks(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of projects that were forked from the specified project and in the specified page range.GitLab Endpoint: GET /projects/:id/forks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of projects per page- Returns:
- a List of forked projects
- Throws:
GitLabApiException
- if any exception occurs
-
getForks
public Pager<org.gitlab4j.api.models.Project> getForks(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of projects that were forked from the specified project.GitLab Endpoint: GET /projects/:id/forks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requireditemsPerPage
- the number of Project instances that will be fetched per page- Returns:
- a Pager of projects
- Throws:
GitLabApiException
- if any exception occurs
-
getForksStream
public java.util.stream.Stream<org.gitlab4j.api.models.Project> getForksStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of projects that were forked from the specified project.GitLab Endpoint: GET /projects/:id/forks
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Stream of forked projects
- Throws:
GitLabApiException
- if any exception occurs
-
starProject
public org.gitlab4j.api.models.Project starProject(java.lang.Object projectIdOrPath) throws GitLabApiException
Star a project.GitLab Endpoint: POST /projects/:id/star
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a Project instance with the new project info
- Throws:
GitLabApiException
- if any exception occurs
-
unstarProject
public org.gitlab4j.api.models.Project unstarProject(java.lang.Object projectIdOrPath) throws GitLabApiException
Unstar a project.GitLab Endpoint: POST /projects/:id/unstar
- Parameters:
projectIdOrPath
- id, path of the project, or a Project instance holding the project ID or path- Returns:
- a Project instance with the new project info
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectLanguages
public java.util.Map<java.lang.String,java.lang.Float> getProjectLanguages(java.lang.Object projectIdOrPath) throws GitLabApiException
Get languages used in a project with percentage value.GitLab Endpoint: GET /projects/:id/languages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Map instance with the language as the key and the percentage as the value
- Throws:
GitLabApiException
- if any exception occurs- Since:
- GitLab 10.8
-
transferProject
public org.gitlab4j.api.models.Project transferProject(java.lang.Object projectIdOrPath, java.lang.String namespace) throws GitLabApiException
Transfer a project to a new namespace. This was added in GitLab 11.1GitLab Endpoint: PUT /projects/:id/transfer.
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requirednamespace
- the namespace to transfer the project to- Returns:
- the updated Project
- Throws:
GitLabApiException
- if any exception occurs
-
setProjectAvatar
public org.gitlab4j.api.models.Project setProjectAvatar(java.lang.Object projectIdOrPath, java.io.File avatarFile) throws GitLabApiException
Uploads and sets the project avatar for the specified project.GitLab Endpoint: PUT /projects/:id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredavatarFile
- the File instance of the avatar file to upload- Returns:
- the updated Project instance
- Throws:
GitLabApiException
- if any exception occurs
-
getAuditEvents
public java.util.List<org.gitlab4j.api.models.AuditEvent> getAuditEvents(java.lang.Object projectIdOrPath, java.util.Date created_after, java.util.Date created_before) throws GitLabApiException
Get a List of the project audit events viewable by Maintainer or an Owner of the group.GET /projects/:id/audit_events
- Parameters:
projectIdOrPath
- the project ID, path of the project, or a project instance holding the project ID or pathcreated_after
- Project audit events created on or after the given time.created_before
- Project audit events created on or before the given time.- Returns:
- a List of project Audit events
- Throws:
GitLabApiException
- if any exception occurs
-
getAuditEvents
public Pager<org.gitlab4j.api.models.AuditEvent> getAuditEvents(java.lang.Object projectIdOrPath, java.util.Date created_after, java.util.Date created_before, int itemsPerPage) throws GitLabApiException
Get a Pager of the group audit events viewable by Maintainer or an Owner of the group.GET /projects/:id/audit_events
- Parameters:
projectIdOrPath
- the project ID, path of the project, or a Project instance holding the project ID or pathcreated_after
- Project audit events created on or after the given time.created_before
- Project audit events created on or before the given time.itemsPerPage
- the number of Audit Event instances that will be fetched per page- Returns:
- a Pager of project Audit events
- Throws:
GitLabApiException
- if any exception occurs
-
getAuditEventsStream
public java.util.stream.Stream<org.gitlab4j.api.models.AuditEvent> getAuditEventsStream(java.lang.Object projectIdOrPath, java.util.Date created_after, java.util.Date created_before) throws GitLabApiException
Get a Stream of the group audit events viewable by Maintainer or an Owner of the group.GET /projects/:id/audit_events
- Parameters:
projectIdOrPath
- the project ID, path of the project, or a Project instance holding the project ID or pathcreated_after
- Project audit events created on or after the given time.created_before
- Project audit events created on or before the given time.- Returns:
- a Stream of project Audit events
- Throws:
GitLabApiException
- if any exception occurs
-
getAuditEvent
public org.gitlab4j.api.models.AuditEvent getAuditEvent(java.lang.Object projectIdOrPath, java.lang.Long auditEventId) throws GitLabApiException
Get a specific audit event of a project.GitLab Endpoint: GET /projects/:id/audit_events/:id_audit_event
- Parameters:
projectIdOrPath
- the project ID, path of the project, or a Project instance holding the project ID or pathauditEventId
- the auditEventId, required- Returns:
- the project Audit event
- Throws:
GitLabApiException
- if any exception occurs
-
getVariables
public java.util.List<org.gitlab4j.api.models.Variable> getVariables(java.lang.Object projectIdOrPath) throws GitLabApiException
Get list of a project's variables.GitLab Endpoint: GET /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a list of variables belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getVariables
public java.util.List<org.gitlab4j.api.models.Variable> getVariables(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of variables for the specified project in the specified page range.GitLab Endpoint: GET /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredpage
- the page to getperPage
- the number of Variable instances per page- Returns:
- a list of variables belonging to the specified project in the specified page range
- Throws:
GitLabApiException
- if any exception occurs
-
getVariables
public Pager<org.gitlab4j.api.models.Variable> getVariables(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of variables belonging to the specified project.GitLab Endpoint: GET /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requireditemsPerPage
- the number of Variable instances that will be fetched per page- Returns:
- a Pager of variables belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getVariablesStream
public java.util.stream.Stream<org.gitlab4j.api.models.Variable> getVariablesStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of variables belonging to the specified project.GitLab Endpoint: GET /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, required- Returns:
- a Stream of variables belonging to the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getVariable
public org.gitlab4j.api.models.Variable getVariable(java.lang.Object projectIdOrPath, java.lang.String key) throws GitLabApiException
Get the details of a project variable.GitLab Endpoint: GET /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, required- Returns:
- the Variable instance for the specified variable
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalVariable
public java.util.Optional<org.gitlab4j.api.models.Variable> getOptionalVariable(java.lang.Object projectIdOrPath, java.lang.String key)
Get the details of a variable as an Optional instance.GitLab Endpoint: GET /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, required- Returns:
- the Variable for the specified variable as an Optional instance
-
createVariable
public org.gitlab4j.api.models.Variable createVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, java.lang.Boolean isProtected) throws GitLabApiException
Create a new project variable.GitLab Endpoint: POST /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, requiredvalue
- the value for the variable, requiredisProtected
- whether the variable is protected, optional- Returns:
- a Variable instance with the newly created variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
createVariable
public org.gitlab4j.api.models.Variable createVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, java.lang.Boolean isProtected, java.lang.String environmentScope) throws GitLabApiException
Create a new project variable.NOTE: Setting the environmentScope is only available on GitLab EE.
GitLab Endpoint: POST /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, requiredvalue
- the value for the variable, requiredisProtected
- whether the variable is protected, optionalenvironmentScope
- the environment_scope of the variable, optional- Returns:
- a Variable instance with the newly created variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
createVariable
public org.gitlab4j.api.models.Variable createVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, org.gitlab4j.api.models.Variable.Type variableType, java.lang.Boolean isProtected, java.lang.Boolean isMasked) throws GitLabApiException
Create a new project variable.NOTE: Setting the environmentScope is only available on GitLab EE.
GitLab Endpoint: POST /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, requiredvalue
- the value for the variable, requiredvariableType
- the type of variable. Available types are: env_var (default) and fileisProtected
- whether the variable is protected, optionalisMasked
- whether the variable is masked, optional- Returns:
- a Variable instance with the newly created variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
createVariable
public org.gitlab4j.api.models.Variable createVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, org.gitlab4j.api.models.Variable.Type variableType, java.lang.Boolean isProtected, java.lang.Boolean isMasked, java.lang.String environmentScope) throws GitLabApiException
Create a new project variable.NOTE: Setting the environmentScope is only available on GitLab EE.
GitLab Endpoint: POST /projects/:id/variables
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, requiredvalue
- the value for the variable, requiredvariableType
- the type of variable. Available types are: env_var (default) and fileisProtected
- whether the variable is protected, optionalisMasked
- whether the variable is masked, optionalenvironmentScope
- the environment_scope of the variable, optional- Returns:
- a Variable instance with the newly created variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
updateVariable
public org.gitlab4j.api.models.Variable updateVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, java.lang.Boolean isProtected) throws GitLabApiException
Update a project variable.GitLab Endpoint: PUT /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, requiredvalue
- the value for the variable, requiredisProtected
- whether the variable is protected, optional- Returns:
- a Variable instance with the updated variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
updateVariable
public org.gitlab4j.api.models.Variable updateVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, java.lang.Boolean isProtected, java.lang.String environmentScope) throws GitLabApiException
Update a project variable.NOTE: Updating the environmentScope is only available on GitLab EE.
GitLab Endpoint: PUT /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, requiredvalue
- the value for the variable, requiredisProtected
- whether the variable is protected, optionalenvironmentScope
- the environment_scope of the variable, optional.- Returns:
- a Variable instance with the updated variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
updateVariable
public org.gitlab4j.api.models.Variable updateVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, org.gitlab4j.api.models.Variable.Type variableType, java.lang.Boolean isProtected, java.lang.Boolean masked) throws GitLabApiException
Update a project variable.NOTE: Updating the environmentScope is only available on GitLab EE.
GitLab Endpoint: PUT /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, requiredvalue
- the value for the variable, requiredvariableType
- the type of variable. Available types are: env_var (default) and fileisProtected
- whether the variable is protected, optionalmasked
- whether the variable is masked, optional- Returns:
- a Variable instance with the updated variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
updateVariable
public org.gitlab4j.api.models.Variable updateVariable(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value, org.gitlab4j.api.models.Variable.Type variableType, java.lang.Boolean isProtected, java.lang.Boolean masked, java.lang.String environmentScope) throws GitLabApiException
Update a project variable.NOTE: Updating the environmentScope is only available on GitLab EE.
GitLab Endpoint: PUT /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, requiredvalue
- the value for the variable, requiredvariableType
- the type of variable. Available types are: env_var (default) and fileisProtected
- whether the variable is protected, optionalmasked
- whether the variable is masked, optionalenvironmentScope
- the environment_scope of the variable, optional.- Returns:
- a Variable instance with the updated variable
- Throws:
GitLabApiException
- if any exception occurs during execution
-
deleteVariable
public void deleteVariable(java.lang.Object projectIdOrPath, java.lang.String key) throws GitLabApiException
Deletes a project variable.GitLab Endpoint: DELETE /projects/:id/variables/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key of an existing variable, required- Throws:
GitLabApiException
- if any exception occurs
-
getAccessRequests
public java.util.List<org.gitlab4j.api.models.AccessRequest> getAccessRequests(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a List of the project access requests viewable by the authenticated user.GitLab Endpoint: GET /projects/:id/access_requests
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a List of project AccessRequest instances accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getAccessRequests
public Pager<org.gitlab4j.api.models.AccessRequest> getAccessRequests(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of the project access requests viewable by the authenticated user.GitLab Endpoint: GET /projects/:id/access_requests
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of AccessRequest instances that will be fetched per page- Returns:
- a Pager of project AccessRequest instances accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getAccessRequestsStream
public java.util.stream.Stream<org.gitlab4j.api.models.AccessRequest> getAccessRequestsStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of the project access requests viewable by the authenticated user.GitLab Endpoint: GET /projects/:id/access_requests
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of project AccessRequest instances accessible by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
requestAccess
public org.gitlab4j.api.models.AccessRequest requestAccess(java.lang.Object projectIdOrPath) throws GitLabApiException
Requests access for the authenticated user to the specified project.GitLab Endpoint: POST /projects/:id/access_requests
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- the created AccessRequest instance
- Throws:
GitLabApiException
- if any exception occurs
-
approveAccessRequest
public org.gitlab4j.api.models.AccessRequest approveAccessRequest(java.lang.Object projectIdOrPath, java.lang.Long userId, org.gitlab4j.api.models.AccessLevel accessLevel) throws GitLabApiException
Approve access for the specified user to the specified project.GitLab Endpoint: PUT /projects/:id/access_requests/:user_id/approve
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID to approve access foraccessLevel
- the access level the user is approved for, if null will be developer (30)- Returns:
- the approved AccessRequest instance
- Throws:
GitLabApiException
- if any exception occurs
-
denyAccessRequest
public void denyAccessRequest(java.lang.Object projectIdOrPath, java.lang.Long userId) throws GitLabApiException
Deny access for the specified user to the specified project.GitLab Endpoint: DELETE /projects/:id/access_requests/:user_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceuserId
- the user ID to deny access for- Throws:
GitLabApiException
- if any exception occurs
-
triggerHousekeeping
public void triggerHousekeeping(java.lang.Object projectIdOrPath) throws GitLabApiException
Start the Housekeeping task for a project.GitLab Endpoint: POST /projects/:id/housekeeping
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Throws:
GitLabApiException
- if any exception occurs
-
getBadges
public java.util.List<org.gitlab4j.api.models.Badge> getBadges(java.lang.Object projectIdOrPath) throws GitLabApiException
Gets a list of a project’s badges and its group badges.GitLab Endpoint: GET /projects/:id/badges
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a List of Badge instances for the specified project
- Throws:
GitLabApiException
- if any exception occurs
-
getBadges
public java.util.List<org.gitlab4j.api.models.Badge> getBadges(java.lang.Object projectIdOrPath, java.lang.String bagdeName) throws GitLabApiException
Gets a list of a project’s badges and its group badges, case-sensitively filtered on bagdeName if non-null.GitLab Endpoint: GET /projects/:id/badges?name=:name
- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancebagdeName
- The name to filter on (case-sensitive), ignored if null.- Returns:
- All badges of the GitLab item, case insensitively filtered on name.
- Throws:
GitLabApiException
- If any problem is encountered
-
getBadge
public org.gitlab4j.api.models.Badge getBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId) throws GitLabApiException
Gets a badge of a project.GitLab Endpoint: GET /projects/:id/badges/:badge_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancebadgeId
- the ID of the badge to get- Returns:
- a Badge instance for the specified project/badge ID pair
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalBadge
public java.util.Optional<org.gitlab4j.api.models.Badge> getOptionalBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId)
Get an Optional instance with the value for the specified badge.GitLab Endpoint: GET /projects/:id/badges/:badge_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancebadgeId
- the ID of the badge to get- Returns:
- an Optional instance with the specified badge as the value
-
addBadge
public org.gitlab4j.api.models.Badge addBadge(java.lang.Object projectIdOrPath, java.lang.String linkUrl, java.lang.String imageUrl) throws GitLabApiException
Add a badge to a project.GitLab Endpoint: POST /projects/:id/badges
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancelinkUrl
- the URL of the badge linkimageUrl
- the URL of the image link- Returns:
- a Badge instance for the added badge
- Throws:
GitLabApiException
- if any exception occurs
-
addBadge
public org.gitlab4j.api.models.Badge addBadge(java.lang.Object projectIdOrPath, java.lang.String name, java.lang.String linkUrl, java.lang.String imageUrl) throws GitLabApiException
Add a badge to a project.GitLab Endpoint: POST /projects/:id/badges
- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancename
- The name to give the badge (may be null)linkUrl
- the URL of the badge linkimageUrl
- the URL of the image link- Returns:
- A Badge instance for the added badge
- Throws:
GitLabApiException
- if any exception occurs
-
editBadge
public org.gitlab4j.api.models.Badge editBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId, java.lang.String linkUrl, java.lang.String imageUrl) throws GitLabApiException
Edit a badge of a project.GitLab Endpoint: PUT /projects/:id/badges
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancebadgeId
- the ID of the badge to getlinkUrl
- the URL of the badge linkimageUrl
- the URL of the image link- Returns:
- a Badge instance for the editted badge
- Throws:
GitLabApiException
- if any exception occurs
-
editBadge
public org.gitlab4j.api.models.Badge editBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId, java.lang.String name, java.lang.String linkUrl, java.lang.String imageUrl) throws GitLabApiException
Edit a badge of a project.GitLab Endpoint: PUT /projects/:id/badges
- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancebadgeId
- the ID of the badge to editname
- The name of the badge to edit (may be null)linkUrl
- the URL of the badge linkimageUrl
- the URL of the image link- Returns:
- a Badge instance for the editted badge
- Throws:
GitLabApiException
- if any exception occurs
-
removeBadge
public void removeBadge(java.lang.Object projectIdOrPath, java.lang.Long badgeId) throws GitLabApiException
Remove a badge from a project.GitLab Endpoint: DELETE /projects/:id/badges/:badge_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancebadgeId
- the ID of the badge to remove- Throws:
GitLabApiException
- if any exception occurs
-
previewBadge
public org.gitlab4j.api.models.Badge previewBadge(java.lang.Object projectIdOrPath, java.lang.String linkUrl, java.lang.String imageUrl) throws GitLabApiException
Returns how the link_url and image_url final URLs would be after resolving the placeholder interpolation.GitLab Endpoint: GET /projects/:id/badges/render
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancelinkUrl
- the URL of the badge linkimageUrl
- the URL of the image link- Returns:
- a Badge instance for the rendered badge
- Throws:
GitLabApiException
- if any exception occurs
-
getApprovalsConfiguration
public org.gitlab4j.api.models.ProjectApprovalsConfig getApprovalsConfiguration(java.lang.Object projectIdOrPath) throws GitLabApiException
Get the project's approval information. Note: This API endpoint is only available on 10.6 Starter and above.GitLab Endpoint: GET /projects/:id/approvals
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a ProjectApprovalsConfig instance with the project's approvals configuration
- Throws:
GitLabApiException
- if any exception occurs
-
setApprovalsConfiguration
public org.gitlab4j.api.models.ProjectApprovalsConfig setApprovalsConfiguration(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ProjectApprovalsConfig config) throws GitLabApiException
Set the project's approvals configuration. Note: This API endpoint is only available on 10.6 Starter and above.GitLab Endpoint: POST /projects/:id/approvals
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceconfig
- a ProjectApprovalsConfig instance with the approval configuration- Returns:
- a ProjectApprovalsConfig instance with the project's approvals configuration
- Throws:
GitLabApiException
- if any exception occurs
-
getApprovalRules
public java.util.List<org.gitlab4j.api.models.ApprovalRule> getApprovalRules(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of the project-level approval rules. Note: This API endpoint is only available on 12.3 Starter and above.GitLab Endpoint: GET /projects/:id/approval_rules
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a List of ApprovalRuke instances for the specified project.
- Throws:
GitLabApiException
- if any exception occurs
-
getApprovalRules
public Pager<org.gitlab4j.api.models.ApprovalRule> getApprovalRules(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of the project-level approval rules. Note: This API endpoint is only available on 12.3 Starter and above.GitLab Endpoint: GET /projects/:id/approval_rules
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of ApprovalRule instances that will be fetched per page- Returns:
- a Pager of ApprovalRuke instances for the specified project.
- Throws:
GitLabApiException
- if any exception occurs
-
getApprovalRulesStream
public java.util.stream.Stream<org.gitlab4j.api.models.ApprovalRule> getApprovalRulesStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of the project-level approval rules. Note: This API endpoint is only available on 12.3 Starter and above.GitLab Endpoint: GET /projects/:id/approval_rules
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of ApprovalRule instances for the specified project.
- Throws:
GitLabApiException
- if any exception occurs
-
createApprovalRule
public org.gitlab4j.api.models.ApprovalRule createApprovalRule(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.ApprovalRuleParams params) throws GitLabApiException
Create a project-level approval rule. Note: This API endpoint is only available on 12.3 Starter and above.GitLab Endpoint: POST /projects/:id/approval_rules
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceparams
- the ApprovalRuleParams instance holding the parameters for the approval rule- Returns:
- a ApprovalRule instance with approval configuration
- Throws:
GitLabApiException
- if any exception occurs
-
updateApprovalRule
public org.gitlab4j.api.models.ApprovalRule updateApprovalRule(java.lang.Object projectIdOrPath, java.lang.Long approvalRuleId, org.gitlab4j.api.models.ApprovalRuleParams params) throws GitLabApiException
Update the specified the project-level approval rule. Note: This API endpoint is only available on 12.3 Starter and above.GitLab Endpoint: PUT /projects/:id/approval_rules/:approval_rule_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceapprovalRuleId
- the ID of the approval ruleparams
- the ApprovalRuleParams instance holding the parameters for the approval rule update- Returns:
- a ApprovalRule instance with approval configuration
- Throws:
GitLabApiException
- if any exception occurs
-
deleteApprovalRule
public void deleteApprovalRule(java.lang.Object projectIdOrPath, java.lang.Long approvalRuleId) throws GitLabApiException
Delete the specified the project-level approval rule. Note: This API endpoint is only available on 12.3 Starter and above.GitLab Endpoint: DELETE /projects/:id/approval_rules/:approval_rule_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceapprovalRuleId
- the ID of the approval rule- Throws:
GitLabApiException
- if any exception occurs
-
getCustomAttributes
public java.util.List<org.gitlab4j.api.models.CustomAttribute> getCustomAttributes(java.lang.Object projectIdOrPath) throws GitLabApiException
Get all custom attributes for the specified project.GitLab Endpoint: GET /projects/:id/custom_attributes
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a list of project's CustomAttributes
- Throws:
GitLabApiException
- if any exception occurs
-
getCustomAttributes
public Pager<org.gitlab4j.api.models.CustomAttribute> getCustomAttributes(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of custom attributes for the specified project.GitLab Endpoint: GET /projects/:id/custom_attributes
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of items per page- Returns:
- a Pager of project's custom attributes
- Throws:
GitLabApiException
- if any exception occurs
-
getCustomAttributesStream
public java.util.stream.Stream<org.gitlab4j.api.models.CustomAttribute> getCustomAttributesStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of all custom attributes for the specified project.GitLab Endpoint: GET /projects/:id/custom_attributes
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of project's custom attributes
- Throws:
GitLabApiException
- if any exception occurs
-
getCustomAttribute
public org.gitlab4j.api.models.CustomAttribute getCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key) throws GitLabApiException
Get a single custom attribute for the specified project.GitLab Endpoint: GET /projects/:id/custom_attributes/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancekey
- the key for the custom attribute- Returns:
- a CustomAttribute instance for the specified key
- Throws:
GitLabApiException
- if any exception occurs
-
geOptionalCustomAttribute
@Deprecated public java.util.Optional<org.gitlab4j.api.models.CustomAttribute> geOptionalCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key)
Deprecated.UsegetOptionalCustomAttribute(Object, String)
insteadGet an Optional instance with the value for a single custom attribute for the specified project.GitLab Endpoint: GET /projects/:id/custom_attributes/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key for the custom attribute, required- Returns:
- an Optional instance with the value for a single custom attribute for the specified project
-
getOptionalCustomAttribute
public java.util.Optional<org.gitlab4j.api.models.CustomAttribute> getOptionalCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key)
Get an Optional instance with the value for a single custom attribute for the specified project.GitLab Endpoint: GET /projects/:id/custom_attributes/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance, requiredkey
- the key for the custom attribute, required- Returns:
- an Optional instance with the value for a single custom attribute for the specified project
-
setCustomAttribute
public org.gitlab4j.api.models.CustomAttribute setCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key, java.lang.String value) throws GitLabApiException
Set a custom attribute for the specified project. The attribute will be updated if it already exists, or newly created otherwise.GitLab Endpoint: PUT /projects/:id/custom_attributes/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancekey
- the key for the custom attributevalue
- the value for the customAttribute- Returns:
- a CustomAttribute instance for the updated or created custom attribute
- Throws:
GitLabApiException
- if any exception occurs
-
deleteCustomAttribute
public void deleteCustomAttribute(java.lang.Object projectIdOrPath, java.lang.String key) throws GitLabApiException
Delete a custom attribute for the specified project.GitLab Endpoint: DELETE /projects/:id/custom_attributes/:key
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancekey
- the key of the custom attribute to delete- Throws:
GitLabApiException
- if any exception occurs
-
getRemoteMirrors
public java.util.List<org.gitlab4j.api.models.RemoteMirror> getRemoteMirrors(java.lang.Object projectIdOrPath) throws GitLabApiException
Get all remote mirrors and their statuses for the specified project.GitLab Endpoint: GET /projects/:id/remote_mirrors
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a list of project's remote mirrors
- Throws:
GitLabApiException
- if any exception occurs
-
getRemoteMirrors
public Pager<org.gitlab4j.api.models.RemoteMirror> getRemoteMirrors(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of remote mirrors and their statuses for the specified project.GitLab Endpoint: GET /projects/:id/remote_mirrors
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of items per page- Returns:
- a Pager of project's remote mirrors
- Throws:
GitLabApiException
- if any exception occurs
-
getRemoteMirrorsStream
public java.util.stream.Stream<org.gitlab4j.api.models.RemoteMirror> getRemoteMirrorsStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of all remote mirrors and their statuses for the specified project.GitLab Endpoint: GET /projects/:id/remote_mirrors
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of project's remote mirrors
- Throws:
GitLabApiException
- if any exception occurs
-
createRemoteMirror
public org.gitlab4j.api.models.RemoteMirror createRemoteMirror(java.lang.Object projectIdOrPath, java.lang.String url, java.lang.Boolean enabled, java.lang.Boolean onlyProtectedBranches, java.lang.Boolean keepDivergentRefs) throws GitLabApiException
Create a remote mirror for a project.GitLab Endpoint: POST /projects/:id/remote_mirrors
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceurl
- the URL of the remote repository to be mirroredenabled
- determines if the mirror is enabledonlyProtectedBranches
- determines if only protected branches are mirroredkeepDivergentRefs
- determines if divergent refs are skipped- Returns:
- a RemoteMirror instance with remote mirror configuration
- Throws:
GitLabApiException
- if any exception occurs
-
updateRemoteMirror
public org.gitlab4j.api.models.RemoteMirror updateRemoteMirror(java.lang.Object projectIdOrPath, java.lang.Long mirrorId, java.lang.Boolean enabled, java.lang.Boolean onlyProtectedBranches, java.lang.Boolean keepDivergentRefs) throws GitLabApiException
Toggle a remote mirror on or off, or change which types of branches are mirrored.GitLab Endpoint: PUT /projects/:id/remote_mirrors/:mirror_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancemirrorId
- the ID of the remote mirrorenabled
- determines if the mirror is enabledonlyProtectedBranches
- determines if only protected branches are mirroredkeepDivergentRefs
- determines if divergent refs are skipped- Returns:
- a RemoteMirror instance with the updated remote mirror configuration
- Throws:
GitLabApiException
- if any exception occurs
-
listProjectAccessTokens
public java.util.List<org.gitlab4j.api.models.ProjectAccessToken> listProjectAccessTokens(java.lang.Object projectIdOrPath) throws GitLabApiException
Lists the projects access tokens for the project.- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instance- Returns:
- the list of ProjectAccessTokens. The token and lastUsedAt attribute of each object is unset.
- Throws:
GitLabApiException
- if any exception occurs
-
getProjectAccessToken
public org.gitlab4j.api.models.ProjectAccessToken getProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.Long tokenId) throws GitLabApiException
Gets the specific project access token. Only working with GitLab 14.10 and above.- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancetokenId
- the id of the token- Returns:
- the ProjectAccessToken. The token attribute of the object is unset.
- Throws:
GitLabApiException
- if any exception occurs
-
createProjectAccessToken
public org.gitlab4j.api.models.ProjectAccessToken createProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.String name, java.util.List<org.gitlab4j.models.Constants.ProjectAccessTokenScope> scopes, java.util.Date expiresAt, java.lang.Long accessLevel) throws GitLabApiException
Creates a new project access token.- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancename
- the name of the tokenscopes
- the scope of the tokenexpiresAt
- the date when the token should expireaccessLevel
- The access level of the token is optional. It can either be 10, 20, 30, 40, or 50.- Returns:
- the newly created ProjectAccessToken. The lastUsedAt attribute of each object is unset.
- Throws:
GitLabApiException
- if any exception occurs
-
createProjectAccessToken
public org.gitlab4j.api.models.ProjectAccessToken createProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.String name, java.util.List<org.gitlab4j.models.Constants.ProjectAccessTokenScope> scopes, java.util.Date expiresAt) throws GitLabApiException
Creates a new project access token. The default value for the accessLevel is used.- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancename
- the name of the tokenscopes
- the scope of the tokenexpiresAt
- the date when the token should expire- Returns:
- the newly created ProjectAccessToken. The lastUsedAt attribute of each object is unset.
- Throws:
GitLabApiException
- if any exception occurs
-
rotateProjectAccessToken
public org.gitlab4j.api.models.ProjectAccessToken rotateProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.Long tokenId) throws GitLabApiException
Rotates the given project access token. The token is revoked and a new one which will expire in one week is created to replace it. Only working with GitLab 16.0 and above.- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancetokenId
- the id- Returns:
- the newly created ProjectAccessToken.
- Throws:
GitLabApiException
- if any exception occurs
-
rotateProjectAccessToken
public org.gitlab4j.api.models.ProjectAccessToken rotateProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.Long tokenId, java.util.Date expiresAt) throws GitLabApiException
Rotates the given project access token. The token is revoked and a new one which will expire in one week is created to replace it. Only working with GitLab 16.0 and above.- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancetokenId
- the idexpiresAt
- Expiration date of the access token- Returns:
- the newly created ProjectAccessToken.
- Throws:
GitLabApiException
- if any exception occurs
-
revokeProjectAccessToken
public void revokeProjectAccessToken(java.lang.Object projectIdOrPath, java.lang.Long tokenId) throws GitLabApiException
Revokes the project access token.- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancetokenId
- the id of the token, which should be revoked- Throws:
GitLabApiException
- if any exception occurs
-
listProjectIterations
public java.util.List<org.gitlab4j.api.models.Iteration> listProjectIterations(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.IterationFilter filter) throws GitLabApiException
Lists project iterations.GitLab Endpoint: GET /projects/:id/iterations
- Parameters:
projectIdOrPath
- the project in the form of a Long(ID), String(path), or Project instancefilter
- the iteration filter- Returns:
- the list of project iterations
- Throws:
GitLabApiException
- if any exception occurs
-
-