Recommendations and Documents
Recommendations
RecommendationResponse
Model representing a response with recommendations.
Declared In:
lib/model/content/recommendation_response.dart
Related To:
Recommendation
Declaration:
class RecommendationResponse
Properties:
Property | Type | Optional | Description |
---|---|---|---|
name | String | no | Recommendation’s name |
campaignHash | String | no | Campaign hash |
campaignID | String | no | Campaign ID |
items | List<Recommendation> | no | List of items in the recommendation |
correlationID | String | no | Recommendation’s correlation ID. It can be added to a recommendation.click event to associate it with the recommendation request |
schema | String | no | Recommendation’s schema type |
slug | String | no | Slug name |
uuid | String | no | Recommendation’s UUID |
Recommendation
Model representating a recommendation item data.
Declared In:
lib/model/content/recommendation.dart
Related To:
RecommendationResponse
Declaration:
class Recommendation
Properties:
Property | Type | Optional | Description |
---|---|---|---|
itemID | String | no | Product’s GTIN |
attributes | Map<String, Object> | no | Product’s recommendation attributes |
RecommendationOptions
Declared In:
lib/model/content/recommendation_options.dart
Related To:
RecommendationFiltersJoinerRule
Declaration:
class RecommendationOptions
Properties:
Property | Type | Optional | Description |
---|---|---|---|
slug | String | no | Unique identifier of a specific recommendation |
productID | String | yes | Item identifier (for single ID) |
productIDs | List |
yes | List of item identifiers (for multiple IDs) |
itemsExcluded | List |
yes | Items that will be excluded from the generated recommendations |
additionalFilters | String | yes | Additional filters. These are merged with the campaign’s own filters according to the logic in filtersJoiner |
filtersJoiner | RecommendationFiltersJoinerRule | yes | Defines the logic of merging additionalFilters with the campaign’s existing filters |
additionalElasticFilters | String | yes | Additional elastic filters. These are merged with the campaign’s own elastic filters according to the logic in elasticFiltersJoiner |
elasticFiltersJoiner | RecommendationFiltersJoinerRule | yes | Defines the logic of merging additionalElasticFilters with the campaign’s existing elastic filters |
displayAttribute | List |
yes | An array of item attributes which value will be returned in a recommendation response |
includeContextItems | bool | yes | When true, the recommendation response will include context item metadata |
Initializers:
RecommendationOptions recommendationOptions = RecommendationOptions(
slug: slug,
productID: productId);
RecommendationFiltersJoinerRule
Declared In:
lib/model/content/recommendation_options.dart
Declaration:
enum RecommendationFiltersJoinerRule {
and('and'),
or('or'),
replace('replace');
Functions: Converts from RecommendationFiltersJoinerRule to String.
String recommendationFiltersJoinerRuleAsString()
Converts from String to RecommendationFiltersJoinerRule.
static RecommendationFiltersJoinerRule? getRecommendationFiltersJoinerRuleFromString(String string)
Documents
DocumentsApiQuery
The object to set parameters easily for fetching documents from API.
Declared In:
lib/model/content/documents_api_query.dart
Related To:
DocumentsApiQueryType
Declaration:
class DocumentsApiQuery
Properties:
Property | Type | Optional | Default | Description |
---|---|---|---|---|
type | DocumentsApiQueryType | no | .bySchema | Query type |
typeValue | String | no | null | Value for query type |
version | String | yes | null | Specifies the document version |
Initializers:
DocumentsApiQuery({required this.type, required this.typeValue, this.version})
DocumentsApiQueryType
Declared In:
lib/enums/content/documents_api_query_type.dart
Declaration:
enum DocumentsApiQueryType {
schema('by-schema');
}
DocumentApiQuery
Object for setting parameters to facilitate fetching documents from the API.
Declared In:
lib/model/content/document_api_query.dart
Declaration:
class DocumentApiQuery
Properties:
Property | Type | Optional | Description |
---|---|---|---|
slug | String | no | Unique identifier of a document |
Properties used only if the document includes a recommendation insert:
Property | Type | Optional | Description |
---|---|---|---|
productId | String | yes | Item identifier of the context item |
itemsIds | List |
yes | List of item identifiers, used for multiple item context |
itemsExcluded | List |
yes | Items that will be excluded from the generated recommendations |
additionalFilters | String | yes | Additional filters. These are merged with the campaign’s own filters according to the logic in filtersJoiner |
filtersJoiner | RecommendationFiltersJoinerRule | no | Defines the logic of merging additionalFilters with the campaign’s existing filters |
additionalElasticFilters | String | yes | Additional elastic filters. These are merged with the campaign’s own elastic filters according to the logic in elasticFiltersJoiner |
elasticFiltersJoiner | RecommendationFiltersJoinerRule | no | Defines the logic of merging additionalElasticFilters with the campaign’s existing elastic filters |
displayAttribute | List |
yes | An array of item attributes which value will be returned in a recommendation response |
includeContextItems | bool | yes | When true, the recommendation response will include context item metadata |
Initializers:
DocumentApiQuery({
required this.slug,
this.productId,
this.itemsIds,
this.itemsExcluded,
this.additionalFilters,
this.filtersJoiner,
this.additionalElasticFilters,
this.elasticFiltersJoiner,
this.displayAttribute,
this.includeContextItems = false
});
Document
Declared In:
lib/model/content/document.dart
Declaration:
class Document
Properties:
Property | Type | Optional | Description |
---|---|---|---|
identifier | String | no | Document’s identifier |
slug | String | no | Document’s slug |
schema | String | no | Document’s schema type |
content | Map<String, Object> | yes | Document’s content |