Class UnsubscribeStreamsApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.stream.request.UnsubscribeStreamsApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<StreamUnsubscribeResult>
public class UnsubscribeStreamsApiRequest
extends ZulipApiRequest
implements ExecutableApiRequest<StreamUnsubscribeResult>
Zulip API request builder for unsubscribing users from a stream.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnsubscribeStreamsApiRequest
(ZulipHttpClient client, String[] subscriptions) Constructs aUnsubscribeStreamsApiRequest
. -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Executes the Zulip API request for unsubscribing users from a stream.withPrincipals
(long... userIds) Sets the list of users that are to be unsubscribed from the stream.withPrincipals
(String... emailAddresses) Sets the list of users that are to be unsubscribed from the stream.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParams, putParam, putParamAsJsonString
-
Field Details
-
SUBSCRIPTIONS
- See Also:
-
PRINCIPALS
- See Also:
-
-
Constructor Details
-
UnsubscribeStreamsApiRequest
Constructs aUnsubscribeStreamsApiRequest
.- Parameters:
client
- The Zulip HTTP clientsubscriptions
- An array of stream names to unsubscribe from
-
-
Method Details
-
withPrincipals
Sets the list of users that are to be unsubscribed from the stream.- Parameters:
emailAddresses
- The array of user email addresses to unsubscribe to the stream- Returns:
- This
UnsubscribeStreamsApiRequest
instance
-
withPrincipals
Sets the list of users that are to be unsubscribed from the stream.- Parameters:
userIds
- The array of user ids to unsubscribe to the stream- Returns:
- This
UnsubscribeStreamsApiRequest
instance
-
execute
Executes the Zulip API request for unsubscribing users from a stream.- Specified by:
execute
in interfaceExecutableApiRequest<StreamUnsubscribeResult>
- Returns:
StreamUnsubscribeResult
describing the result of the request to unsubscribe users from streams- Throws:
ZulipClientException
- if the request was not successful
-