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 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
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
CreateChannelApiRequest
instance - 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
-true
to send an announcement.false
to not send an announcement.- Returns:
- This
CreateChannelApiRequest
instance
-
withInviteOnly
Sets whether the newly created channel will be a private channel. https://zulip.com/api/create-channel#parameter-invite_only- Parameters:
inviteOnly
-true
to create the channel as a private channel.false
to create as a public channel- Returns:
- This
CreateChannelApiRequest
instance
-
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
-true
to create the channel as web public.false
to not create as web public- Returns:
- This
CreateChannelApiRequest
instance
-
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
-true
create the channel as a default channel.false
to not create as a default channel- Returns:
- This
CreateChannelApiRequest
instance
-
withFolderId
Sets the id of the folder to which the channel belongs.- Parameters:
folderId
- The id of the folder- Returns:
- This
CreateChannelApiRequest
instance
-
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
-true
to have any other users newly subscribed via this request be sent a notification bot direct message.false
to not have newly subscribed users notified- Returns:
- This
CreateChannelApiRequest
instance - 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
CreateChannelApiRequest
instance
-
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
-true
to make channel history available to newly subscribed members.false
to make channel history unavailable to newly subscribed members- Returns:
- This
CreateChannelApiRequest
instance
-
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
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
for users who have permission to add subscribers to this channel- Returns:
- This
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
for users who have permission to delete any message in the channel- Returns:
- This
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
for users who have permission to delete the messages that they have sent in the channel- Returns:
- This
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
whose members are allowed to unsubscribe others from the stream- Returns:
- This
CreateChannelApiRequest
instance
-
withCanAdministerChannelGroup
Set the users who have permission to administer this stream. https://zulip.com/api/create-channel#parameter-can_administer_channel_group- Parameters:
userGroupSetting
- TheUserGroupSetting
determining which members are allowed to subscribe others to the stream- Returns:
- This
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
for users who have permission to move messages out of this channel- Returns:
- This
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
for users who have permission to move messages within this channel- Returns:
- This
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
determining which members are allowed to subscribe others to the stream- Returns:
- This
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
for users who have permission to subscribe themselves to this channel- Returns:
- This
CreateChannelApiRequest
instance
-
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
- TheUserGroupSetting
for users who have permission to resolve topics in the channel- Returns:
- This
CreateChannelApiRequest
instance
-
execute
Executes the Zulip API request for creating new channel.- Specified by:
execute
in interfaceExecutableApiRequest<Long>
- Returns:
- The response for type T
- Throws:
ZulipClientException
- if the request was not successful
-