Skip to content

Commit

Permalink
chore(deps): dependencies 2025-01-06 [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4299

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Algolia Bot <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Clément Vannicatte <[email protected]>
  • Loading branch information
4 people committed Jan 6, 2025
1 parent af3bd60 commit 1523ed4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation
import Core
#endif

public struct EventScoring: Codable, JSONEncodable {
public struct EventsScoring: Codable, JSONEncodable {
/// Event score.
public var score: Int
/// Event name.
Expand Down Expand Up @@ -35,15 +35,15 @@ public struct EventScoring: Codable, JSONEncodable {
}
}

extension EventScoring: Equatable {
public static func ==(lhs: EventScoring, rhs: EventScoring) -> Bool {
extension EventsScoring: Equatable {
public static func ==(lhs: EventsScoring, rhs: EventsScoring) -> Bool {
lhs.score == rhs.score &&
lhs.eventName == rhs.eventName &&
lhs.eventType == rhs.eventType
}
}

extension EventScoring: Hashable {
extension EventsScoring: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.score.hashValue)
hasher.combine(self.eventName.hashValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation
import Core
#endif

public struct FacetScoring: Codable, JSONEncodable {
public struct FacetsScoring: Codable, JSONEncodable {
/// Event score.
public var score: Int
/// Facet attribute name.
Expand All @@ -31,14 +31,14 @@ public struct FacetScoring: Codable, JSONEncodable {
}
}

extension FacetScoring: Equatable {
public static func ==(lhs: FacetScoring, rhs: FacetScoring) -> Bool {
extension FacetsScoring: Equatable {
public static func ==(lhs: FacetsScoring, rhs: FacetsScoring) -> Bool {
lhs.score == rhs.score &&
lhs.facetName == rhs.facetName
}
}

extension FacetScoring: Hashable {
extension FacetsScoring: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.score.hashValue)
hasher.combine(self.facetName.hashValue)
Expand Down
26 changes: 13 additions & 13 deletions Sources/Personalization/Models/PersonalizationStrategyParams.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,48 @@ import Foundation
public struct PersonalizationStrategyParams: Codable, JSONEncodable {
/// Scores associated with each event. The higher the scores, the higher the impact of those events on the
/// personalization of search results.
public var eventScoring: [EventScoring]
public var eventsScoring: [EventsScoring]
/// Scores associated with each facet. The higher the scores, the higher the impact of those events on the
/// personalization of search results.
public var facetScoring: [FacetScoring]
public var facetsScoring: [FacetsScoring]
/// Impact of personalization on the search results. If set to 0, personalization has no impact on the search
/// results.
public var personalizationImpact: Int

public init(eventScoring: [EventScoring], facetScoring: [FacetScoring], personalizationImpact: Int) {
self.eventScoring = eventScoring
self.facetScoring = facetScoring
public init(eventsScoring: [EventsScoring], facetsScoring: [FacetsScoring], personalizationImpact: Int) {
self.eventsScoring = eventsScoring
self.facetsScoring = facetsScoring
self.personalizationImpact = personalizationImpact
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case eventScoring
case facetScoring
case eventsScoring
case facetsScoring
case personalizationImpact
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.eventScoring, forKey: .eventScoring)
try container.encode(self.facetScoring, forKey: .facetScoring)
try container.encode(self.eventsScoring, forKey: .eventsScoring)
try container.encode(self.facetsScoring, forKey: .facetsScoring)
try container.encode(self.personalizationImpact, forKey: .personalizationImpact)
}
}

extension PersonalizationStrategyParams: Equatable {
public static func ==(lhs: PersonalizationStrategyParams, rhs: PersonalizationStrategyParams) -> Bool {
lhs.eventScoring == rhs.eventScoring &&
lhs.facetScoring == rhs.facetScoring &&
lhs.eventsScoring == rhs.eventsScoring &&
lhs.facetsScoring == rhs.facetsScoring &&
lhs.personalizationImpact == rhs.personalizationImpact
}
}

extension PersonalizationStrategyParams: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.eventScoring.hashValue)
hasher.combine(self.facetScoring.hashValue)
hasher.combine(self.eventsScoring.hashValue)
hasher.combine(self.facetsScoring.hashValue)
hasher.combine(self.personalizationImpact.hashValue)
}
}

0 comments on commit 1523ed4

Please sign in to comment.