Package software.xdev.mailpit.api
Class MessagesApi
java.lang.Object
software.xdev.mailpit.client.BaseApi
software.xdev.mailpit.api.MessagesApi
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDelete messages Delete individual or all messages.deleteMessagesParams(DeleteMessagesParamsRequest body, Map<String, String> additionalHeaders) Delete messages Delete individual or all messages.deleteSearchParams(String query, String tz) Delete messages by search Delete all messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/).Delete messages by search Delete all messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/).getMessagesParams(Long start, Long limit) List messages Returns messages from the mailbox ordered from newest to oldest.List messages Returns messages from the mailbox ordered from newest to oldest.<T> TinvokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) Directly invoke the API for the given URL.searchParams(String query, String start, String limit, String tz) Search messages Returns messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/), sorted by received date (descending).searchParams(String query, String start, String limit, String tz, Map<String, String> additionalHeaders) Search messages Returns messages matching [a search](https://mailpit.axllent.org/docs/usage/search-filters/), sorted by received date (descending).Set read status You can optionally provide an array of IDs or a search string.setReadStatusParams(String tz, SetReadStatusParamsRequest body, Map<String, String> additionalHeaders) Set read status You can optionally provide an array of IDs or a search string.Methods inherited from class software.xdev.mailpit.client.BaseApi
getApiClient, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, setApiClient
-
Constructor Details
-
MessagesApi
public MessagesApi() -
MessagesApi
-
-
Method Details
-
deleteMessagesParams
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 ApiExceptionDelete 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
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 ApiExceptionDelete 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 ApiExceptionList 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 ApiExceptionSearch 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 ApiExceptionSet 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 ApiExceptionDescription copied from class:BaseApiDirectly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.- Specified by:
invokeAPIin classBaseApi- 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.
-