Class CreateChannelApiRequest
java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.channel.request.CreateChannelApiRequest
- All Implemented Interfaces:
ExecutableApiRequest<Long>
Zulip API request builder for creating new channel.
- 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 String -
Constructor Summary
ConstructorsConstructorDescriptionCreateChannelApiRequest(ZulipHttpClient client, String name, Long... subscribers) Constructs aZulipApiRequest. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the Zulip API request for creating new channel.withAnnounce(boolean announce) Sets whether the notification bot will send an announcement about the new channel creation.withCanAddSubscribersGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to add subscribers to this channel.withCanAdministerChannelGroup(UserGroupSetting userGroupSetting) Set the users who have permission to administer this stream.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(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) Set the users who have permission to post in this stream.withCanSubscribeGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to subscribe themselves to this channel.withDescription(String description) Sets the description of the channel.withFolderId(int folderId) Sets the id of the folder to which the channel belongs.withHistoryPublicToSubscribers(boolean historyPublicToSubscribers) Sets whether the channel message history should be available to newly subscribed members.withInviteOnly(boolean inviteOnly) Sets whether the newly created channel will be a private channel.withIsDefaultStream(boolean isDefaultStream) Sets whether the newly created channel will be added as a default channel.withIsWebPublic(boolean isWebPublic) Sets whether the newly created channel will be a web public channel.withMessageRetentionDays(int messageRetentionDays) Sets the number of days that messages sent to this channel will be stored before being automatically deleted by the message retention policy.withSendNewSubscriptionMessages(boolean sendNewSubscriptionMessages) Sets whether any other users newly subscribed via this request should be sent a notification bot direct message notifying them about their new subscription.withTopicPolicy(TopicPolicy topicPolicy) Sets whether named topics and the empty topic are enabled in this channel.Methods inherited from class com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
client, getParam, getParam, getParams, putParam, putParamAsJsonString, putParamAsWrappedObject
-
Field Details
-
NAME
- See Also:
-
DESCRIPTION
- See Also:
-
SUBSCRIBERS
- See Also:
-
ANNOUNCE
- See Also:
-
INVITE_ONLY
- See Also:
-
IS_WEB_PUBLIC
- See Also:
-
IS_DEFAULT_STREAM
- See Also:
-
FOLDER_ID
- See Also:
-
SEND_NEW_SUBSCRIPTION_MESSAGES
- See Also:
-
TOPICS_POLICY
- See Also:
-
HISTORY_PUBLIC_TO_SUBSCRIBERS
- See Also:
-
MESSAGE_RETENTION_DAYS
- See Also:
-
CAN_ADD_SUBSCRIBERS_GROUP
- See Also:
-
CAN_DELETE_ANY_MESSAGE_GROUP
- See Also:
-
CAN_DELETE_OWN_MESSAGE_GROUP
- See Also:
-
CAN_REMOVE_SUBSCRIBERS_GROUP
- See Also:
-
CAN_ADMINISTER_CHANNEL_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_RESOLVE_TOPICS_GROUP
- See Also:
-
-
Constructor Details
-
CreateChannelApiRequest
Constructs aZulipApiRequest.- Parameters:
client- The Zulip HTTP clientname- The name of the channelsubscribers- The user ids that should be subscribed to the channel
-
-
Method Details
-
withDescription
Sets the description of the channel.- Parameters:
description- The channel description- Returns:
- This
CreateChannelApiRequestinstance - See Also:
-
withAnnounce
Sets whether the notification bot will send an announcement about the new channel creation. https://zulip.com/api/create-channel#parameter-announce- Parameters:
announce-trueto send an announcement.falseto not send an announcement.- Returns:
- This
CreateChannelApiRequestinstance
-
withInviteOnly
Sets whether the newly created channel will be a private channel. https://zulip.com/api/create-channel#parameter-invite_only- Parameters:
inviteOnly-trueto create the channel as a private channel.falseto create as a public channel- Returns:
- This
CreateChannelApiRequestinstance
-
withIsWebPublic
Sets whether the newly created channel will be a web public channel. https://zulip.com/api/create-channel#parameter-is_web_public- Parameters:
isWebPublic-trueto create the channel as web public.falseto not create as web public- Returns:
- This
CreateChannelApiRequestinstance
-
withIsDefaultStream
Sets whether the newly created channel will be added as a default channel. https://zulip.com/api/create-channel#parameter-is_default_stream- Parameters:
isDefaultStream-truecreate the channel as a default channel.falseto not create as a default channel- Returns:
- This
CreateChannelApiRequestinstance
-
withFolderId
Sets the id of the folder to which the channel belongs.- Parameters:
folderId- The id of the folder- Returns:
- This
CreateChannelApiRequestinstance
-
withSendNewSubscriptionMessages
Sets whether any other users newly subscribed via this request should be sent a notification bot direct message notifying them about their new subscription.- Parameters:
sendNewSubscriptionMessages-trueto have any other users newly subscribed via this request be sent a notification bot direct message.falseto not have newly subscribed users notified- Returns:
- This
CreateChannelApiRequestinstance - See Also:
-
withTopicPolicy
Sets whether named topics and the empty topic are enabled in this channel. https://zulip.com/api/create-channel#parameter-topics_policy- Parameters:
topicPolicy- TheTopicPolicy- Returns:
- This
CreateChannelApiRequestinstance
-
withHistoryPublicToSubscribers
Sets whether the channel message history should be available to newly subscribed members. https://zulip.com/api/create-channel#parameter-history_public_to_subscribers- Parameters:
historyPublicToSubscribers-trueto make channel history available to newly subscribed members.falseto make channel history unavailable to newly subscribed members- Returns:
- This
CreateChannelApiRequestinstance
-
withMessageRetentionDays
Sets the number of days that messages sent to this channel will be stored before being automatically deleted by the message retention policy. https://zulip.com/api/create-channel#parameter-message_retention_days- Parameters:
messageRetentionDays- The number of days that messages sent to this channel will be stored before being automatically deleted by the message retention policy- Returns:
- This
CreateChannelApiRequestinstance
-
withCanAddSubscribersGroup
Sets the user group settings for users who have permission to add subscribers to this channel. https://zulip.com/api/create-channel#parameter-can_add_subscribers_group- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to add subscribers to this channel- Returns:
- This
CreateChannelApiRequestinstance
-
withCanDeleteAnyMessageGroup
Sets the user group settings for users who have permission to delete any message in the channel. https://zulip.com/api/create-channel#parameter-can_delete_any_message_group- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to delete any message in the channel- Returns:
- This
CreateChannelApiRequestinstance
-
withCanDeleteOwnMessageGroup
Sets the user group settings for users who have permission to delete the messages that they have sent in the channel. https://zulip.com/api/create-channel#parameter-can_delete_own_message_group- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to delete the messages that they have sent in the channel- Returns:
- This
CreateChannelApiRequestinstance
-
withCanRemoveSubscribersGroup
Sets the user group id whose members are allowed to unsubscribe others from the stream. https://zulip.com/api/create-channel#parameter-can_remove_subscribers_group- Parameters:
userGroupSetting- TheUserGroupSettingwhose members are allowed to unsubscribe others from the stream- Returns:
- This
CreateChannelApiRequestinstance
-
withCanAdministerChannelGroup
Set the users who have permission to administer this stream. https://zulip.com/api/create-channel#parameter-can_administer_channel_group- Parameters:
userGroupSetting- TheUserGroupSettingdetermining which members are allowed to subscribe others to the stream- Returns:
- This
CreateChannelApiRequestinstance
-
withCanMoveMessagesOutOfChannelGroup
public CreateChannelApiRequest withCanMoveMessagesOutOfChannelGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to move messages out of this channel. https://zulip.com/api/create-channel#parameter-can_move_messages_out_of_channel_group- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to move messages out of this channel- Returns:
- This
CreateChannelApiRequestinstance
-
withCanMoveMessagesWithinChannelGroup
public CreateChannelApiRequest withCanMoveMessagesWithinChannelGroup(UserGroupSetting userGroupSetting) Sets the user group settings for users who have permission to move messages within this channel. https://zulip.com/api/create-channel#parameter-can_move_messages_within_channel_group- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to move messages within this channel- Returns:
- This
CreateChannelApiRequestinstance
-
withCanSendMessageGroup
Set the users who have permission to post in this stream. https://zulip.com/api/create-channel#parameter-can_send_message_group- Parameters:
userGroupSetting- TheUserGroupSettingdetermining which members are allowed to subscribe others to the stream- Returns:
- This
CreateChannelApiRequestinstance
-
withCanSubscribeGroup
Sets the user group settings for users who have permission to subscribe themselves to this channel. https://zulip.com/api/create-channel#parameter-can_subscribe_group- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to subscribe themselves to this channel- Returns:
- This
CreateChannelApiRequestinstance
-
withCanResolveTopicsGroup
Sets the user group settings for users who have permission to resolve topics in the channel. https://zulip.com/api/create-channel#parameter-can_resolve_topics_group- Parameters:
userGroupSetting- TheUserGroupSettingfor users who have permission to resolve topics in the channel- Returns:
- This
CreateChannelApiRequestinstance
-
execute
Executes the Zulip API request for creating new channel.- Specified by:
executein interfaceExecutableApiRequest<Long>- Returns:
- The response for type T
- Throws:
ZulipClientException- if the request was not successful
-