Api v2
This commit is contained in:
30
Sources/OpenFoodFactsSDK/Schemas/SearchParameter.swift
Normal file
30
Sources/OpenFoodFactsSDK/Schemas/SearchParameter.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
import FoundationEssentials
|
||||
|
||||
public enum SearchParameter: Sendable, Hashable {
|
||||
case query(String)
|
||||
case tag(tag: SearchTagType, value: String)
|
||||
case page(Int)
|
||||
case pageSize(Int)
|
||||
case sort(SearchSort)
|
||||
}
|
||||
|
||||
public enum SearchTagType: String, Sendable {
|
||||
case brands
|
||||
case categories
|
||||
case packaging
|
||||
case labels
|
||||
case origins
|
||||
case manufacturingPlaces = "manufacturing_places"
|
||||
case countries
|
||||
case additives
|
||||
case allergens
|
||||
case traces
|
||||
case states
|
||||
}
|
||||
|
||||
public enum SearchSort: String, Sendable {
|
||||
case popularity
|
||||
case productName = "product_name"
|
||||
case created
|
||||
case edited
|
||||
}
|
||||
Reference in New Issue
Block a user