Class FeedManagementApi

java.lang.Object
org.azd.utils.AzDAsyncApi<FeedManagementApi>
org.azd.feedmanagement.FeedManagementApi
All Implemented Interfaces:
FeedManagementDetails

public class FeedManagementApi extends AzDAsyncApi<FeedManagementApi> implements FeedManagementDetails
Feed Management class to manage Artifacts API
  • Constructor Details

    • FeedManagementApi

      public FeedManagementApi(Connection connection)
      Pass the connection object to work with Feed Management Api
      Parameters:
      connection - Connection object
  • Method Details

    • createFeed

      public Feed createFeed(String name, String description, boolean badgesEnabled, boolean hideDeletedPackageVersions) throws AzDException
      Create a feed, a container for various package types.

      Feeds can be created in a project if the project parameter is included when instantiating the class. This can be done by injecting the instance of AzDDefaultParameters with project name. If the project parameter is omitted, the feed will not be associated with a project and will be created at the organization level.

      Specified by:
      createFeed in interface FeedManagementDetails
      Parameters:
      name - Provide the name of the feed
      description - Provide the description for the feed
      badgesEnabled - Enable or disable the badge in the feed. Default to false.
      hideDeletedPackageVersions - Hides the deleted package version. Default to true.
      Returns:
      Feed object Feed
      Throws:
      AzDException - Default Api Exception handler.
    • createFeedView

      public FeedView createFeedView(String feedName, String name, FeedViewType feedViewType, FeedVisibility visibility) throws AzDException
      Create a new view on the referenced feed.

      The project parameter must be supplied if the feed was created in a project.

      Specified by:
      createFeedView in interface FeedManagementDetails
      Parameters:
      feedName - provide the name or id of the feed
      name - name of the feed view
      feedViewType - type of the feed view. Allowed values are [implicit and release]
      visibility - visibility of the view. Allowed values are [aadTenant, collection, organization, private]
      Returns:
      Feed view object FeedView
      Throws:
      AzDException - Default Api Exception handler.
    • deleteFeed

      public Void deleteFeed(String feedId) throws AzDException
      Remove a feed and all its packages. The feed moves to the recycle bin and is reversible.

      The project parameter must be supplied if the feed was created in a project. If the feed is not associated with any project, omit the project parameter from the request.

      Specified by:
      deleteFeed in interface FeedManagementDetails
      Parameters:
      feedId - Name or Id of the feed.
      Throws:
      AzDException - Default Api Exception handler.
    • deleteFeedView

      public Void deleteFeedView(String feedId, String feedViewId) throws AzDException
      Delete a feed view.

      The project parameter must be supplied if the feed was created in a project.

      Specified by:
      deleteFeedView in interface FeedManagementDetails
      Parameters:
      feedId - Name or Id of the feed
      feedViewId - Id of the feed view
      Throws:
      AzDException - Default Api Exception handler.
    • getFeed

      public Feed getFeed(String feedName) throws AzDException
      Get the settings for a specific feed.

      The project parameter must be supplied if the feed was created in a project. If the feed is not associated with any project, omit the project parameter from the request.

      Specified by:
      getFeed in interface FeedManagementDetails
      Parameters:
      feedName - Name of id of the feed
      Returns:
      Feed Feed
      Throws:
      AzDException - Default Api Exception handler.
    • getFeed

      public Feed getFeed(String feedName, boolean includeDeletedUpstreams) throws AzDException
      Get the settings for a specific feed.

      The project parameter must be supplied if the feed was created in a project. If the feed is not associated with any project, omit the project parameter from the request.

      Specified by:
      getFeed in interface FeedManagementDetails
      Parameters:
      feedName - Name of id of the feed
      includeDeletedUpstreams - Include upstreams that have been deleted in the response.
      Returns:
      Feed Feed
      Throws:
      AzDException - Default Api Exception handler.
    • getFeedPermissions

      public FeedPermissions getFeedPermissions(String feedName) throws AzDException
      Get the permissions for a feed.

      The project parameter must be supplied if the feed was created in a project. If the feed is not associated with any project, omit the project parameter from the request.

      Specified by:
      getFeedPermissions in interface FeedManagementDetails
      Parameters:
      feedName - Name or Id of the feed.
      Returns:
      Feed Permissions FeedPermissions
      Throws:
      AzDException - Default Api Exception handler.
    • getFeedPermissions

      public FeedPermissions getFeedPermissions(String feedName, boolean excludeInheritedPermissions, String identityDescriptor, boolean includeDeletedFeeds, boolean includeIds) throws AzDException
      Get the permissions for a feed.

      The project parameter must be supplied if the feed was created in a project. If the feed is not associated with any project, omit the project parameter from the request.

      Specified by:
      getFeedPermissions in interface FeedManagementDetails
      Parameters:
      feedName - Name or Id of the feed.
      excludeInheritedPermissions - True to only return explicitly set permissions on the feed. Default is false.
      identityDescriptor - Filter permissions to the provided identity.
      includeDeletedFeeds - If includeDeletedFeeds is true, then feedId must be specified by name and not by Guid.
      includeIds - True to include user Ids in the response. Default is false.
      Returns:
      Feed Permissions FeedPermissions
      Throws:
      AzDException - Default Api Exception handler.
    • getFeedView

      public FeedView getFeedView(String feedName, String feedViewId) throws AzDException
      Get a view by Id.

      The project parameter must be supplied if the feed was created in a project.

      Specified by:
      getFeedView in interface FeedManagementDetails
      Parameters:
      feedName - Name or Id of the feed.
      feedViewId - Name or Id of the view.
      Returns:
      feed view FeedView
      Throws:
      AzDException - Default Api Exception handler.
    • getFeedViews

      public FeedViews getFeedViews(String feedName) throws AzDException
      Get all views for a feed.

      The project parameter must be supplied if the feed was created in a project.

      Specified by:
      getFeedViews in interface FeedManagementDetails
      Parameters:
      feedName - Name or Id of the feed.
      Returns:
      array feed views FeedView
      Throws:
      AzDException - Default Api Exception handler.
    • getFeeds

      public Feeds getFeeds() throws AzDException
      Get all feeds in an account where you have the provided role access.

      If the project parameter is present, gets all feeds in the given project. If omitted, gets all feeds in the organization.

      Specified by:
      getFeeds in interface FeedManagementDetails
      Returns:
      array of feeds Feeds
      Throws:
      AzDException - Default Api Exception handler.
    • getFeeds

      public Feeds getFeeds(FeedRole feedRole, boolean includeDeletedUpstreams, boolean includeUrls) throws AzDException
      Get all feeds in an account where you have the provided role access.

      If the project parameter is present, gets all feeds in the given project. If omitted, gets all feeds in the organization.

      Specified by:
      getFeeds in interface FeedManagementDetails
      Parameters:
      feedRole - Filter by this role, either Administrator(4), Contributor(3), or Reader(2) level permissions.
      includeDeletedUpstreams - Include upstreams that have been deleted in the response.
      includeUrls - Resolve names if true
      Returns:
      array of feeds Feeds
      Throws:
      AzDException - Default Api Exception handler.
    • setFeedPermissions

      public FeedPermissions setFeedPermissions(String feedId, FeedPermissions feedPermissions) throws AzDException
      Update the permissions on a feed.

      The project parameter must be supplied if the feed was created in a project. If the feed is not associated with any project, omit the project parameter from the request.

      Specified by:
      setFeedPermissions in interface FeedManagementDetails
      Parameters:
      feedPermissions - List of feed permissions to update the permissions for.
      Returns:
      array of feed permissions FeedPermissions
      Throws:
      AzDException - Default Api Exception handler.
    • updateFeed

      public Feed updateFeed(String feedId, Feed feed) throws AzDException
      Change the attributes of a feed.

      The project parameter must be supplied if the feed was created in a project. If the feed is not associated with any project, omit the project parameter from the request.

      Specified by:
      updateFeed in interface FeedManagementDetails
      Parameters:
      feedId - Name or Id of the feed.
      feed - Feed object to update the settings for
      Returns:
      feed Feed
      Throws:
      AzDException - Default Api Exception handler.
    • updateFeedView

      public FeedView updateFeedView(String feedName, String feedViewName, FeedView feedView) throws AzDException
      Update a view.

      The project parameter must be supplied if the feed was created in a project.

      Specified by:
      updateFeedView in interface FeedManagementDetails
      Parameters:
      feedName - Name or Id of the feed.
      feedViewName - Name or Id of the view.
      feedView - Feed view object to update the settings for.
      Returns:
      the updated feed view FeedView
      Throws:
      AzDException - Default Api Exception handler.