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 String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static 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 ofStreamSubscriptionRequest
objects 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
SubscribeStreamsApiRequest
instance
-
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
SubscribeStreamsApiRequest
instance
-
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
-true
if authorization failures should result in a failure response.true
if authorization failures should be ignored- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withAnnounce
Sets whether creation of the new stream should be announced.- Parameters:
announce
-true
to announce the creation of the new stream.false
to not make any announcement- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withDefaultStream
Sets whether any newly created streams will be added as default streams for new users joining the organization.- Parameters:
defaultStream
-true
results in any newly created streams as the default.false
results in any newly created streams being the default- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withInviteOnly
Sets whether a created stream will be private.- Parameters:
inviteOnly
-true
results in any streams created as private.false
results in created streams being public- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withWebPublic
Sets whether any newly created streams will be web-public streams.- Parameters:
webPublic
-true
results in any newly created streams created as web0public.false
results in created streams being non web-public- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withHistoryPublicToSubscribers
public SubscribeStreamsApiRequest withHistoryPublicToSubscribers(boolean historyPublicToSubscribers) Sets whether the stream history is public to new subscribers.- Parameters:
historyPublicToSubscribers
-true
if stream history should be public to new subscribers.false
if stream history should not be public to new subscribers- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withStreamPostPolicy
Sets the policy for which users can post messages to the stream.- Parameters:
policy
- TheStreamPostPolicy
that should apply to the stream- Returns:
- This
SubscribeStreamsApiRequest
instance
-
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
SubscribeStreamsApiRequest
instance
-
withMessageRetention
Sets the message retention policy of a stream.- Parameters:
messageRetentionPolicy
- TheRetentionPolicy
that should apply to the stream- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withCanAddSubscribersGroup
Sets the user group settings for users who have permission to add subscribers to this channel.- Parameters:
userGroupSetting
- TheUserGroupSetting
for users who have permission to add subscribers to this channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withCanAdministerChannelGroup
Sets the user group settings for users who have permission to administer this channel.- Parameters:
userGroupSetting
- TheUserGroupSetting
for users who have permission to administer this channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withCanDeleteAnyMessageGroup
Sets the user group settings for users who have permission to delete any message in the channel.- Parameters:
userGroupSetting
- TheUserGroupSetting
for users who have permission to delete any message in the channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withCanDeleteOwnMessageGroup
Sets the user group settings for users who have permission to delete the messages that they have sent in the channel.- Parameters:
userGroupSetting
- TheUserGroupSetting
for users who have permission to delete the messages that they have sent in the channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
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
- TheUserGroupSetting
for users who have permission to move messages out of this channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withCanMoveMessagesWithinChannelGroup
public SubscribeStreamsApiRequest withCanMoveMessagesWithinChannelGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to move messages within this channel.- Parameters:
userGroupSetting
- TheUserGroupSetting
for users who have permission to move messages within this channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withCanSendMessageGroup
Sets the user group settings for users who have permission to post in this channel.- Parameters:
userGroupSetting
- TheUserGroupSetting
for users who have permission to post in this channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withCanSubscribeGroup
Sets the user group settings for users who have permission to subscribe themselves to this channel.- Parameters:
userGroupSetting
- TheUserGroupSetting
for users who have permission to subscribe themselves to this channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
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
SubscribeStreamsApiRequest
instance
-
withCanRemoveSubscribersGroup
Sets the user group id whose members are allowed to unsubscribe others from the stream.- Parameters:
userGroupSetting
- TheUserGroupSetting
whose members are allowed to unsubscribe others from the stream- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withCanResolveTopicsGroup
Sets the user group settings for users who have permission to resolve topics in the channel.- Parameters:
userGroupSetting
- TheUserGroupSetting
for users who have permission to resolve topics in the channel- Returns:
- This
SubscribeStreamsApiRequest
instance
-
withTopicPolicy
Sets whether named topics and the empty topic are enabled in this channel.- Parameters:
topicPolicy
- TheTopicPolicy
- Returns:
- This
SubscribeStreamsApiRequest
instance
-
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
SubscribeStreamsApiRequest
instance
-
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
-true
to send new subscription messages.false
to not send a subscription message- Returns:
- This
SubscribeStreamsApiRequest
instance
-
execute
Executes the Zulip API request for subscribing to a stream.- Specified by:
execute
in interfaceExecutableApiRequest<StreamSubscriptionResult>
- Returns:
StreamSubscriptionRequest
describing the result of theStreamSubscriptionRequest
- Throws:
ZulipClientException
- if the request was not successful
-
withCanRemoveSubscribersGroup(UserGroupSetting)