public class WikisApi extends AbstractApi
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.Encoding, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.StateEvent, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
gitLabApi
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Modifier and Type | Method and Description |
---|---|
WikiPage |
createPage(Object projectIdOrPath,
String title,
String content)
Creates a new project wiki page.
|
void |
deletePage(Object projectIdOrPath,
String slug)
Deletes an existing project wiki page.
|
Optional<WikiPage> |
getOptionalPage(Object projectIdOrPath,
String slug)
Get a single page of project wiki as an Optional instance.
|
WikiPage |
getPage(Object projectIdOrPath,
String slug)
Get a single page of project wiki.
|
List<WikiPage> |
getPages(Object projectIdOrPath)
Get a list of pages in project wiki.
|
List<WikiPage> |
getPages(Object projectIdOrPath,
int page,
int perPage)
Get a list of pages in project wiki for the specified page.
|
WikiPage |
updatePage(Object projectIdOrPath,
String slug,
String title,
String content)
Updates an existing project wiki page.
|
WikiAttachment |
uploadAttachment(Object projectIdOrPath,
File fileToUpload)
Uploads a file to the attachment folder inside the wiki’s repository.
|
WikiAttachment |
uploadAttachment(Object projectIdOrPath,
File fileToUpload,
String branch)
Uploads a file to the attachment folder inside the wiki’s repository.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
public WikisApi(GitLabApi gitLabApi)
public List<WikiPage> getPages(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/wikis
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic List<WikiPage> getPages(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/wikis
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of wiki-pages per pageGitLabApiException
- if any exception occurspublic WikiPage getPage(Object projectIdOrPath, String slug) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/wikis/:slug
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceslug
- the slug of the project's wiki pageGitLabApiException
- if any exception occurspublic Optional<WikiPage> getOptionalPage(Object projectIdOrPath, String slug)
GitLab Endpoint: GET /projects/:id/wikis/:slug
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceslug
- the slug of the project's wiki pagepublic WikiPage createPage(Object projectIdOrPath, String title, String content) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/wikis
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancetitle
- the title of a snippet, requiredcontent
- the content of a wiki page, requiredGitLabApiException
- if any exception occurspublic WikiPage updatePage(Object projectIdOrPath, String slug, String title, String content) throws GitLabApiException
GitLab Endpoint: PUT /projects/:id/wikis/:slug
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceslug
- the slug of the project's wiki page, requiredtitle
- the title of a snippet, optionalcontent
- the content of a page, optional. Either title or content must be supplied.GitLabApiException
- if any exception occurspublic void deletePage(Object projectIdOrPath, String slug) throws GitLabApiException
GitLab Endpoint: DELETE /projects/:id/wikis/:slug
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceslug
- the slug of the project's wiki pageGitLabApiException
- if any exception occurspublic WikiAttachment uploadAttachment(Object projectIdOrPath, File fileToUpload) throws GitLabApiException
POST /projects/:id/wikis/attachments
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, requiredfileToUpload
- the File instance of the file to upload, requiredGitLabApiException
- if any exception occurspublic WikiAttachment uploadAttachment(Object projectIdOrPath, File fileToUpload, String branch) throws GitLabApiException
POST /projects/:id/wikis/attachments
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, requiredfileToUpload
- the File instance of the file to upload, requiredbranch
- the name of the branch, defaults to the wiki repository default branch, optionalGitLabApiException
- if any exception occursCopyright © 2019. All rights reserved.