Class UpdateStreamSubscriptionSettingsApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.stream.request.UpdateStreamSubscriptionSettingsApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<List<String>>
public class UpdateStreamSubscriptionSettingsApiRequest
extends ZulipApiRequest
implements ExecutableApiRequest<List<String>>
Zulip API request builder for updating stream subscription settings.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Executes the Zulip API request for updating stream subscription settings.withAudibleNotifications
(long streamId, boolean audibleNotifications) Sets whether to play a sound for messages sent to the stream.Sets the hex value of the color to display on the Zulip UI.withDesktopNotifications
(long streamId, boolean desktopNotifications) Sets whether to show desktop notifications for messages sent to the stream.withEmailNotifications
(long streamId, boolean emailNotifications) Sets whether to enable or disable email notifications a sound for messages sent to the stream.withIsMuted
(long streamId, boolean muted) Sets whether the stream should be muted.withPinToTop
(long streamId, boolean pinToTop) Sets whether the stream should be pinned to the top in the Zulip UI.withPushNotifications
(long streamId, boolean pushNotifications) Sets whether to enable or disable push notifications a sound for messages sent to the stream.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
COLOR
- See Also:
-
IS_MUTED
- See Also:
-
PIN_TO_TOP
- See Also:
-
DESKTOP_NOTIFICATIONS
- See Also:
-
AUDIBLE_NOTIFICATIONS
- See Also:
-
PUSH_NOTIFICATIONS
- See Also:
-
EMAIL_NOTIFICATIONS
- See Also:
-
SUBSCRIPTION_DATA
- See Also:
-
-
Constructor Details
-
UpdateStreamSubscriptionSettingsApiRequest
Constructs aUpdateStreamSubscriptionSettingsApiRequest
.- Parameters:
client
- The Zulip HTTP client
-
-
Method Details
-
withColor
Sets the hex value of the color to display on the Zulip UI.- Parameters:
streamId
- The id of the stream for which the setting should be updatedcolor
- The hex value of the color- Returns:
- This
UpdateStreamSubscriptionSettingsApiRequest
instance
-
withIsMuted
Sets whether the stream should be muted.- Parameters:
streamId
- The id of the stream for which the setting should be updatedmuted
-true
to mute the stream.false
to unmute the stream- Returns:
- This
UpdateStreamSubscriptionSettingsApiRequest
instance
-
withPinToTop
Sets whether the stream should be pinned to the top in the Zulip UI.- Parameters:
streamId
- The id of the stream for which the setting should be updatedpinToTop
-true
to pin the stream to top.false
to unpin the stream- Returns:
- This
UpdateStreamSubscriptionSettingsApiRequest
instance
-
withDesktopNotifications
public UpdateStreamSubscriptionSettingsApiRequest withDesktopNotifications(long streamId, boolean desktopNotifications) Sets whether to show desktop notifications for messages sent to the stream.- Parameters:
streamId
- The id of the stream for which the setting should be updateddesktopNotifications
-true
to enable desktop notifications.false
to disable desktop notifications.- Returns:
- This
UpdateStreamSubscriptionSettingsApiRequest
instance
-
withAudibleNotifications
public UpdateStreamSubscriptionSettingsApiRequest withAudibleNotifications(long streamId, boolean audibleNotifications) Sets whether to play a sound for messages sent to the stream.- Parameters:
streamId
- The id of the stream for which the setting should be updatedaudibleNotifications
-true
to enable audible notifications.false
to disable audible notifications.- Returns:
- This
UpdateStreamSubscriptionSettingsApiRequest
instance
-
withPushNotifications
public UpdateStreamSubscriptionSettingsApiRequest withPushNotifications(long streamId, boolean pushNotifications) Sets whether to enable or disable push notifications a sound for messages sent to the stream.- Parameters:
streamId
- The id of the stream for which the setting should be updatedpushNotifications
-true
to enable mobile push notifications.false
to disable mobile push notifications.- Returns:
- This
UpdateStreamSubscriptionSettingsApiRequest
instance
-
withEmailNotifications
public UpdateStreamSubscriptionSettingsApiRequest withEmailNotifications(long streamId, boolean emailNotifications) Sets whether to enable or disable email notifications a sound for messages sent to the stream.- Parameters:
streamId
- The id of the stream for which the setting should be updatedemailNotifications
-true
to enable email notifications.false
to disable email notifications.- Returns:
- This
UpdateStreamSubscriptionSettingsApiRequest
instance
-
execute
Executes the Zulip API request for updating stream subscription settings.- Specified by:
execute
in interfaceExecutableApiRequest<List<String>>
- Returns:
- List of modified settings encapsulated by
StreamSubscriptionSetting
- Throws:
ZulipClientException
- if the request was not successful
-