DeleteBounces
public class DeleteBounces : SuppressionListDeleter<Bounce>
The DeleteBounces
class represents the API call to delete from the
bounce list.
You can use it to delete the entire list, or specific entries from the
list.
Delete All Bounces
To delete all bounces, use the request returned from
DeleteBounces.all
. This request will delete all bounces on your
bounce list.
do {
let request = DeleteBounces.all
try Session.shared.send(request: request) { result in
switch result {
case .success(let response):
print(response.statusCode)
case .failure(let err):
print(err)
}
}
} catch {
print(error)
}
Delete Specific Bounces
To delete specific entries from your bounce list, use the
DeleteBounces
class. You can either specify email addresses (as
strings), or you can use Bounce
instances (useful for if you just retrieved
some from the RetrieveBounces
class).
do {
let request = DeleteBounces(emails: "foo@example.none", "bar@example.none")
try Session.shared.send(request: request) { result in
switch result {
case .success(let response):
print(response.statusCode)
case .failure(let err):
print(err)
}
}
} catch {
print(error)
}
-
Returns a request that will delete all the entries on your bounce list.
Declaration
Swift
public static var all: DeleteBounces { get }