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 Summary
Methods Modifier and Type Method and Description static void
addCollection(PenupClient penupClient, java.lang.String collectionName, ResourceCallback<CollectionResource> resourceCallback)
Adds the specified collection.static void
getCollection(PenupClient penupClient, java.lang.String collectionId, ResourceCallback<CollectionResource> resourceCallback)
Gets the collection with the specified ID.static void
getMyCollections(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<CollectionResource> resourceListCallback)
Gets user's collections.static void
getMyFollowingCollections(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<CollectionResource> resourceListCallback)
Gets collections that the user follows.
-
-
-
Method Detail
-
getCollection
public static void getCollection(PenupClient penupClient, java.lang.String collectionId, ResourceCallback<CollectionResource> resourceCallback)
Gets the collection with the specified ID.
TheScope.READ_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancecollectionId
- The collection IDresourceCallback
- The ResourceCallbackinstance for receiving the collection - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
collectionId
isnull
or empty. - The
resourceListCallback
isnull
.
- The
- 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.
TheScope.READ_MY_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancemaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the user's collections - 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
-
getMyFollowingCollections
public static void getMyFollowingCollections(PenupClient penupClient, int maxResults, java.lang.String pageToken, ResourceListCallback<CollectionResource> resourceListCallback)
Gets collections that the user follows.
TheScope.READ_MY_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancemaxResults
- 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.
Setsnull
to get the first page.resourceListCallback
- The ResourceListCallbackinstance for receiving the collections that the user follows. - 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
-
addCollection
public static void addCollection(PenupClient penupClient, java.lang.String collectionName, ResourceCallback<CollectionResource> resourceCallback)
Adds the specified collection.
TheScope.POST_RESOURCES
scope is required.- Parameters:
penupClient
- The PenupClient instancecollectionName
- The collection name.
The length of the collection name must be within 25 characters.resourceCallback
- The ResourceCallbackinstance - Throws:
java.lang.IllegalArgumentException
- Thrown when either of the following conditions has occurred:- The
penupClient
isnull
. - The
collectionName
isnull
or empty. - The length of
collectionName
is greater than 25. - The
resourceCallback
isnull
.
- The
- Since:
- PEN.UP 1.0
-
-