public class FavoriteResource extends Object implements Subscribable
SonosFavorite| Constructor and Description |
|---|
FavoriteResource(SonosApiClient apiClient)
Constructor for FavoriteResource.
|
| Modifier and Type | Method and Description |
|---|---|
SonosFavoriteList |
getFavorites(String clientToken,
String householdId)
Get favorites for the specified household
|
SonosSuccess |
loadFavorite(String clientToken,
String groupId,
String favoriteId,
Boolean playOnCompletion,
SonosPlayMode playMode)
Activate a favorite in a group
|
SonosSuccess |
subscribe(String clientToken,
String householdId)
Subscribe to events for this resource.
|
SonosSuccess |
unsubscribe(String clientToken,
String householdId)
Unsubscribe from events related to this resource.
|
public FavoriteResource(SonosApiClient apiClient)
Constructor for FavoriteResource.
apiClient - a SonosApiClient object.public SonosFavoriteList getFavorites(String clientToken, String householdId) throws SonosApiClientException, SonosApiError
clientToken - for the userhouseholdId - for the household you want to fetch favoritesSonosApiClientException - if an error occurs during the callSonosApiError - if the API returns an errorpublic SonosSuccess loadFavorite(String clientToken, String groupId, String favoriteId, Boolean playOnCompletion, SonosPlayMode playMode) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - to load the favorite infavoriteId - of the favoriteplayOnCompletion - (optional) start playing once loadedplayMode - (optional) provide playback options, where supportedSonosApiClientException - if an error occurs during the call.SonosApiError - if there is an error from the API.public SonosSuccess subscribe(String clientToken, String householdId) throws SonosApiClientException, SonosApiError
Subscribe to events for this resource.
subscribe in interface SubscribableclientToken - for the userhouseholdId - of the resource to subscribe toSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess unsubscribe(String clientToken, String householdId) throws SonosApiClientException, SonosApiError
Unsubscribe from events related to this resource.
unsubscribe in interface SubscribableclientToken - for the userhouseholdId - of the resource to unsubscribe fromSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APICopyright © 2018. All rights reserved.