Class SuppressionsImpl

java.lang.Object
io.mailtrap.api.apiresource.ApiResource
io.mailtrap.api.suppressions.SuppressionsImpl
All Implemented Interfaces:
Suppressions

public class SuppressionsImpl extends ApiResource implements Suppressions
  • Constructor Details

  • Method Details

    • search

      public List<SuppressionsResponse> search(long accountId, String email)
      Description copied from interface: Suppressions
      List and search suppressions by email. The endpoint returns up to 1000 suppressions per request.
      Specified by:
      search in interface Suppressions
      Parameters:
      accountId - - unique account ID
      email - - search suppressions for this email
      Returns:
      a list of suppressions
    • search

      public List<SuppressionsResponse> search(long accountId, SuppressionListFilter filter)
      Description copied from interface: Suppressions
      List and search suppressions. The endpoint returns up to 1000 suppressions per request; pass the last returned ID as lastId to fetch the next page.
      Specified by:
      search in interface Suppressions
      Parameters:
      accountId - - unique account ID
      filter - - optional filtering and pagination parameters
      Returns:
      a list of suppressions
    • createSuppression

      public SuppressionsResponse createSuppression(long accountId, CreateSuppressionRequest request)
      Description copied from interface: Suppressions
      Add an email address to the account's suppression list.
      Specified by:
      createSuppression in interface Suppressions
      Parameters:
      accountId - - unique account ID
      request - - request data
      Returns:
      the created suppression
    • deleteSuppression

      public SuppressionsResponse deleteSuppression(long accountId, String suppressionId)
      Description copied from interface: Suppressions
      Delete a suppression by ID. Mailtrap will no longer prevent sending to this email unless it's recorded in suppressions again.
      Specified by:
      deleteSuppression in interface Suppressions
      Parameters:
      accountId - - unique account ID
      suppressionId - - unique suppression ID
      Returns:
      the attributes of the deleted suppression