DeleteSpamReports
public class DeleteSpamReports : SuppressionListDeleter<SpamReport>
The DeleteSpamReports
class represents the API call to delete from
the spam report list.
You can use it to delete the entire list, or specific entries from the
list.
Delete All Spam Reports
To delete all spam reports, use the request returned from
DeleteSpamReports.all
. This request will delete all spam reports on
your spam report list.
do {
let request = DeleteSpamReports.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 Spam Reports
To delete specific entries from your spam report list, use the
DeleteSpamReports
class. You can either specify email addresses (as
strings), or you can use SpamReport
instances (useful for if you just
retrieved some from the RetrieveSpamReports
class).
do {
let request = DeleteSpamReports(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 spam report list.
Declaration
Swift
public static var all: DeleteSpamReports { get }