PreferencesAPI

public enum PreferencesAPI

Caseless enumeration with static methods to send Preference Requests

  • Sends a request to get preferences from the API.

    Declaration

    Swift

    public static func getPreferences(with parameters: Parameters? = nil,
                                      completion: ResponseCompletion<[Preference]> = nil)

    Parameters

    parameters

    The Parameters to apply.

    completion

    The closure to be executed once the request has finished.

  • Sends a request to create a new domain inside a named preference.

    Declaration

    Swift

    public static func addDomain(domain: String,
                                 preferenceName: String,
                                 completion: ResponseCompletion<Bool> = nil)

    Parameters

    domain

    The new domain that will be created.

    preference

    Preference in which the new domain will be created into.

    completion

    The closure to be executed once the request has finished.

  • Sends a request to delete an existing domain inside a named preference.

    Declaration

    Swift

    public static func deleteDomain(domain: String,
                                    preferenceName: String,
                                    completion: ResponseCompletion<Bool> = nil)

    Parameters

    domain

    The domain that will be deleted.

    preference

    Preference in which the domain will be deleted from.

    completion

    The closure to be executed once the request has finished.

  • Sends a request to select domain(s) inside a named preference.

    Declaration

    Swift

    public static func selectDomains(domains: [String],
                                     preferenceName: String,
                                     isMultiSelect: Bool,
                                     completion: ResponseCompletion<Bool> = nil)

    Parameters

    domains

    Array of domain that will be selected.

    preference

    Preference in which the domains will be selected from.

    completion

    The closure to be executed once the request has finished.