Criteria API
The criteria module provides classes for building search criteria for the 1WorldSync Content1 API.
DateRangeCriteria
SortField
ProductCriteria
- class oneworldsync.criteria.ProductCriteria[source]
Bases:
objectBuilder for product search criteria
- with_gtin(gtins)[source]
Add GTIN criteria
- Parameters:
gtins (List[str]) – List of GTINs to search for
- Returns:
Self for chaining
- Return type:
- with_ip_gln(ip_gln)[source]
Add Information Provider GLN criteria
- Parameters:
ip_gln (str) – Information Provider GLN
- Returns:
Self for chaining
- Return type:
- with_target_market(target_market)[source]
Add target market criteria
- Parameters:
target_market (str) – Target market code (e.g., ‘US’)
- Returns:
Self for chaining
- Return type:
- with_last_modified_date(date_range)[source]
Add last modified date criteria
- Parameters:
date_range (Dict) – Date range criteria created with DateRangeCriteria
- Returns:
Self for chaining
- Return type:
- with_brand_name(brand_name)[source]
Add brand name criteria
- Parameters:
brand_name (str) – Brand name to search for
- Returns:
Self for chaining
- Return type:
- with_product_type(product_type)[source]
Add product type criteria
- Parameters:
product_type (str) – Product type (e.g., ‘EA’)
- Returns:
Self for chaining
- Return type:
- with_consumer_unit(is_consumer_unit)[source]
Add consumer unit criteria
- Parameters:
is_consumer_unit (bool) – Whether the product is a consumer unit
- Returns:
Self for chaining
- Return type:
- with_gpc_code(gpc_code)[source]
Add GPC code criteria
- Parameters:
gpc_code (str) – GPC code to search for
- Returns:
Self for chaining
- Return type:
- with_upc_code(upc_code)[source]
Add UPC code criteria
- Parameters:
upc_code (str) – UPC code to search for
- Returns:
Self for chaining
- Return type:
- with_sort(sort_fields)[source]
Add sort criteria
- Parameters:
sort_fields (List[Dict]) – List of sort fields created with SortField
- Returns:
Self for chaining
- Return type:
- with_fields(include=None, exclude=None)[source]
Add field inclusion/exclusion criteria
- Parameters:
- Returns:
Self for chaining
- Return type:
- with_search_after(search_after)[source]
Add search after criteria for pagination
- Parameters:
search_after (List) – Search after token from previous response
- Returns:
Self for chaining
- Return type: