AddGlobalUnsubscribes

public class AddGlobalUnsubscribes : ModeledRequest<AddGlobalUnsubscribes.Parameters, AddGlobalUnsubscribes.Parameters>

The AddGlobalUnsubscribes class represents the API call to add email addresses to the global unsubscribe list.

You can specify email addresses (as strings), or you can use Address instances.

do {
    let request = AddGlobalUnsubscribes(emails: "foo@example.none", "bar@example.none")
    try Session.shared.send(modeledRequest: request) { result in
        switch result {
        case .success(let response, _):
            print(response.statusCode)
        case .failure(let err):
            print(err)
        }
    }
} catch {
    print(error)
}
  • Initializes the request with a list of email addresses to add to the global unsubscribe list.

    Declaration

    Swift

    public init(emails: [String])

    Parameters

    emails

    An array of email addresses to add to the global unsubscribe list.

  • Initializes the request with a list of email addresses to add to the global unsubscribe list.

    Declaration

    Swift

    public convenience init(emails: String...)

    Parameters

    emails

    An array of email addresses to add to the global unsubscribe list.

  • Initializes the request with a list of addresses to add to the global unsubscribe list.

    Declaration

    Swift

    public convenience init(addresses: [Address])

    Parameters

    emails

    An array of addresses to add to the global unsubscribe list.

  • Initializes the request with a list of addresses to add to the global unsubscribe list.

    Declaration

    Swift

    public convenience init(addresses: Address...)

    Parameters

    emails

    An array of addresses to add to the global unsubscribe list.

  • The AddGlobalUnsubscribes.Parameters struct houses the parameters used to add email addresses to the global unsubscribe list.

    See more

    Declaration

    Swift

    struct Parameters : Codable