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 Summary
Methods Modifier and Type Method and Description static void
getAllArtworks(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<ArtworkResource> resourceListCallback)
Gets all artworks of PEN.UP.static void
getArtwork(PenupClient penupClient, java.lang.String artworkId, ResourceCallback<ArtworkResource> resourceCallback)
Gets the artwork with the specified ID.static void
getArtworksByApp(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<ArtworkResource> resourceListCallback)
Gets artworks posted via your application.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.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.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.static void
getMyArtworks(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<ArtworkResource> resourceListCallback)
Gets artworks that the user has posted or reposted.static void
getMyFeed(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<ArtworkResource> resourceListCallback)
Gets the user's feed.static void
getMyPosts(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<ArtworkResource> resourceListCallback)
Gets artworks that the user has posted.static void
getMyReposts(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<ArtworkResource> resourceListCallback)
Gets artworks that the user has reposted.static void
getPopularArtworks(PenupClient penupClient, Period period, int maxResults, java.lang.String pageToken, ResourceListCallback<ArtworkResource> resourceListCallback)
Gets popular artworks.static void
getPopularArtworksByApp(PenupClient penupClient, Period period, int maxResults, java.lang.String pageToken, ResourceListCallback<ArtworkResource> resourceListCallback)
Gets popular artworks posted via your application.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.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.static void
postArtwork(PenupClient penupClient, ArtworkResource artworkResource, Uri imageUri, ResourceCallback<ArtworkResource> resourceCallback)
Posts the specified artwork.
-
-
-
Method Detail
-
getArtwork
public static void getArtwork(PenupClient penupClient, java.lang.String artworkId, ResourceCallback<ArtworkResource> resourceCallback)
Gets the artwork with the specified ID.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instanceartworkId
- The artwork IDresourceCallback
- The ResourceCallbackinstance for receiving the artwork - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
artworkId
isnull
or empty. - The
resourceCallback
isnull
.
- The
- 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.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancemaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the artworks posted via your application - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
maxResults
is less than 1 or greater than 100. - The
resourceCallback
isnull
.
- The
- 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.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instanceartistId
- The artist IDmaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance 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
isnull
. - The
artistId
isnull
or empty. - The
maxResults
is less than 1 or greater than 100. - The
resourceCallback
isnull
.
- The
- 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.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancecollectionId
- The collection IDmaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the artworks included in the specified collection - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
collectionId
isnull
or empty. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancetagId
- The tag IDmaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the artworks included in the specified tag - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
tagId
isnull
or empty. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancemaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving all artworks - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_MY_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancemaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance 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
isnull
. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_MY_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancemaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the artworks that the user has posted - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_MY_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancemaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the artworks that the user has reposted - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_MY_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancemaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the user's feed - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instanceperiod
- The period for popularities of artworks.
MONTH
andWEEK
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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the popular artworks - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instanceperiod
- The period for popularities of artworks.
MONTH
andWEEK
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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the artworks posted via your application - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
maxResults
is less than 1 or greater than 100. - The
resourceCallback
isnull
.
- The
- 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.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancetagId
- The tag IDperiod
- The period for popularities of artworks.
MONTH
andWEEK
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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the popular artworks by the specified tag - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
tagId
isnull
or empty. - The
maxResults
is less than 1 or greater than 100. - The
resourceListCallback
isnull
.
- The
- Since:
- PEN.UP 1.0
-
postArtwork
public static void postArtwork(PenupClient penupClient, ArtworkResource artworkResource, Uri imageUri, ResourceCallback<ArtworkResource> resourceCallback)
Posts the specified artwork.
TheScope.POST_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instanceartworkResource
- The ArtworkResource instance including the artwork information in order to postimageUri
- The URI of the image to post.
Only png and jpg files are supported.resourceCallback
- The ResourceCallbackinstance - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
artworkResource
isnull
. - The
imageUri
is invalid ornull
. - The
imageUri
is neither a png file nor a jpg file. - The
resourceCallback
isnull
.
- The
- 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.
TheScope.POST_RESOURCES
scope andScope.READ_MY_RESOURCES
scope are required.- Parameters:
penupClient
- The PenupClient instanceimageUri
- The URI of the image to post.
Only png and jpg files are supported.resourceCallback
- The ResourceCallbackinstance - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
imageUri
is invalid ornull
. - The
imageUri
is neither a png file nor a jpg file. - The
resourceCallback
isnull
.
- The
- Since:
- PEN.UP 1.0
-
-