Class GetStreamsApiRequest

java.lang.Object
com.github.jamesnetherton.zulip.client.api.core.ZulipApiRequest
com.github.jamesnetherton.zulip.client.api.stream.request.GetStreamsApiRequest
All Implemented Interfaces:
ExecutableApiRequest<List<Stream>>

public class GetStreamsApiRequest extends ZulipApiRequest implements ExecutableApiRequest<List<Stream>>
Zulip API request builder for getting all streams that the user has access to.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • withIncludePublic

      public GetStreamsApiRequest withIncludePublic(boolean includePublic)
      Sets whether to include public streams.
      Parameters:
      includePublic - true to include public streams. false to exclude public streams.
      Returns:
      This GetStreamsApiRequest instance
    • withIncludeWebPublic

      public GetStreamsApiRequest withIncludeWebPublic(boolean includeWebPublic)
      Sets whether to include web public streams.
      Parameters:
      includeWebPublic - true to include web public streams. false to exclude web public streams.
      Returns:
      This GetStreamsApiRequest instance
    • withIncludeSubscribed

      public GetStreamsApiRequest withIncludeSubscribed(boolean includeSubscribed)
      Sets whether to include all streams that the user is subscribed to.
      Parameters:
      includeSubscribed - true to include all streams that the user is subscribed to. false to exclude all streams that the user is subscribed to.
      Returns:
      This GetStreamsApiRequest instance
    • withIncludeAllActive

      public GetStreamsApiRequest withIncludeAllActive(boolean includeAllActive)
      Sets whether to include active streams.
      Parameters:
      includeAllActive - true to include active streams. false to exclude active streams.
      Returns:
      This GetStreamsApiRequest instance
    • withIncludeDefault

      public GetStreamsApiRequest withIncludeDefault(boolean includeDefault)
      Sets whether to include default streams.
      Parameters:
      includeDefault - true to include default streams. false to exclude default streams.
      Returns:
      This GetStreamsApiRequest instance
    • withOwnerSubscribed

      public GetStreamsApiRequest withOwnerSubscribed(boolean ownerSubscribed)
      If the user is a bot user, this sets whether to include streams that the owner user is subscribed to.
      Parameters:
      ownerSubscribed - true to include owner subscribed streams. false to exclude owner subscribed streams.
      Returns:
      This GetStreamsApiRequest instance
    • execute

      public List<Stream> execute() throws ZulipClientException
      Executes the Zulip API request for getting all streams that the user has access to.
      Specified by:
      execute in interface ExecutableApiRequest<List<Stream>>
      Returns:
      List of Stream objects
      Throws:
      ZulipClientException - if the request was not successful