Class UpdateStreamApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.stream.request.UpdateStreamApiRequest
- All Implemented Interfaces:
VoidExecutableApiRequest
Zulip API request builder for updating a stream.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUpdateStreamApiRequest(ZulipHttpClient client, long streamId) Constructs aDeleteStreamApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the Zulip API request for updating a stream.withCanRemoveSubscribersGroup(long userGroupID) Sets the updated user group id whose members are allowed to unsubscribe others from the stream.withDefaultStream(boolean defaultStream) Sets whether any newly created streams will be added as default streams for new users joining the organization.withDescription(String description) Sets the updated stream description.withHistoryPublicToSubscribers(boolean historyPublicToSubscribers) Sets whether the stream history is public to new subscribers.withIsPrivate(boolean isPrivate) Sets the whether the stream is private.withMessageRetention(int messageRetentionDays) Sets the updated number of days that message history should be retained.withMessageRetention(RetentionPolicy messageRetentionPolicy) Sets the updated message retention policy of a stream.Sets the updated stream name.withStreamPostPolicy(StreamPostPolicy policy) Sets the updated policy for which users can post messages to the stream.withWebPublic(boolean webPublic) Sets whether the stream is a web-public stream.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParams, putParam, putParamAsJsonString
-
Field Details
-
DESCRIPTION
- See Also:
-
NEW_NAME
- See Also:
-
PRIVATE
- See Also:
-
IS_DEFAULT_STREAM
- See Also:
-
IS_WEB_PUBLIC
- See Also:
-
STREAM_POST_POLICY
- See Also:
-
MESSAGE_RETENTION_DAYS
- See Also:
-
HISTORY_PUBLIC_TO_SUBSCRIBERS
- See Also:
-
CAN_REMOVE_SUBSCRIBERS_GROUP
- See Also:
-
-
Constructor Details
-
UpdateStreamApiRequest
Constructs aDeleteStreamApiRequest.- Parameters:
client- The Zulip HTTP clientstreamId- The id of the stream to update
-
-
Method Details
-
withDescription
Sets the updated stream description.- Parameters:
description- The description of the stream- Returns:
- This
UpdateStreamApiRequestinstance
-
withName
Sets the updated stream name.- Parameters:
name- The name of the stream- Returns:
- This
UpdateStreamApiRequestinstance
-
withIsPrivate
Sets the whether the stream is private.- Parameters:
isPrivate-trueif the stream should be private.falseif the stream should be public- Returns:
- This
UpdateStreamApiRequestinstance
-
withDefaultStream
Sets whether any newly created streams will be added as default streams for new users joining the organization.- Parameters:
defaultStream-trueresults in any newly created streams as the default.falseresults in any newly created streams being the default- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withWebPublic
Sets whether the stream is a web-public stream.- Parameters:
webPublic-trueresults in any newly created streams created as web0public.falseresults in created streams being non web-public- Returns:
- This
UpdateStreamApiRequestinstance
-
withStreamPostPolicy
Sets the updated policy for which users can post messages to the stream.- Parameters:
policy- TheStreamPostPolicythat should apply to the stream- Returns:
- This
UpdateStreamApiRequestinstance
-
withMessageRetention
Sets the updated number of days that message history should be retained.- Parameters:
messageRetentionDays- The number of days for which message history should be retained- Returns:
- This
UpdateStreamApiRequestinstance
-
withMessageRetention
Sets the updated message retention policy of a stream.- Parameters:
messageRetentionPolicy- TheRetentionPolicythat should apply to the stream- Returns:
- This
UpdateStreamApiRequestinstance
-
withHistoryPublicToSubscribers
Sets whether the stream history is public to new subscribers.- Parameters:
historyPublicToSubscribers-trueif stream history should be public to new subscribers.falseif stream history should not be public to new subscribers- Returns:
- This
UpdateStreamApiRequestinstance
-
withCanRemoveSubscribersGroup
Sets the updated user group id whose members are allowed to unsubscribe others from the stream.- Parameters:
userGroupID- The user group id whose members are allowed to unsubscribe others from the stream- Returns:
- This
UpdateStreamApiRequestinstance
-
execute
Executes the Zulip API request for updating a stream.- Specified by:
executein interfaceVoidExecutableApiRequest- Throws:
ZulipClientException- if the request was not successful
-