Class MessagesApi

java.lang.Object
software.xdev.mailpit.client.BaseApi
software.xdev.mailpit.api.MessagesApi

public class MessagesApi extends BaseApi
  • Constructor Details

    • MessagesApi

      public MessagesApi()
    • MessagesApi

      public MessagesApi(ApiClient apiClient)
  • Method Details

    • deleteMessagesParams

      public String deleteMessagesParams(@Nullable DeleteMessagesParamsRequest body) throws ApiException
      Delete messages Delete individual or all messages. If no IDs are provided then all messages are deleted.
      Parameters:
      body - Delete request (optional)
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • deleteMessagesParams

      public String deleteMessagesParams(@Nullable DeleteMessagesParamsRequest body, Map<String,String> additionalHeaders) throws ApiException
      Delete messages Delete individual or all messages. If no IDs are provided then all messages are deleted.
      Parameters:
      body - Delete request (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • deleteSearchParams

      public String deleteSearchParams(@Nonnull String query, @Nullable String tz) throws ApiException
      Delete messages by search Delete all messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/).
      Parameters:
      query - Search query (required)
      tz - [Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` & `after:` searches (eg: \"Pacific/Auckland\"). (optional)
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • deleteSearchParams

      public String deleteSearchParams(@Nonnull String query, @Nullable String tz, Map<String,String> additionalHeaders) throws ApiException
      Delete messages by search Delete all messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/).
      Parameters:
      query - Search query (required)
      tz - [Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` & `after:` searches (eg: \"Pacific/Auckland\"). (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • getMessagesParams

      public MessagesSummary getMessagesParams(@Nullable Long start, @Nullable Long limit) throws ApiException
      List messages Returns messages from the mailbox ordered from newest to oldest.
      Parameters:
      start - Pagination offset (optional, default to 0)
      limit - Limit number of results (optional, default to 50)
      Returns:
      MessagesSummary
      Throws:
      ApiException - if fails to make API call
    • getMessagesParams

      public MessagesSummary getMessagesParams(@Nullable Long start, @Nullable Long limit, Map<String,String> additionalHeaders) throws ApiException
      List messages Returns messages from the mailbox ordered from newest to oldest.
      Parameters:
      start - Pagination offset (optional, default to 0)
      limit - Limit number of results (optional, default to 50)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MessagesSummary
      Throws:
      ApiException - if fails to make API call
    • searchParams

      public MessagesSummary searchParams(@Nonnull String query, @Nullable String start, @Nullable String limit, @Nullable String tz) throws ApiException
      Search messages Returns messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/), sorted by received date (descending).
      Parameters:
      query - Search query (required)
      start - Pagination offset (optional, default to 0)
      limit - Limit results (optional, default to 50)
      tz - Optional [timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` & `after:` searches (eg: \"Pacific/Auckland\"). (optional)
      Returns:
      MessagesSummary
      Throws:
      ApiException - if fails to make API call
    • searchParams

      public MessagesSummary searchParams(@Nonnull String query, @Nullable String start, @Nullable String limit, @Nullable String tz, Map<String,String> additionalHeaders) throws ApiException
      Search messages Returns messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/), sorted by received date (descending).
      Parameters:
      query - Search query (required)
      start - Pagination offset (optional, default to 0)
      limit - Limit results (optional, default to 50)
      tz - Optional [timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` & `after:` searches (eg: \"Pacific/Auckland\"). (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      MessagesSummary
      Throws:
      ApiException - if fails to make API call
    • setReadStatusParams

      public String setReadStatusParams(@Nullable String tz, @Nullable SetReadStatusParamsRequest body) throws ApiException
      Set read status You can optionally provide an array of IDs or a search string. If neither IDs nor search is provided then all mailbox messages are updated.
      Parameters:
      tz - Optional [timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` & `after:` searches (eg: \"Pacific/Auckland\"). (optional)
      body - (optional)
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • setReadStatusParams

      public String setReadStatusParams(@Nullable String tz, @Nullable SetReadStatusParamsRequest body, Map<String,String> additionalHeaders) throws ApiException
      Set read status You can optionally provide an array of IDs or a search string. If neither IDs nor search is provided then all mailbox messages are updated.
      Parameters:
      tz - Optional [timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used only for `before:` & `after:` searches (eg: \"Pacific/Auckland\"). (optional)
      body - (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • invokeAPI

      public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String,String> additionalHeaders) throws ApiException
      Description copied from class: BaseApi
      Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
      Specified by:
      invokeAPI in class BaseApi
      Parameters:
      url - The URL for the request, either full URL or only the path.
      method - The HTTP method for the request.
      request - The request object.
      returnType - The return type.
      additionalHeaders - Additional headers for the request.
      Returns:
      The API response in the specified type.
      Throws:
      ApiException - if fails to make API call.