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.createChannel(String name, Long... subscribers) Creates a new channel.createChannelFolder(String name) Creates a new channel folder.delete(long streamId) Deletes a stream.deleteTopic(long streamId, String topicName) Deletes a topic.getAll()Gets all streams that the user has access to.Gets all channel folders.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.reorderChannelFolders(Integer... channelFolderIdOrder) Reorders channel folders.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.updateChannelFolder(int channelFolderId) Updates a channel folder.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
GetSubscribedStreamsApiRequestbuilder object - See Also:
-
subscribe
Subscribe to streams.- Parameters:
streamsToSubscribe- An array ofStreamSubscriptionRequestobjects detailing the stream name and description- Returns:
- The
SubscribeStreamsApiRequestbuilder object - See Also:
-
unsubscribe
Unsubscribe from streams.- Parameters:
streams- An array of stream names to unsubscribe from- Returns:
- The
UnsubscribeStreamsApiRequestbuilder 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
GetSubscriptionStatusApiRequestbuilder object - See Also:
-
getStream
Gets a stream for the given stream ID.- Returns:
- The
GetStreamApiRequestbuilder object - See Also:
-
getAll
Gets all streams that the user has access to.- Returns:
- The
GetStreamsApiRequestbuilder object - See Also:
-
getStreamId
Gets the id of a stream.- Parameters:
stream- The name of the stream- Returns:
- The
GetStreamIdApiRequestbuilder 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
GetStreamEmailAddressApiRequestbuilder object - See Also:
-
delete
Deletes a stream.- Parameters:
streamId- The id of the stream to delete- Returns:
- The
DeleteStreamApiRequestbuilder object - See Also:
-
getTopics
Gets stream topics.- Parameters:
streamId- The id of the stream to get topics from- Returns:
- The
GetStreamTopicsApiRequestbuilder object - See Also:
-
updateStream
Updates a stream.- Parameters:
streamId- The id of the stream to update- Returns:
- The
UpdateStreamApiRequestbuilder 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
MuteTopicApiRequestbuilder 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
MuteTopicApiRequestbuilder object - See Also:
-
updateSubscriptionSettings
Updates stream subscription settings.- Returns:
- The
UpdateStreamSubscriptionSettingsApiRequestbuilder 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
DeleteTopicApiRequestbuilder object - See Also:
-
archiveStream
Archives a stream.- Parameters:
streamId- The id of the stream to archive- Returns:
- The
ArchiveStreamApiRequestbuilder 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- TheTopicVisibilityPolicyto apply- Returns:
- The
UpdateUserTopicPreferencesApiRequestbuilder 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
AddDefaultStreamApiRequestbuilder object - See Also:
-
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
RemoveDefaultStreamApiRequestbuilder object - See Also:
-
getStreamSubscribers
Gets all users subscribed to a stream.- Parameters:
streamId- The id of the stream to get subscribers for- Returns:
- The
GetStreamSubscribersApiRequestbuilder object - See Also:
-
createChannel
Creates a new channel.- Parameters:
name- The name of the channelsubscribers- The user ids that should be subscribed to the channel- Returns:
- The
CreateChannelApiRequestbuilder object - See Also:
-
createChannelFolder
Creates a new channel folder.- Parameters:
name- The name of the channel folder- Returns:
- The
CreateChannelFolderApiRequestbuilder object - See Also:
-
getChannelFolders
Gets all channel folders.- Returns:
- The
GetChannelFoldersApiRequestbuilder object - See Also:
-
reorderChannelFolders
Reorders channel folders.- Parameters:
channelFolderIdOrder- The order of the channel folder ids- Returns:
- The
GetChannelFoldersApiRequestbuilder object - See Also:
-
updateChannelFolder
Updates a channel folder.- Parameters:
channelFolderId- The id of the channel folder to update- Returns:
- The
UpdateChannelFolderApiRequestbuilder object - See Also:
-