com.samsung.android.penup

Class ArtworkApi

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


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

      • getArtwork

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

        public static void getArtworksByApp(PenupClient penupClient,
                            int maxResults,
                            java.lang.String pageToken,
                            ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets artworks posted via your application.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        maxResults - The maximum number of artworks 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 artworks posted via your application
        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 resourceCallback is null.
        Since:
        PEN.UP 1.0
      • getArtworksByArtist

        public static void getArtworksByArtist(PenupClient penupClient,
                               java.lang.String artistId,
                               int maxResults,
                               java.lang.String pageToken,
                               ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets artworks that the specified artist has posted or reposted.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        artistId - The artist ID
        maxResults - The maximum number of artworks 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 artworks that the specified artist has posted or reposted
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The artistId is null or empty.
        • The maxResults is less than 1 or greater than 100.
        • The resourceCallback is null.
        Since:
        PEN.UP 1.0
      • getArtworksByCollection

        public static void getArtworksByCollection(PenupClient penupClient,
                                   java.lang.String collectionId,
                                   int maxResults,
                                   java.lang.String pageToken,
                                   ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets artworks included in the specified collection.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        collectionId - The collection ID
        maxResults - The maximum number of artworks 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 artworks included in the specified 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 maxResults is less than 1 or greater than 100.
        • The resourceListCallback is null.
        Since:
        PEN.UP 1.0
      • getArtworksByTag

        public static void getArtworksByTag(PenupClient penupClient,
                            java.lang.String tagId,
                            int maxResults,
                            java.lang.String pageToken,
                            ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets artworks included in the specified tag.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        tagId - The tag ID
        maxResults - The maximum number of artworks 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 artworks included in the specified tag
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The tagId is null or empty.
        • The maxResults is less than 1 or greater than 100.
        • The resourceListCallback is null.
        Since:
        PEN.UP 1.0
      • getAllArtworks

        public static void getAllArtworks(PenupClient penupClient,
                          int maxResults,
                          java.lang.String pageToken,
                          ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets all artworks of PEN.UP.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        maxResults - The maximum number of artworks 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 all artworks
        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
      • getMyArtworks

        public static void getMyArtworks(PenupClient penupClient,
                         int maxResults,
                         java.lang.String pageToken,
                         ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets artworks that the user has posted or reposted.
        The Scope.READ_MY_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        maxResults - The maximum number of artworks 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 artworks that the user has posted or reposted
        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
      • getMyPosts

        public static void getMyPosts(PenupClient penupClient,
                      int maxResults,
                      java.lang.String pageToken,
                      ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets artworks that the user has posted.
        The Scope.READ_MY_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        maxResults - The maximum number of artworks 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 artworks that the user has posted
        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
      • getMyReposts

        public static void getMyReposts(PenupClient penupClient,
                        int maxResults,
                        java.lang.String pageToken,
                        ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets artworks that the user has reposted.
        The Scope.READ_MY_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        maxResults - The maximum number of artworks 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 artworks that the user has reposted
        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
      • getMyFeed

        public static void getMyFeed(PenupClient penupClient,
                     int maxResults,
                     java.lang.String pageToken,
                     ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets the user's feed.
        The Scope.READ_MY_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        maxResults - The maximum number of artworks 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 feed
        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
      • getPopularArtworks

        public static void getPopularArtworks(PenupClient penupClient,
                              Period period,
                              int maxResults,
                              java.lang.String pageToken,
                              ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets popular artworks.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        period - The period for popularities of artworks.
        MONTH and WEEK means the latest month and week.
        maxResults - The maximum number of artworks 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 popular artworks
        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
      • getPopularArtworksByApp

        public static void getPopularArtworksByApp(PenupClient penupClient,
                                   Period period,
                                   int maxResults,
                                   java.lang.String pageToken,
                                   ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets popular artworks posted via your application.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        period - The period for popularities of artworks.
        MONTH and WEEK means the latest month and week.
        maxResults - The maximum number of artworks 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 artworks posted via your application
        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 resourceCallback is null.
        Since:
        PEN.UP 1.0
      • getPopularArtworksByTag

        public static void getPopularArtworksByTag(PenupClient penupClient,
                                   java.lang.String tagId,
                                   Period period,
                                   int maxResults,
                                   java.lang.String pageToken,
                                   ResourceListCallback<ArtworkResource> resourceListCallback)
        Gets popular artworks by the specified tag.
        The Scope.READ_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        tagId - The tag ID
        period - The period for popularities of artworks.
        MONTH and WEEK means the latest month and week.
        maxResults - The maximum number of artworks 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 popular artworks by the specified tag
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The tagId is null or empty.
        • The maxResults is less than 1 or greater than 100.
        • The resourceListCallback is null.
        Since:
        PEN.UP 1.0
      • postArtwork

        public static void postArtwork(PenupClient penupClient,
                       ArtworkResource artworkResource,
                       Uri imageUri,
                       ResourceCallback<ArtworkResource> resourceCallback)
        Posts the specified artwork.
        The Scope.POST_RESOURCES scope is required.
        Parameters:
        penupClient - The PenupClient instance
        artworkResource - The ArtworkResource instance including the artwork information in order to post
        imageUri - The URI of the image to post.
        Only png and jpg files are supported.
        resourceCallback - The ResourceCallback instance
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The artworkResource is null.
        • The imageUri is invalid or null.
        • The imageUri is neither a png file nor a jpg file.
        • The resourceCallback is null.
        Since:
        PEN.UP 1.0
      • launchPostDialog

        public static void launchPostDialog(PenupClient penupClient,
                            Uri imageUri,
                            ResourceCallback<ArtworkResource> resourceCallback)
        Launches the Post Dialog which provides a simple and consistent user interface to post an artwork easily.
        The progress dialog is displayed while uploading an artwork with Post Dialog.
        The Scope.POST_RESOURCES scope and Scope.READ_MY_RESOURCES scope are required.
        Parameters:
        penupClient - The PenupClient instance
        imageUri - The URI of the image to post.
        Only png and jpg files are supported.
        resourceCallback - The ResourceCallback instance
        Throws:
        java.lang.IllegalArgumentException - Thrown when either of the following conditions has occurred:
        • The penupClient is null.
        • The imageUri is invalid or null.
        • The imageUri is neither a png file nor a jpg file.
        • The resourceCallback is null.
        Since:
        PEN.UP 1.0