Skip to content

Commit

Permalink
chore(deps): dependencies 2024-08-19 (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3530

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: shortcuts <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
  • Loading branch information
5 people committed Aug 26, 2024
1 parent 737fa9e commit 5d87d3a
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
#endif

/// Currency code.
public struct CurrenciesValue: Codable, JSONEncodable {
public struct CurrencyCode: Codable, JSONEncodable {
/// Currency code.
public var currency: String?
/// Revenue associated with this search in this currency.
Expand All @@ -32,14 +32,14 @@ public struct CurrenciesValue: Codable, JSONEncodable {
}
}

extension CurrenciesValue: Equatable {
public static func ==(lhs: CurrenciesValue, rhs: CurrenciesValue) -> Bool {
extension CurrencyCode: Equatable {
public static func ==(lhs: CurrencyCode, rhs: CurrencyCode) -> Bool {
lhs.currency == rhs.currency &&
lhs.revenue == rhs.revenue
}
}

extension CurrenciesValue: Hashable {
extension CurrencyCode: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.currency?.hashValue)
hasher.combine(self.revenue?.hashValue)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Analytics/Models/DailyRevenue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import Foundation

public struct DailyRevenue: Codable, JSONEncodable {
/// Revenue associated with this search, broken-down by currencies.
public var currencies: [String: CurrenciesValue]
public var currencies: [String: CurrencyCode]
/// Date in the format YYYY-MM-DD.
public var date: String

public init(currencies: [String: CurrenciesValue], date: String) {
public init(currencies: [String: CurrencyCode], date: String) {
self.currencies = currencies
self.date = date
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Analytics/Models/GetRevenue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import Foundation

public struct GetRevenue: Codable, JSONEncodable {
/// Revenue associated with this search, broken-down by currencies.
public var currencies: [String: CurrenciesValue]
public var currencies: [String: CurrencyCode]
/// Daily revenue.
public var dates: [DailyRevenue]

public init(currencies: [String: CurrenciesValue], dates: [DailyRevenue]) {
public init(currencies: [String: CurrencyCode], dates: [DailyRevenue]) {
self.currencies = currencies
self.dates = dates
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Analytics/Models/TopHitWithRevenueAnalytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public struct TopHitWithRevenueAnalytics: Codable, JSONEncodable {
/// Number of purchase events from this search.
public var purchaseCount: Int
/// Revenue associated with this search, broken-down by currencies.
public var currencies: [String: CurrenciesValue]
public var currencies: [String: CurrencyCode]

public init(
hit: String,
Expand All @@ -50,7 +50,7 @@ public struct TopHitWithRevenueAnalytics: Codable, JSONEncodable {
addToCartCount: Int,
purchaseRate: Double?,
purchaseCount: Int,
currencies: [String: CurrenciesValue]
currencies: [String: CurrencyCode]
) {
self.hit = hit
self.count = count
Expand Down
4 changes: 2 additions & 2 deletions Sources/Analytics/Models/TopSearchWithRevenueAnalytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public struct TopSearchWithRevenueAnalytics: Codable, JSONEncodable {
/// Number of results (hits).
public var nbHits: Int
/// Revenue associated with this search, broken-down by currencies.
public var currencies: [String: CurrenciesValue]
public var currencies: [String: CurrencyCode]
/// Add-to-cart rate, calculated as number of tracked searches with at least one add-to-cart event divided by the
/// number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to
/// true.
Expand All @@ -56,7 +56,7 @@ public struct TopSearchWithRevenueAnalytics: Codable, JSONEncodable {
clickCount: Int,
conversionCount: Int,
nbHits: Int,
currencies: [String: CurrenciesValue],
currencies: [String: CurrencyCode],
addToCartRate: Double?,
addToCartCount: Int,
purchaseRate: Double?,
Expand Down
8 changes: 4 additions & 4 deletions Sources/Recommend/Models/RecommendBaseSearchResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct RecommendBaseSearchResponse: Codable, JSONEncodable {
/// Facet counts.
public var facets: [String: [String: Int]]?
/// Statistics for numerical facets.
public var facetsStats: [String: RecommendFacetsStats]?
public var facetsStats: [String: RecommendFacetStats]?
/// Index name used for the query.
public var index: String?
/// Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query.
Expand Down Expand Up @@ -69,7 +69,7 @@ public struct RecommendBaseSearchResponse: Codable, JSONEncodable {
exhaustiveNbHits: Bool? = nil,
exhaustiveTypo: Bool? = nil,
facets: [String: [String: Int]]? = nil,
facetsStats: [String: RecommendFacetsStats]? = nil,
facetsStats: [String: RecommendFacetStats]? = nil,
index: String? = nil,
indexUsed: String? = nil,
message: String? = nil,
Expand Down Expand Up @@ -172,7 +172,7 @@ public struct RecommendBaseSearchResponse: Codable, JSONEncodable {

self.facets = dictionary["facets"]?.value as? [String: [String: Int]]

self.facetsStats = dictionary["facetsStats"]?.value as? [String: RecommendFacetsStats]
self.facetsStats = dictionary["facetsStats"]?.value as? [String: RecommendFacetStats]

self.index = dictionary["index"]?.value as? String

Expand Down Expand Up @@ -264,7 +264,7 @@ public struct RecommendBaseSearchResponse: Codable, JSONEncodable {
self.exhaustiveNbHits = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveNbHits)
self.exhaustiveTypo = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveTypo)
self.facets = try container.decodeIfPresent([String: [String: Int]].self, forKey: .facets)
self.facetsStats = try container.decodeIfPresent([String: RecommendFacetsStats].self, forKey: .facetsStats)
self.facetsStats = try container.decodeIfPresent([String: RecommendFacetStats].self, forKey: .facetsStats)
self.index = try container.decodeIfPresent(String.self, forKey: .index)
self.indexUsed = try container.decodeIfPresent(String.self, forKey: .indexUsed)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
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 RecommendFacetsStats: Codable, JSONEncodable {
public struct RecommendFacetStats: Codable, JSONEncodable {
/// Minimum value in the results.
public var min: Double?
/// Maximum value in the results.
Expand Down Expand Up @@ -41,16 +41,16 @@ public struct RecommendFacetsStats: Codable, JSONEncodable {
}
}

extension RecommendFacetsStats: Equatable {
public static func ==(lhs: RecommendFacetsStats, rhs: RecommendFacetsStats) -> Bool {
extension RecommendFacetStats: Equatable {
public static func ==(lhs: RecommendFacetStats, rhs: RecommendFacetStats) -> Bool {
lhs.min == rhs.min &&
lhs.max == rhs.max &&
lhs.avg == rhs.avg &&
lhs.sum == rhs.sum
}
}

extension RecommendFacetsStats: Hashable {
extension RecommendFacetStats: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.min?.hashValue)
hasher.combine(self.max?.hashValue)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Recommend/Models/RecommendationsResults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct RecommendationsResults: Codable, JSONEncodable {
/// Facet counts.
public var facets: [String: [String: Int]]?
/// Statistics for numerical facets.
public var facetsStats: [String: RecommendFacetsStats]?
public var facetsStats: [String: RecommendFacetStats]?
/// Index name used for the query.
public var index: String?
/// Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query.
Expand Down Expand Up @@ -78,7 +78,7 @@ public struct RecommendationsResults: Codable, JSONEncodable {
exhaustiveNbHits: Bool? = nil,
exhaustiveTypo: Bool? = nil,
facets: [String: [String: Int]]? = nil,
facetsStats: [String: RecommendFacetsStats]? = nil,
facetsStats: [String: RecommendFacetStats]? = nil,
index: String? = nil,
indexUsed: String? = nil,
message: String? = nil,
Expand Down
4 changes: 2 additions & 2 deletions Sources/Search/Models/BrowseResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct BrowseResponse<T: Codable>: Codable, JSONEncodable {
/// Facet counts.
public var facets: [String: [String: Int]]?
/// Statistics for numerical facets.
public var facetsStats: [String: SearchFacetsStats]?
public var facetsStats: [String: SearchFacetStats]?
/// Index name used for the query.
public var index: String?
/// Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query.
Expand Down Expand Up @@ -87,7 +87,7 @@ public struct BrowseResponse<T: Codable>: Codable, JSONEncodable {
exhaustiveNbHits: Bool? = nil,
exhaustiveTypo: Bool? = nil,
facets: [String: [String: Int]]? = nil,
facetsStats: [String: SearchFacetsStats]? = nil,
facetsStats: [String: SearchFacetStats]? = nil,
index: String? = nil,
indexUsed: String? = nil,
message: String? = nil,
Expand Down
8 changes: 4 additions & 4 deletions Sources/Search/Models/SearchBaseSearchResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct SearchBaseSearchResponse: Codable, JSONEncodable {
/// Facet counts.
public var facets: [String: [String: Int]]?
/// Statistics for numerical facets.
public var facetsStats: [String: SearchFacetsStats]?
public var facetsStats: [String: SearchFacetStats]?
/// Index name used for the query.
public var index: String?
/// Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query.
Expand Down Expand Up @@ -69,7 +69,7 @@ public struct SearchBaseSearchResponse: Codable, JSONEncodable {
exhaustiveNbHits: Bool? = nil,
exhaustiveTypo: Bool? = nil,
facets: [String: [String: Int]]? = nil,
facetsStats: [String: SearchFacetsStats]? = nil,
facetsStats: [String: SearchFacetStats]? = nil,
index: String? = nil,
indexUsed: String? = nil,
message: String? = nil,
Expand Down Expand Up @@ -172,7 +172,7 @@ public struct SearchBaseSearchResponse: Codable, JSONEncodable {

self.facets = dictionary["facets"]?.value as? [String: [String: Int]]

self.facetsStats = dictionary["facetsStats"]?.value as? [String: SearchFacetsStats]
self.facetsStats = dictionary["facetsStats"]?.value as? [String: SearchFacetStats]

self.index = dictionary["index"]?.value as? String

Expand Down Expand Up @@ -264,7 +264,7 @@ public struct SearchBaseSearchResponse: Codable, JSONEncodable {
self.exhaustiveNbHits = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveNbHits)
self.exhaustiveTypo = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveTypo)
self.facets = try container.decodeIfPresent([String: [String: Int]].self, forKey: .facets)
self.facetsStats = try container.decodeIfPresent([String: SearchFacetsStats].self, forKey: .facetsStats)
self.facetsStats = try container.decodeIfPresent([String: SearchFacetStats].self, forKey: .facetsStats)
self.index = try container.decodeIfPresent(String.self, forKey: .index)
self.indexUsed = try container.decodeIfPresent(String.self, forKey: .indexUsed)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
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 SearchFacetsStats: Codable, JSONEncodable {
public struct SearchFacetStats: Codable, JSONEncodable {
/// Minimum value in the results.
public var min: Double?
/// Maximum value in the results.
Expand Down Expand Up @@ -41,16 +41,16 @@ public struct SearchFacetsStats: Codable, JSONEncodable {
}
}

extension SearchFacetsStats: Equatable {
public static func ==(lhs: SearchFacetsStats, rhs: SearchFacetsStats) -> Bool {
extension SearchFacetStats: Equatable {
public static func ==(lhs: SearchFacetStats, rhs: SearchFacetStats) -> Bool {
lhs.min == rhs.min &&
lhs.max == rhs.max &&
lhs.avg == rhs.avg &&
lhs.sum == rhs.sum
}
}

extension SearchFacetsStats: Hashable {
extension SearchFacetStats: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.min?.hashValue)
hasher.combine(self.max?.hashValue)
Expand Down
8 changes: 4 additions & 4 deletions Sources/Search/Models/SearchResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct SearchResponse<T: Codable>: Codable, JSONEncodable {
/// Facet counts.
public var facets: [String: [String: Int]]?
/// Statistics for numerical facets.
public var facetsStats: [String: SearchFacetsStats]?
public var facetsStats: [String: SearchFacetStats]?
/// Index name used for the query.
public var index: String?
/// Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query.
Expand Down Expand Up @@ -84,7 +84,7 @@ public struct SearchResponse<T: Codable>: Codable, JSONEncodable {
exhaustiveNbHits: Bool? = nil,
exhaustiveTypo: Bool? = nil,
facets: [String: [String: Int]]? = nil,
facetsStats: [String: SearchFacetsStats]? = nil,
facetsStats: [String: SearchFacetStats]? = nil,
index: String? = nil,
indexUsed: String? = nil,
message: String? = nil,
Expand Down Expand Up @@ -208,7 +208,7 @@ public struct SearchResponse<T: Codable>: Codable, JSONEncodable {

self.facets = dictionary["facets"]?.value as? [String: [String: Int]]

self.facetsStats = dictionary["facetsStats"]?.value as? [String: SearchFacetsStats]
self.facetsStats = dictionary["facetsStats"]?.value as? [String: SearchFacetStats]

self.index = dictionary["index"]?.value as? String

Expand Down Expand Up @@ -335,7 +335,7 @@ public struct SearchResponse<T: Codable>: Codable, JSONEncodable {
self.exhaustiveNbHits = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveNbHits)
self.exhaustiveTypo = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveTypo)
self.facets = try container.decodeIfPresent([String: [String: Int]].self, forKey: .facets)
self.facetsStats = try container.decodeIfPresent([String: SearchFacetsStats].self, forKey: .facetsStats)
self.facetsStats = try container.decodeIfPresent([String: SearchFacetStats].self, forKey: .facetsStats)
self.index = try container.decodeIfPresent(String.self, forKey: .index)
self.indexUsed = try container.decodeIfPresent(String.self, forKey: .indexUsed)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
Expand Down

0 comments on commit 5d87d3a

Please sign in to comment.