Class SubscribeStreamsApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.stream.request.SubscribeStreamsApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<StreamSubscriptionResult>
public class SubscribeStreamsApiRequest
extends ZulipApiRequest
implements ExecutableApiRequest<StreamSubscriptionResult>
Zulip API request builder for subscribing to a stream.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionSubscribeStreamsApiRequest(ZulipHttpClient client, StreamSubscriptionRequest[] subscriptions) Constructs aSubscribeStreamsApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the Zulip API request for subscribing to a stream.withAnnounce(boolean announce) Sets whether creation of the new stream should be announced.withAuthorizationErrorsFatal(boolean authorizationErrorsFatal) Sets whether authorization failures should result in a failure response.withCanAddSubscribersGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to add subscribers to this channel.withCanAdministerChannelGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to administer this channel.withCanDeleteAnyMessageGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to delete any message in the channel.withCanDeleteOwnMessageGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to delete the messages that they have sent in the channel.withCanMoveMessagesOutOfChannelGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to move messages out of this channel.withCanMoveMessagesWithinChannelGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to move messages within this channel.withCanRemoveSubscribersGroup(long userGroupID) Deprecated.withCanRemoveSubscribersGroup(UserGroupSetting userGroupSetting) Sets the user group id whose members are allowed to unsubscribe others from the stream.withCanResolveTopicsGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to resolve topics in the channel.withCanSendMessageGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to post in this channel.withCanSubscribeGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to subscribe themselves to this channel.withDefaultStream(boolean defaultStream) Sets whether any newly created streams will be added as default streams for new users joining the organization.withFolderId(int folderId) Sets the id of the folder to which the newly created channel will be added.withHistoryPublicToSubscribers(boolean historyPublicToSubscribers) Sets whether the stream history is public to new subscribers.withInviteOnly(boolean inviteOnly) Sets whether a created stream will be private.withMessageRetention(int messageRetentionDays) Sets the number of days that message history should be retained.withMessageRetention(RetentionPolicy messageRetentionPolicy) Sets the message retention policy of a stream.withPrincipals(long... userIds) Sets the list of users that are to be subscribed to the stream.withPrincipals(String... emailAddresses) Sets the list of users that are to be subscribed to the stream.withSendNewSubscriptionMessages(boolean sendNewSubscriptionMessages) Sets whether any other users newly subscribed via this request should be sent a Notification Bot DM notifying them about their new subscription.withStreamPostPolicy(StreamPostPolicy policy) Sets the policy for which users can post messages to the stream.withTopicPolicy(TopicPolicy topicPolicy) Sets whether named topics and the empty topic are enabled in this channel.withWebPublic(boolean webPublic) Sets whether any newly created streams will be web-public streams.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
SUBSCRIPTIONS
- See Also:
-
PRINCIPALS
- See Also:
-
AUTHORIZATION_ERRORS_FATAL
- See Also:
-
ANNOUNCE
- See Also:
-
INVITE_ONLY
- See Also:
-
IS_DEFAULT_STREAM
- See Also:
-
IS_WEB_PUBLIC
- See Also:
-
HISTORY_PUBLIC_TO_SUBSCRIBERS
- See Also:
-
STREAM_POST_POLICY
- See Also:
-
MESSAGE_RETENTION_DAYS
- See Also:
-
CAN_ADD_SUBSCRIBERS_GROUP
- See Also:
-
CAN_ADMINISTER_CHANNEL_GROUP
- See Also:
-
CAN_DELETE_ANY_MESSAGE_GROUP
- See Also:
-
CAN_DELETE_OWN_MESSAGE_GROUP
- See Also:
-
CAN_MOVE_MESSAGES_OUT_OF_CHANNEL_GROUP
- See Also:
-
CAN_MOVE_MESSAGES_WITHIN_CHANNEL_GROUP
- See Also:
-
CAN_SEND_MESSAGE_GROUP
- See Also:
-
CAN_SUBSCRIBE_GROUP
- See Also:
-
CAN_REMOVE_SUBSCRIBERS_GROUP
- See Also:
-
CAN_RESOLVE_TOPICS_GROUP
- See Also:
-
TOPICS_POLICY
- See Also:
-
FOLDER_ID
- See Also:
-
SEND_NEW_SUBSCRIPTION_MESSAGES
- See Also:
-
-
Constructor Details
-
SubscribeStreamsApiRequest
public SubscribeStreamsApiRequest(ZulipHttpClient client, StreamSubscriptionRequest[] subscriptions) Constructs aSubscribeStreamsApiRequest.- Parameters:
client- The Zulip HTTP clientsubscriptions- An array ofStreamSubscriptionRequestobjects detailing the stream name and description
-
-
Method Details
-
withPrincipals
Sets the list of users that are to be subscribed to the stream.- Parameters:
emailAddresses- The array of user email addresses to subscribe to the stream- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withPrincipals
Sets the list of users that are to be subscribed to the stream.- Parameters:
userIds- The array of user ids to subscribe to the stream- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withAuthorizationErrorsFatal
Sets whether authorization failures should result in a failure response. I.e if a specified user does not have access to the stream.- Parameters:
authorizationErrorsFatal-trueif authorization failures should result in a failure response.trueif authorization failures should be ignored- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withAnnounce
Sets whether creation of the new stream should be announced.- Parameters:
announce-trueto announce the creation of the new stream.falseto not make any announcement- Returns:
- This
SubscribeStreamsApiRequestinstance
-
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
-
withInviteOnly
Sets whether a created stream will be private.- Parameters:
inviteOnly-trueresults in any streams created as private.falseresults in created streams being public- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withWebPublic
Sets whether any newly created streams will be web-public streams.- Parameters:
webPublic-trueresults in any newly created streams created as web0public.falseresults in created streams being non web-public- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withHistoryPublicToSubscribers
public SubscribeStreamsApiRequest withHistoryPublicToSubscribers(boolean historyPublicToSubscribers) 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
SubscribeStreamsApiRequestinstance
-
withStreamPostPolicy
Sets the policy for which users can post messages to the stream.- Parameters:
policy- TheStreamPostPolicythat should apply to the stream- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withMessageRetention
Sets the number of days that message history should be retained.- Parameters:
messageRetentionDays- The number of days for which message history should be retained- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withMessageRetention
Sets the message retention policy of a stream.- Parameters:
messageRetentionPolicy- TheRetentionPolicythat should apply to the stream- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanAddSubscribersGroup
Sets the user group settings for users who have permission to add subscribers to this channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to add subscribers to this channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanAdministerChannelGroup
Sets the user group settings for users who have permission to administer this channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to administer this channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanDeleteAnyMessageGroup
Sets the user group settings for users who have permission to delete any message in the channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to delete any message in the channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanDeleteOwnMessageGroup
Sets the user group settings for users who have permission to delete the messages that they have sent in the channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to delete the messages that they have sent in the channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanMoveMessagesOutOfChannelGroup
public SubscribeStreamsApiRequest withCanMoveMessagesOutOfChannelGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to move messages out of this channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to move messages out of this channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanMoveMessagesWithinChannelGroup
public SubscribeStreamsApiRequest withCanMoveMessagesWithinChannelGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to move messages within this channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to move messages within this channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanSendMessageGroup
Sets the user group settings for users who have permission to post in this channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to post in this channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanSubscribeGroup
Sets the user group settings for users who have permission to subscribe themselves to this channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to subscribe themselves to this channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanRemoveSubscribersGroup
Deprecated.Sets the 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
SubscribeStreamsApiRequestinstance
-
withCanRemoveSubscribersGroup
Sets the user group id whose members are allowed to unsubscribe others from the stream.- Parameters:
userGroupSetting- TheUserGroupSettingwhose members are allowed to unsubscribe others from the stream- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withCanResolveTopicsGroup
Sets the user group settings for users who have permission to resolve topics in the channel.- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to resolve topics in the channel- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withTopicPolicy
Sets whether named topics and the empty topic are enabled in this channel.- Parameters:
topicPolicy- TheTopicPolicy- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withFolderId
Sets the id of the folder to which the newly created channel will be added.- Parameters:
folderId- The id of the folder to which the newly created channel will be added- Returns:
- This
SubscribeStreamsApiRequestinstance
-
withSendNewSubscriptionMessages
public SubscribeStreamsApiRequest withSendNewSubscriptionMessages(boolean sendNewSubscriptionMessages) Sets whether any other users newly subscribed via this request should be sent a Notification Bot DM notifying them about their new subscription.- Parameters:
sendNewSubscriptionMessages-trueto send new subscription messages.falseto not send a subscription message- Returns:
- This
SubscribeStreamsApiRequestinstance
-
execute
Executes the Zulip API request for subscribing to a stream.- Specified by:
executein interfaceExecutableApiRequest<StreamSubscriptionResult>- Returns:
StreamSubscriptionRequestdescribing the result of theStreamSubscriptionRequest- Throws:
ZulipClientException- if the request was not successful
-
withCanRemoveSubscribersGroup(UserGroupSetting)