Class GetStreamsApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.stream.request.GetStreamsApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<List<Stream>>
public class GetStreamsApiRequest
extends ZulipApiRequest
implements ExecutableApiRequest<List<Stream>>
Zulip API request builder for getting all streams that the user has access to.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGetStreamsApiRequest
(ZulipHttpClient client) Constructs aGetStreamsApiRequest
. -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Executes the Zulip API request for getting all streams that the user has access to.withIncludeAllActive
(boolean includeAllActive) Sets whether to include active streams.withIncludeDefault
(boolean includeDefault) Sets whether to include default streams.withIncludePublic
(boolean includePublic) Sets whether to include public streams.withIncludeSubscribed
(boolean includeSubscribed) Sets whether to include all streams that the user is subscribed to.withIncludeWebPublic
(boolean includeWebPublic) Sets whether to include web public streams.withOwnerSubscribed
(boolean ownerSubscribed) If the user is a bot user, this sets whether to include streams that the owner user is subscribed to.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParams, putParam, putParamAsJsonString
-
Field Details
-
INCLUDE_PUBLIC
- See Also:
-
INCLUDE_WEB_PUBLIC
- See Also:
-
INCLUDE_SUBSCRIBED
- See Also:
-
INCLUDE_ALL_ACTIVE
- See Also:
-
INCLUDE_DEFAULT
- See Also:
-
INCLUDE_OWNER_SUBSCRIBED
- See Also:
-
-
Constructor Details
-
GetStreamsApiRequest
Constructs aGetStreamsApiRequest
.- Parameters:
client
- The Zulip HTTP client
-
-
Method Details
-
withIncludePublic
Sets whether to include public streams.- Parameters:
includePublic
-true
to include public streams.false
to exclude public streams.- Returns:
- This
GetStreamsApiRequest
instance
-
withIncludeWebPublic
Sets whether to include web public streams.- Parameters:
includeWebPublic
-true
to include web public streams.false
to exclude web public streams.- Returns:
- This
GetStreamsApiRequest
instance
-
withIncludeSubscribed
Sets whether to include all streams that the user is subscribed to.- Parameters:
includeSubscribed
-true
to include all streams that the user is subscribed to.false
to exclude all streams that the user is subscribed to.- Returns:
- This
GetStreamsApiRequest
instance
-
withIncludeAllActive
Sets whether to include active streams.- Parameters:
includeAllActive
-true
to include active streams.false
to exclude active streams.- Returns:
- This
GetStreamsApiRequest
instance
-
withIncludeDefault
Sets whether to include default streams.- Parameters:
includeDefault
-true
to include default streams.false
to exclude default streams.- Returns:
- This
GetStreamsApiRequest
instance
-
withOwnerSubscribed
If the user is a bot user, this sets whether to include streams that the owner user is subscribed to.- Parameters:
ownerSubscribed
-true
to include owner subscribed streams.false
to exclude owner subscribed streams.- Returns:
- This
GetStreamsApiRequest
instance
-
execute
Executes the Zulip API request for getting all streams that the user has access to.- Specified by:
execute
in interfaceExecutableApiRequest<List<Stream>>
- Returns:
- List of
Stream
objects - Throws:
ZulipClientException
- if the request was not successful
-