@@ -18,10 +18,10 @@ public struct TrendingItemsQuery: Codable, JSONEncodable {
1818 public var queryParameters : RecommendSearchParams ?
1919 /// Facet attribute. To be used in combination with `facetValue`. If specified, only recommendations matching the
2020 /// facet filter will be returned.
21- public var facetName : String
21+ public var facetName : String ?
2222 /// Facet value. To be used in combination with `facetName`. If specified, only recommendations matching the facet
2323 /// filter will be returned.
24- public var facetValue : String
24+ public var facetValue : String ?
2525 public var model : TrendingItemsModel
2626 public var fallbackParameters : RecommendSearchParamsObject ?
2727
@@ -30,8 +30,8 @@ public struct TrendingItemsQuery: Codable, JSONEncodable {
3030 threshold: Double ,
3131 maxRecommendations: Int ? = nil ,
3232 queryParameters: RecommendSearchParams ? = nil ,
33- facetName: String ,
34- facetValue: String ,
33+ facetName: String ? = nil ,
34+ facetValue: String ? = nil ,
3535 model: TrendingItemsModel ,
3636 fallbackParameters: RecommendSearchParamsObject ? = nil
3737 ) {
@@ -64,8 +64,8 @@ public struct TrendingItemsQuery: Codable, JSONEncodable {
6464 try container. encode ( self . threshold, forKey: . threshold)
6565 try container. encodeIfPresent ( self . maxRecommendations, forKey: . maxRecommendations)
6666 try container. encodeIfPresent ( self . queryParameters, forKey: . queryParameters)
67- try container. encode ( self . facetName, forKey: . facetName)
68- try container. encode ( self . facetValue, forKey: . facetValue)
67+ try container. encodeIfPresent ( self . facetName, forKey: . facetName)
68+ try container. encodeIfPresent ( self . facetValue, forKey: . facetValue)
6969 try container. encode ( self . model, forKey: . model)
7070 try container. encodeIfPresent ( self . fallbackParameters, forKey: . fallbackParameters)
7171 }
@@ -90,8 +90,8 @@ extension TrendingItemsQuery: Hashable {
9090 hasher. combine ( self . threshold. hashValue)
9191 hasher. combine ( self . maxRecommendations? . hashValue)
9292 hasher. combine ( self . queryParameters? . hashValue)
93- hasher. combine ( self . facetName. hashValue)
94- hasher. combine ( self . facetValue. hashValue)
93+ hasher. combine ( self . facetName? . hashValue)
94+ hasher. combine ( self . facetValue? . hashValue)
9595 hasher. combine ( self . model. hashValue)
9696 hasher. combine ( self . fallbackParameters? . hashValue)
9797 }
0 commit comments