Class StreamService
java.lang.Object
com.github.jamesnetherton.zulip.client.api.stream.StreamService
- All Implemented Interfaces:
ZulipService
Zulip stream APIs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDefaultStream
(long streamId) Adds a default stream for new users joining the organization.archiveStream
(long streamId) Archives a stream.delete
(long streamId) Deletes a stream.deleteTopic
(long streamId, String topicName) Deletes a topic.getAll()
Gets all streams that the user has access to.getStream
(long streamId) Gets a stream for the given stream ID.getStreamEmailAddress
(long streamId) Gets the email address of a stream.getStreamId
(String stream) Gets the id of a stream.getStreamSubscribers
(long streamId) Gets all users subscribed to a stream.Gets users subscribed streams.getTopics
(long streamId) Gets stream topics.isSubscribed
(long userId, long streamId) Gets stream subscription status.Deprecated, for removal: This API element is subject to removal in a future version.Use updateUserTopicPreferences insteadremoveDefaultStream
(long streamId) Removes a default stream for new users joining the organization.subscribe
(StreamSubscriptionRequest... streamsToSubscribe) Subscribe to streams.unmuteTopic
(String topic) Deprecated, for removal: This API element is subject to removal in a future version.Use updateUserTopicPreferences insteadunsubscribe
(String... streams) Unsubscribe from streams.updateStream
(long streamId) Updates a stream.Updates stream subscription settings.updateUserTopicPreferences
(long streamId, String topic, TopicVisibilityPolicy topicVisibilityPolicy) Updates personal preferences for a topic.
-
Constructor Details
-
StreamService
Constructs aStreamService
.- Parameters:
client
- The Zulip HTTP client
-
-
Method Details
-
getSubscribedStreams
Gets users subscribed streams.- Returns:
- The
GetSubscribedStreamsApiRequest
builder object - See Also:
-
subscribe
Subscribe to streams.- Parameters:
streamsToSubscribe
- An array ofStreamSubscriptionRequest
objects detailing the stream name and description- Returns:
- The
SubscribeStreamsApiRequest
builder object - See Also:
-
unsubscribe
Unsubscribe from streams.- Parameters:
streams
- An array of stream names to unsubscribe from- Returns:
- The
UnsubscribeStreamsApiRequest
builder object - See Also:
-
isSubscribed
Gets stream subscription status.- Parameters:
userId
- The user id to check if it is subscribed to the specified streamstreamId
- The id of the stream to check if the specified user is subscribed- Returns:
- The
GetSubscriptionStatusApiRequest
builder object - See Also:
-
getStream
Gets a stream for the given stream ID.- Returns:
- The
GetStreamApiRequest
builder object - See Also:
-
getAll
Gets all streams that the user has access to.- Returns:
- The
GetStreamsApiRequest
builder object - See Also:
-
getStreamId
Gets the id of a stream.- Parameters:
stream
- The name of the stream- Returns:
- The
GetStreamIdApiRequest
builder object - See Also:
-
getStreamEmailAddress
Gets the email address of a stream.- Parameters:
streamId
- The id of the stream to fetch the email address for- Returns:
- The
GetStreamEmailAddressApiRequest
builder object - See Also:
-
delete
Deletes a stream.- Parameters:
streamId
- The id of the stream to delete- Returns:
- The
DeleteStreamApiRequest
builder object - See Also:
-
getTopics
Gets stream topics.- Parameters:
streamId
- The id of the stream to get topics from- Returns:
- The
GetStreamTopicsApiRequest
builder object - See Also:
-
updateStream
Updates a stream.- Parameters:
streamId
- The id of the stream to update- Returns:
- The
UpdateStreamApiRequest
builder object - See Also:
-
muteTopic
Deprecated, for removal: This API element is subject to removal in a future version.Use updateUserTopicPreferences insteadMutes a topic.- Parameters:
topic
- The name of the topic to mute- Returns:
- The
MuteTopicApiRequest
builder object - See Also:
-
unmuteTopic
Deprecated, for removal: This API element is subject to removal in a future version.Use updateUserTopicPreferences insteadUnmutes a topic.- Parameters:
topic
- The name of the topic to unmute- Returns:
- The
MuteTopicApiRequest
builder object - See Also:
-
updateSubscriptionSettings
Updates stream subscription settings.- Returns:
- The
UpdateStreamSubscriptionSettingsApiRequest
builder object - See Also:
-
deleteTopic
Deletes a topic.- Parameters:
streamId
- The id of the stream containing the topic to deletetopicName
- The name of the topic to delete- Returns:
- The
DeleteTopicApiRequest
builder object - See Also:
-
archiveStream
Archives a stream.- Parameters:
streamId
- The id of the stream to archive- Returns:
- The
ArchiveStreamApiRequest
builder object - See Also:
-
updateUserTopicPreferences
public UpdateUserTopicPreferencesApiRequest updateUserTopicPreferences(long streamId, String topic, TopicVisibilityPolicy topicVisibilityPolicy) Updates personal preferences for a topic.- Parameters:
streamId
- The id of the stream where the topic residestopic
- The name of the topic to update preferences fortopicVisibilityPolicy
- TheTopicVisibilityPolicy
to apply- Returns:
- The
UpdateUserTopicPreferencesApiRequest
builder object - See Also:
-
addDefaultStream
Adds a default stream for new users joining the organization.- Parameters:
streamId
- The id of the stream to make a default for new users joining the organization- Returns:
- The
AddDefaultStreamApiRequest
builder object
-
removeDefaultStream
Removes a default stream for new users joining the organization.- Parameters:
streamId
- The id of the stream to remove as a default for new users joining the organization- Returns:
- The
RemoveDefaultStreamApiRequest
builder object
-
getStreamSubscribers
Gets all users subscribed to a stream.- Parameters:
streamId
- The id of the stream to get subscribers for- Returns:
- The
GetStreamSubscribersApiRequest
builder object
-