CIOBrowseItemsQueryBuilder

public class CIOBrowseItemsQueryBuilder

Request builder for creating an browse items query.

  • Create a Browse Items request query builder

    Declaration

    Swift

    public init(ids: [String])
  • Add additional filters

    Declaration

    Swift

    public func setFilters(_ filters: CIOQueryFilters) -> CIOBrowseItemsQueryBuilder
  • Add a sort option

    Declaration

    Swift

    public func setSortOption(_ sortOption: CIOSortOption) -> CIOBrowseItemsQueryBuilder
  • Add a page number

    Declaration

    Swift

    public func setPage(_ page: Int) -> CIOBrowseItemsQueryBuilder
  • Add the number of results to return per page

    Declaration

    Swift

    public func setPerPage(_ perPage: Int) -> CIOBrowseItemsQueryBuilder
  • Add the number of results to return per page

    Declaration

    Swift

    public func setSection(_ section: String) -> CIOBrowseItemsQueryBuilder
  • Add a list of hidden metadata fields to return

    Declaration

    Swift

    public func setHiddenFields(_ hiddenFields: [String]) -> CIOBrowseItemsQueryBuilder
  • Add a list of hidden facets to return

    Declaration

    Swift

    public func setHiddenFacets(_ hiddenFacets: [String]) -> CIOBrowseItemsQueryBuilder
  • Add a variations map to return per variation

    Declaration

    Swift

    public func setVariationsMap(_ variationsMap: CIOQueryVariationsMap) -> CIOBrowseItemsQueryBuilder
  • Add a groups sort option

    Declaration

    Swift

    public func setGroupsSortOption(_ groupsSortOption: CIOGroupsSortOption) -> CIOBrowseItemsQueryBuilder
  • Build the request object set all of the provided data

    Usage Example:

    let facetFilters = [(key: "Nutrition", value: "Organic"),
                        (key: "Nutrition", value: "Natural"),
                        (key: "Brand", value: "Kraft Foods")]
    
    let query = CIOBrowseItemsQueryBuilder(ids: ["123", "123"])
       .setFilters(CIOQueryFilters(groupFilter: nil, facetFilters: facetFilters))
       .setPage(2)
       .setPerPage(40)
       .setSection("Products")
       .setHiddenFields(["hidden_price_field", "color_swatches"])
       .setHiddenFacets(["hidden_facet"])
       .build()
    
    constructor.browseItems(forQuery: query, completionHandler: { ... })
    

    Declaration

    Swift

    public func build() -> CIOBrowseItemsQuery