ConstructorIOConfig

public struct ConstructorIOConfig

Struct encapsulating the configuration options needed to make requests

  • The API key

    Declaration

    Swift

    public let apiKey: String
  • The default number of results to request for

    Declaration

    Swift

    public var resultCount: AutocompleteResultCount?
  • The default section to request items from

    Declaration

    Swift

    public var defaultItemSectionName: String?
  • List of test cell information to associate with requests

    Declaration

    Swift

    public var testCells: [CIOABTestCell]?
  • List of segments to associate with requests

    Declaration

    Swift

    public var segments: [String]?
  • The base URL to make requests to

    Declaration

    Swift

    public var baseURL: String?
  • The base URL to make requests to

    Declaration

    Swift

    public var baseQuizURL: String?
  • Create a configuration object

    Usage Example:

    let config = ConstructorIOConfig(
       apiKey: "YOUR API KEY",
       resultCount: AutocompleteResultCount(numResultsForSection: ["Search Suggestions": 3, "Products": 0]),
       defaultItemSectionName: "Products",
       segments: ["Android", "US"],
       testCells: [
           CIOABTestCell(key: "search", value: "constructor"),
           CIOABTestCell(key: "autosuggest", value: "control")
       ],
       baseURL: "ac.cnstrc.com"
    )
    

    Declaration

    Swift

    public init(apiKey: String, resultCount: AutocompleteResultCount? = nil, defaultItemSectionName: String? = nil, testCells: [CIOABTestCell]? = nil, segments: [String]? = nil, baseURL: String? = nil, baseQuizURL: String? = nil)

    Parameters

    apiKey

    The API Key

    resultCount

    The default number of results to request for

    defaultItemSectionName

    The default section to request items from

    testCells

    List of test cell information to associate with requests

    segments

    List of segments to associate with requets

    baseURL

    The base URL to make requests to

    baseQuizURL

    The base Quiz URL to make requests to