Class MessageSearchParams

java.lang.Object
com.mailosaur.models.MessageSearchParams

public class MessageSearchParams extends Object
Parameters for message searching.
  • Constructor Details

    • MessageSearchParams

      public MessageSearchParams()
  • Method Details

    • server

      public String server()
      Gets the identifier of the server hosting the messages.
      Returns:
      The identifier of the server hosting the messages.
    • receivedAfter

      public Long receivedAfter()
      Gets the receivedAfter timestamp.
      Returns:
      The receivedAfter timestamp.
    • page

      public Integer page()
      Gets the page index, used in conjunction with `itemsPerPage` to support pagination.
      Returns:
      Gets the page index (for pagination).
    • itemsPerPage

      public Integer itemsPerPage()
      Gets the limit on the number of results to be returned per page. Can be set between 1 and 1000 items, the default is 50.
      Returns:
      The number of results to be returned per page.
    • timeout

      public Integer timeout()
      Gets how long to wait for a matching result (in milliseconds).
      Returns:
      The time to wait for a matching result (in milliseconds).
    • errorOnTimeout

      public Boolean errorOnTimeout()
      Gets whether or not an error will not be throw if timeout is reached (default: true).
      Returns:
      Whether or not an error will not be throw if timeout is reached (default: true).
    • dir

      public String dir()
      Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`.
      Returns:
      Either `Sent` or `Received`.
    • withServer

      public MessageSearchParams withServer(String server)
      Sets the identifier of the server hosting the messages.
      Parameters:
      server - The identifier of the server hosting the messages.
      Returns:
      the MessageSearchParams object itself.
    • withReceivedAfter

      public MessageSearchParams withReceivedAfter(long receivedAfter)
      Limits results to only messages received after this timestamp.
      Parameters:
      receivedAfter - Limits results to only messages received after this timestamp.
      Returns:
      the MessageSearchParams object itself.
    • withPage

      public MessageSearchParams withPage(int page)
      Sets the page index, used in conjunction with `itemsPerPage` to support pagination.
      Parameters:
      page - Used in conjunction with `itemsPerPage` to support pagination.
      Returns:
      the MessageSearchParams object itself.
    • withItemsPerPage

      public MessageSearchParams withItemsPerPage(int itemsPerPage)
      Set the limit on the number of results to be returned per page. Can be set between 1 and 1000 items, the default is 50.
      Parameters:
      itemsPerPage - A limit on the number of results to be returned per page. Can be set between 1 and 1000 items, the default is 50.
      Returns:
      the MessageSearchParams object itself.
    • withTimeout

      public MessageSearchParams withTimeout(int timeout)
      Sets how long to wait for a matching result (in milliseconds).
      Parameters:
      timeout - The time to wait for a matching result (in milliseconds).
      Returns:
      the MessageSearchParams object itself.
    • withErrorOnTimeout

      public MessageSearchParams withErrorOnTimeout(boolean errorOnTimeout)
      Set whether or not an error will not be throw if timeout is reached (default: true).
      Parameters:
      errorOnTimeout - When set to false, an error will not be throw if timeout is reached (default: true).
      Returns:
      the MessageSearchParams object itself.
    • withDir

      public MessageSearchParams withDir(String dir)
      Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`.
      Parameters:
      dir - Can be either `Sent` or `Received`, with the default being `Received`.
      Returns:
      the MessageSearchParams object itself.