com.samsung.android.penup

Class CollectionApi

  • java.lang.Object
    • com.samsung.android.penup.CollectionApi


  • public class CollectionApi
    extends java.lang.Object
    This class sends requests related to collection information.
    Since:
    PEN.UP 1.0
    • Method Detail

      • getCollection

        public static void getCollection(PenupClient penupClient,
                         java.lang.String collectionId,
                         ResourceCallback<CollectionResource> resourceCallback)
        Gets the collection with the specified ID.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        collectionId - The collection ID
        resourceCallback - The ResourceCallback instance for receiving the collection
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The collectionId is null or empty.
        • The resourceListCallback is null.
        Since:
        PEN.UP 1.0
      • getMyCollections

        public static void getMyCollections(PenupClient penupClient,
                            int maxResults,
                            java.lang.String pageToken,
                            ResourceListCallback<CollectionResource> resourceListCallback)
        Gets user's collections.
        The Scope.READ_MY_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        maxResults - The maximum number of collections to include in the response, which is used for paging.
        The value should be between 1 and 100.
        pageToken - The page token obtained from ResourceListCallback for getting the specific page.
        Sets null to get the first page.
        resourceListCallback - The ResourceListCallback instance for receiving the user's collections
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The maxResults is less than 1 or greater than 100.
        • The resourceListCallback is null.
        Since:
        PEN.UP 1.0
      • getMyFollowingCollections

        public static void getMyFollowingCollections(PenupClient penupClient,
                                     int maxResults,
                                     java.lang.String pageToken,
                                     ResourceListCallback<CollectionResource> resourceListCallback)
        Gets collections that the user follows.
        The Scope.READ_MY_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        maxResults - The maximum number of collections to include in the response, which is used for paging.
        The value should be between 1 and 100.
        pageToken - The page token obtained from ResourceListCallback for getting the specific page.
        Sets null to get the first page.
        resourceListCallback - The ResourceListCallback instance for receiving the collections that the user follows.
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The maxResults is less than 1 or greater than 100.
        • The resourceListCallback is null.
        Since:
        PEN.UP 1.0
      • addCollection

        public static void addCollection(PenupClient penupClient,
                         java.lang.String collectionName,
                         ResourceCallback<CollectionResource> resourceCallback)
        Adds the specified collection.
        The Scope.POST_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        collectionName - The collection name.
        The length of the collection name must be within 25 characters.
        resourceCallback - The ResourceCallback instance
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The collectionName is null or empty.
        • The length of collectionName is greater than 25.
        • The resourceCallback is null.
        Since:
        PEN.UP 1.0