public class GroupResource extends Object implements Subscribable
SonosGroup,
SonosGroups| Constructor and Description |
|---|
GroupResource(SonosApiClient apiClient)
Constructor for GroupResource.
|
| Modifier and Type | Method and Description |
|---|---|
SonosGroupInfo |
createGroup(String clientToken,
String householdId,
List<String> playerIds,
String musicContextGroupId)
Join players together into a group, optionally with an existing audio stream
|
SonosGroups |
getGroups(String clientToken,
String householdId)
Get a list of
SonosGroup and SonosPlayer |
SonosGroupInfo |
modifyGroupMembers(String clientToken,
String groupId,
List<String> playerIdsToAdd,
List<String> playerIdsToRemove)
Modify an existing group of players
|
SonosGroupInfo |
setGroupMembers(String clientToken,
String groupId,
List<String> playerIds)
Provide a list of player IDs to set in an existing 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 GroupResource(SonosApiClient apiClient)
Constructor for GroupResource.
apiClient - a SonosApiClient object.public SonosGroups getGroups(String clientToken, String householdId) throws SonosApiClientException, SonosApiError
SonosGroup and SonosPlayerclientToken - for the userhouseholdId - for the household you want to fetch groups and playersSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosGroupInfo createGroup(String clientToken, String householdId, List<String> playerIds, String musicContextGroupId) throws SonosApiClientException, SonosApiError
clientToken - for the userhouseholdId - for the household you want to fetch groups and playersplayerIds - that you want to join togethermusicContextGroupId - if you want to start/continue playing an audio streamSonosGroupInfo objectSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosGroupInfo modifyGroupMembers(String clientToken, String groupId, List<String> playerIdsToAdd, List<String> playerIdsToRemove) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - to modifyplayerIdsToAdd - list of player IDs to add to the group (optional)playerIdsToRemove - list of player IDs to remove from the group (optional)SonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosGroupInfo setGroupMembers(String clientToken, String groupId, List<String> playerIds) throws SonosApiClientException, SonosApiError
clientToken - for the usergroupId - to modifyplayerIds - to be set as the players in this groupSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess subscribe(String clientToken, String householdId) throws SonosApiClientException, SonosApiError
Subscribe to events for this resource.
Subscribe to group events in a specified householdsubscribe 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 from group events in a specified householdunsubscribe 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.