Package org.azd.wiki

Class WikiApi

All Implemented Interfaces:
WikiDetails

public class WikiApi extends AzDAsyncApi<WikiApi> implements WikiDetails
Wiki class to manage Wiki API
  • Constructor Details

    • WikiApi

      public WikiApi(Connection connection)
      Pass the connection object to work with Work Api
      Parameters:
      connection - Connection object
  • Method Details

    • createWiki

      public WikiV2 createWiki(WikiCreateParameters wikiCreateParameters) throws AzDException
      Creates the wiki resource.
      Specified by:
      createWiki in interface WikiDetails
      Parameters:
      wikiCreateParameters - WikiCreateParameters helps to create code wiki and project wiki. Use the constructor parameter to create respective wikis.
      Returns:
      WikiV2 object WikiV2
      Throws:
      AzDException - Default Api Exception handler.
    • deleteWiki

      public WikiV2 deleteWiki(String wikiIdentifier) throws AzDException
      Deletes the wiki corresponding to the wiki ID or wiki name provided.
      Specified by:
      deleteWiki in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      Returns:
      WikiV2 WikiV2
      Throws:
      AzDException - Default Api Exception handler.
    • getWiki

      public WikiV2 getWiki(String wikiIdentifier) throws AzDException
      Gets the wiki corresponding to the wiki ID or wiki name provided.
      Specified by:
      getWiki in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      Returns:
      WikiV2 WikiV2
      Throws:
      AzDException - Default Api Exception handler.
    • getWikis

      public WikiV2Pages getWikis() throws AzDException
      Gets all wikis in a project or collection.
      Specified by:
      getWikis in interface WikiDetails
      Returns:
      WikiV2s WikiV2Pages
      Throws:
      AzDException - Default Api Exception handler.
    • createWikiAttachment

      public WikiAttachment createWikiAttachment(String wikiIdentifier, String name, InputStream content) throws AzDException
      Creates an attachment in the wiki.
      Specified by:
      createWikiAttachment in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      name - Wiki attachment name.
      Returns:
      WikiAttachment Object WikiAttachment
      Throws:
      AzDException - Default Api Exception handler.
    • createWikiAttachment

      public WikiAttachment createWikiAttachment(String wikiIdentifier, String name, String version, GitVersionType versionType, GitVersionOptions versionOptions, InputStream content) throws AzDException
      Creates an attachment in the wiki.
      Specified by:
      createWikiAttachment in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      name - Wiki attachment name.
      version - Version string identifier (name of tag/branch, SHA1 of commit)
      versionType - Version type (branch, tag, or commit). Determines how Id is interpreted
      versionOptions - Version options - Specify additional modifiers to version (e.g Previous)
      Returns:
      WikiAttachment Object WikiAttachment
      Throws:
      AzDException - Default Api Exception handler.
    • createPageMove

      public WikiPageMove createPageMove(String wikiIdentifier, String comment, WikiPageMoveParameters pageMoveParameters) throws AzDException
      Creates a page move operation that updates the path and order of the page as provided in the parameters.
      Specified by:
      createPageMove in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      comment - Comment that is to be associated with this page move.
      Returns:
      WikiPageMove Object WikiPageMove
      Throws:
      AzDException - Default Api Exception handler.
    • createPageMove

      public WikiPageMove createPageMove(String wikiIdentifier, String comment, String version, GitVersionType versionType, GitVersionOptions versionOptions, WikiPageMoveParameters pageMoveParameters) throws AzDException
      Creates a page move operation that updates the path and order of the page as provided in the parameters.
      Specified by:
      createPageMove in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      comment - Comment that is to be associated with this page move.
      version - Version string identifier (name of tag/branch, SHA1 of commit)
      versionType - Version type (branch, tag, or commit). Determines how Id is interpreted
      versionOptions - Version options - Specify additional modifiers to version (e.g Previous)
      Returns:
      WikiPageMove Object WikiPageMove
      Throws:
      AzDException - Default Api Exception handler.
    • getPageStats

      public WikiPageDetail getPageStats(String wikiIdentifier, int pageId, int pageViewsForDays) throws AzDException
      Returns page detail corresponding to Page ID.
      Specified by:
      getPageStats in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      pageId - Wiki page ID.
      Returns:
      WikiPageDetail Object WikiPageDetail
      Throws:
      AzDException - Default Api Exception handler.
    • createOrUpdateWikiPage

      public WikiPage createOrUpdateWikiPage(String wikiIdentifier, String path, String comment, String eTagVersion, String content) throws AzDException
      Creates or edits a wiki page.
      Specified by:
      createOrUpdateWikiPage in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      path - Wiki page path.
      comment - Comment to be associated with the page operation.
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • createOrUpdateWikiPage

      public WikiPage createOrUpdateWikiPage(String wikiIdentifier, String path, String comment, String eTagVersion, String version, GitVersionType versionType, GitVersionOptions versionOptions, String content) throws AzDException
      Creates or edits a wiki page.
      Specified by:
      createOrUpdateWikiPage in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      path - Wiki page path.
      comment - Comment to be associated with the page operation.
      version - Version string identifier (name of tag/branch, SHA1 of commit)
      versionType - Version type (branch, tag, or commit). Determines how Id is interpreted
      versionOptions - Version options - Specify additional modifiers to version (e.g Previous)
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • deleteWikiPage

      public WikiPage deleteWikiPage(String wikiIdentifier, String path, String comment) throws AzDException
      Deletes a wiki page.
      Specified by:
      deleteWikiPage in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      path - Wiki page path.
      comment - Comment to be associated with this page delete.
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • deleteWikiPage

      public WikiPage deleteWikiPage(String wikiIdentifier, String path, String comment, String version, GitVersionType versionType, GitVersionOptions versionOptions) throws AzDException
      Deletes a wiki page.
      Specified by:
      deleteWikiPage in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      path - Wiki page path.
      comment - Comment to be associated with this page delete.
      version - Version string identifier (name of tag/branch, SHA1 of commit)
      versionType - Version type (branch, tag, or commit). Determines how Id is interpreted
      versionOptions - Version options - Specify additional modifiers to version (e.g Previous)
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • deleteWikiPageById

      public WikiPage deleteWikiPageById(String id, String wikiIdentifier, String path, String comment, String version, GitVersionType versionType, GitVersionOptions versionOptions) throws AzDException
      Deletes a wiki page.
      Specified by:
      deleteWikiPageById in interface WikiDetails
      Parameters:
      id - Wiki page ID.
      wikiIdentifier - Wiki ID or wiki name.
      comment - Comment to be associated with this page delete.
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • getWikiPage

      public WikiPage getWikiPage(String wikiIdentifier) throws AzDException
      Gets metadata of the wiki page for the provided path.
      Specified by:
      getWikiPage in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • getWikiPage

      public WikiPage getWikiPage(String wikiIdentifier, boolean includeContent, String path, VersionControlRecursionType recursionLevel, String comment, String version, GitVersionType versionType, GitVersionOptions versionOptions) throws AzDException
      Gets metadata of the wiki page for the provided path.
      Specified by:
      getWikiPage in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional)
      path - Wiki page path.
      recursionLevel - Recursion level for subpages retrieval. Defaults to None (Optional).
      version - Version string identifier (name of tag/branch, SHA1 of commit)
      versionType - Version type (branch, tag, or commit). Determines how Id is interpreted
      versionOptions - Version options - Specify additional modifiers to version (e.g Previous)
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • getWikiPage

      public WikiPage getWikiPage(String wikiIdentifier, boolean includeContent, String path, VersionControlRecursionType recursionLevel) throws AzDException
      Gets metadata of the wiki page for the provided path.
      Specified by:
      getWikiPage in interface WikiDetails
      Parameters:
      wikiIdentifier - Wiki ID or wiki name.
      includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional)
      path - Wiki page path.
      recursionLevel - Recursion level for subpages retrieval. Defaults to None (Optional).
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • getWikiPageById

      public WikiPage getWikiPageById(String id, String wikiIdentifier) throws AzDException
      Gets metadata of the wiki page for the provided page id.
      Specified by:
      getWikiPageById in interface WikiDetails
      Parameters:
      id - Wiki page ID.
      wikiIdentifier - Wiki ID or wiki name..
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • getWikiPageById

      public WikiPage getWikiPageById(String id, String wikiIdentifier, boolean includeContent, VersionControlRecursionType recursionLevel) throws AzDException
      Gets metadata of the wiki page for the provided page id.
      Specified by:
      getWikiPageById in interface WikiDetails
      Parameters:
      id - Wiki page ID.
      wikiIdentifier - Wiki ID or wiki name..
      includeContent - True to include the content of the page in the response for Json content type. Defaults to false (Optional)
      recursionLevel - Recursion level for subpages retrieval. Defaults to None (Optional).
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • getWikiPageContent

      public String getWikiPageContent(String id, String wikiIdentifier) throws AzDException
      Gets content of the wiki page for the provided page id.
      Specified by:
      getWikiPageContent in interface WikiDetails
      Parameters:
      id - Wiki page ID.
      wikiIdentifier - Wiki ID or wiki name..
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • getWikiPageAsZip

      public InputStream getWikiPageAsZip(String id, String wikiIdentifier) throws AzDException
      Gets content of the wiki page as zip file for the provided page id.
      Specified by:
      getWikiPageAsZip in interface WikiDetails
      Parameters:
      id - Wiki page ID.
      wikiIdentifier - Wiki ID or wiki name..
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.
    • updateWikiPage

      public WikiPage updateWikiPage(String id, String wikiIdentifier, String comment, String eTagVersion, String content) throws AzDException
      Edits a wiki page.
      Specified by:
      updateWikiPage in interface WikiDetails
      Parameters:
      id - Wiki page ID.
      wikiIdentifier - Wiki ID or wiki name.
      comment - Comment to be associated with the page operation.
      Returns:
      WikiPage Object WikiPage
      Throws:
      AzDException - Default Api Exception handler.