Class UpdateStreamApiRequest

java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.stream.request.UpdateStreamApiRequest
All Implemented Interfaces:
VoidExecutableApiRequest

public class UpdateStreamApiRequest extends ZulipApiRequest implements VoidExecutableApiRequest
Zulip API request builder for updating a stream.
See Also:
  • Field Details

  • Constructor Details

    • UpdateStreamApiRequest

      public UpdateStreamApiRequest(ZulipHttpClient client, long streamId)
      Parameters:
      client - The Zulip HTTP client
      streamId - The id of the stream to update
  • Method Details

    • withDescription

      public UpdateStreamApiRequest withDescription(String description)
      Sets the updated stream description.
      Parameters:
      description - The description of the stream
      Returns:
      This UpdateStreamApiRequest instance
    • withName

      public UpdateStreamApiRequest withName(String name)
      Sets the updated stream name.
      Parameters:
      name - The name of the stream
      Returns:
      This UpdateStreamApiRequest instance
    • withIsPrivate

      public UpdateStreamApiRequest withIsPrivate(boolean isPrivate)
      Sets the whether the stream is private.
      Parameters:
      isPrivate - true if the stream should be private. false if the stream should be public
      Returns:
      This UpdateStreamApiRequest instance
    • withDefaultStream

      public UpdateStreamApiRequest withDefaultStream(boolean defaultStream)
      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
    • withWebPublic

      public UpdateStreamApiRequest withWebPublic(boolean webPublic)
      Sets whether the stream is a web-public stream.
      Parameters:
      webPublic - true results in any newly created streams created as web0public. false results in created streams being non web-public
      Returns:
      This UpdateStreamApiRequest instance
    • withStreamPostPolicy

      public UpdateStreamApiRequest withStreamPostPolicy(StreamPostPolicy policy)
      Sets the updated policy for which users can post messages to the stream.
      Parameters:
      policy - The StreamPostPolicy that should apply to the stream
      Returns:
      This UpdateStreamApiRequest instance
    • withMessageRetention

      public UpdateStreamApiRequest withMessageRetention(int messageRetentionDays)
      Sets the updated number of days that message history should be retained.
      Parameters:
      messageRetentionDays - The number of days for which message history should be retained
      Returns:
      This UpdateStreamApiRequest instance
    • withMessageRetention

      public UpdateStreamApiRequest withMessageRetention(RetentionPolicy messageRetentionPolicy)
      Sets the updated message retention policy of a stream.
      Parameters:
      messageRetentionPolicy - The RetentionPolicy that should apply to the stream
      Returns:
      This UpdateStreamApiRequest instance
    • withHistoryPublicToSubscribers

      public UpdateStreamApiRequest 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 UpdateStreamApiRequest instance
    • withCanRemoveSubscribersGroup

      public UpdateStreamApiRequest withCanRemoveSubscribersGroup(long userGroupID)
      Sets the updated 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 UpdateStreamApiRequest instance
    • execute

      public void execute() throws ZulipClientException
      Executes the Zulip API request for updating a stream.
      Specified by:
      execute in interface VoidExecutableApiRequest
      Throws:
      ZulipClientException - if the request was not successful