Skip to content

Commit

Permalink
fix(clients): highlight and snippet results e2e (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3567

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
  • Loading branch information
3 people committed Aug 21, 2024
1 parent dfead63 commit 2415076
Show file tree
Hide file tree
Showing 12 changed files with 142 additions and 142 deletions.
30 changes: 15 additions & 15 deletions Sources/Abtesting/Models/ABTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public struct ABTest: Codable, JSONEncodable {

public init(
abTestID: Int,
clickSignificance: Double?,
conversionSignificance: Double?,
addToCartSignificance: Double?,
purchaseSignificance: Double?,
revenueSignificance: [String: Double]?,
clickSignificance: Double? = nil,
conversionSignificance: Double? = nil,
addToCartSignificance: Double? = nil,
purchaseSignificance: Double? = nil,
revenueSignificance: [String: Double]? = nil,
updatedAt: String,
createdAt: String,
endAt: String,
Expand Down Expand Up @@ -79,11 +79,11 @@ public struct ABTest: Codable, JSONEncodable {
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.abTestID, forKey: .abTestID)
try container.encode(self.clickSignificance, forKey: .clickSignificance)
try container.encode(self.conversionSignificance, forKey: .conversionSignificance)
try container.encode(self.addToCartSignificance, forKey: .addToCartSignificance)
try container.encode(self.purchaseSignificance, forKey: .purchaseSignificance)
try container.encode(self.revenueSignificance, forKey: .revenueSignificance)
try container.encodeIfPresent(self.clickSignificance, forKey: .clickSignificance)
try container.encodeIfPresent(self.conversionSignificance, forKey: .conversionSignificance)
try container.encodeIfPresent(self.addToCartSignificance, forKey: .addToCartSignificance)
try container.encodeIfPresent(self.purchaseSignificance, forKey: .purchaseSignificance)
try container.encodeIfPresent(self.revenueSignificance, forKey: .revenueSignificance)
try container.encode(self.updatedAt, forKey: .updatedAt)
try container.encode(self.createdAt, forKey: .createdAt)
try container.encode(self.endAt, forKey: .endAt)
Expand Down Expand Up @@ -115,11 +115,11 @@ extension ABTest: Equatable {
extension ABTest: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.abTestID.hashValue)
hasher.combine(self.clickSignificance.hashValue)
hasher.combine(self.conversionSignificance.hashValue)
hasher.combine(self.addToCartSignificance.hashValue)
hasher.combine(self.purchaseSignificance.hashValue)
hasher.combine(self.revenueSignificance.hashValue)
hasher.combine(self.clickSignificance?.hashValue)
hasher.combine(self.conversionSignificance?.hashValue)
hasher.combine(self.addToCartSignificance?.hashValue)
hasher.combine(self.purchaseSignificance?.hashValue)
hasher.combine(self.revenueSignificance?.hashValue)
hasher.combine(self.updatedAt.hashValue)
hasher.combine(self.createdAt.hashValue)
hasher.combine(self.endAt.hashValue)
Expand Down
16 changes: 8 additions & 8 deletions Sources/Abtesting/Models/AddABTestsVariant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ import Foundation
#endif

public enum AddABTestsVariant: Codable, JSONEncodable, AbstractEncodable {
case abTestsVariant(AbTestsVariant)
case abTestsVariantSearchParams(AbTestsVariantSearchParams)
case abTestsVariant(AbTestsVariant)

public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
switch self {
case let .abTestsVariant(value):
try container.encode(value)
case let .abTestsVariantSearchParams(value):
try container.encode(value)
case let .abTestsVariant(value):
try container.encode(value)
}
}

public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let value = try? container.decode(AbTestsVariant.self) {
self = .abTestsVariant(value)
} else if let value = try? container.decode(AbTestsVariantSearchParams.self) {
if let value = try? container.decode(AbTestsVariantSearchParams.self) {
self = .abTestsVariantSearchParams(value)
} else if let value = try? container.decode(AbTestsVariant.self) {
self = .abTestsVariant(value)
} else {
throw DecodingError.typeMismatch(
Self.Type.self,
Expand All @@ -39,10 +39,10 @@ public enum AddABTestsVariant: Codable, JSONEncodable, AbstractEncodable {

public func GetActualInstance() -> Encodable {
switch self {
case let .abTestsVariant(value):
value as AbTestsVariant
case let .abTestsVariantSearchParams(value):
value as AbTestsVariantSearchParams
case let .abTestsVariant(value):
value as AbTestsVariant
}
}
}
Expand Down
30 changes: 15 additions & 15 deletions Sources/Abtesting/Models/Variant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ public struct Variant: Codable, JSONEncodable {

public init(
addToCartCount: Int,
addToCartRate: Double?,
averageClickPosition: Int?,
addToCartRate: Double? = nil,
averageClickPosition: Int? = nil,
clickCount: Int,
clickThroughRate: Double?,
clickThroughRate: Double? = nil,
conversionCount: Int,
conversionRate: Double?,
conversionRate: Double? = nil,
currencies: [String: Currency]? = nil,
description: String,
estimatedSampleSize: Int? = nil,
filterEffects: FilterEffects? = nil,
index: String,
noResultCount: Int?,
purchaseCount: Int,
purchaseRate: Double?,
purchaseRate: Double? = nil,
searchCount: Int?,
trackedSearchCount: Int? = nil,
trafficPercentage: Int,
Expand Down Expand Up @@ -127,20 +127,20 @@ public struct Variant: Codable, JSONEncodable {
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.addToCartCount, forKey: .addToCartCount)
try container.encode(self.addToCartRate, forKey: .addToCartRate)
try container.encode(self.averageClickPosition, forKey: .averageClickPosition)
try container.encodeIfPresent(self.addToCartRate, forKey: .addToCartRate)
try container.encodeIfPresent(self.averageClickPosition, forKey: .averageClickPosition)
try container.encode(self.clickCount, forKey: .clickCount)
try container.encode(self.clickThroughRate, forKey: .clickThroughRate)
try container.encodeIfPresent(self.clickThroughRate, forKey: .clickThroughRate)
try container.encode(self.conversionCount, forKey: .conversionCount)
try container.encode(self.conversionRate, forKey: .conversionRate)
try container.encodeIfPresent(self.conversionRate, forKey: .conversionRate)
try container.encodeIfPresent(self.currencies, forKey: .currencies)
try container.encode(self.description, forKey: .description)
try container.encodeIfPresent(self.estimatedSampleSize, forKey: .estimatedSampleSize)
try container.encodeIfPresent(self.filterEffects, forKey: .filterEffects)
try container.encode(self.index, forKey: .index)
try container.encode(self.noResultCount, forKey: .noResultCount)
try container.encode(self.purchaseCount, forKey: .purchaseCount)
try container.encode(self.purchaseRate, forKey: .purchaseRate)
try container.encodeIfPresent(self.purchaseRate, forKey: .purchaseRate)
try container.encode(self.searchCount, forKey: .searchCount)
try container.encodeIfPresent(self.trackedSearchCount, forKey: .trackedSearchCount)
try container.encode(self.trafficPercentage, forKey: .trafficPercentage)
Expand Down Expand Up @@ -177,20 +177,20 @@ extension Variant: Equatable {
extension Variant: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.addToCartCount.hashValue)
hasher.combine(self.addToCartRate.hashValue)
hasher.combine(self.averageClickPosition.hashValue)
hasher.combine(self.addToCartRate?.hashValue)
hasher.combine(self.averageClickPosition?.hashValue)
hasher.combine(self.clickCount.hashValue)
hasher.combine(self.clickThroughRate.hashValue)
hasher.combine(self.clickThroughRate?.hashValue)
hasher.combine(self.conversionCount.hashValue)
hasher.combine(self.conversionRate.hashValue)
hasher.combine(self.conversionRate?.hashValue)
hasher.combine(self.currencies?.hashValue)
hasher.combine(self.description.hashValue)
hasher.combine(self.estimatedSampleSize?.hashValue)
hasher.combine(self.filterEffects?.hashValue)
hasher.combine(self.index.hashValue)
hasher.combine(self.noResultCount.hashValue)
hasher.combine(self.purchaseCount.hashValue)
hasher.combine(self.purchaseRate.hashValue)
hasher.combine(self.purchaseRate?.hashValue)
hasher.combine(self.searchCount.hashValue)
hasher.combine(self.trackedSearchCount?.hashValue)
hasher.combine(self.trafficPercentage.hashValue)
Expand Down
16 changes: 8 additions & 8 deletions Sources/Ingestion/Models/AuthInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ import Foundation
#endif

public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {
case authOAuth(AuthOAuth)
case authGoogleServiceAccount(AuthGoogleServiceAccount)
case authBasic(AuthBasic)
case authAPIKey(AuthAPIKey)
case authOAuth(AuthOAuth)
case authAlgolia(AuthAlgolia)
case authAlgoliaInsights(AuthAlgoliaInsights)

public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
switch self {
case let .authOAuth(value):
try container.encode(value)
case let .authGoogleServiceAccount(value):
try container.encode(value)
case let .authBasic(value):
try container.encode(value)
case let .authAPIKey(value):
try container.encode(value)
case let .authOAuth(value):
try container.encode(value)
case let .authAlgolia(value):
try container.encode(value)
case let .authAlgoliaInsights(value):
Expand All @@ -34,14 +34,14 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {

public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let value = try? container.decode(AuthGoogleServiceAccount.self) {
if let value = try? container.decode(AuthOAuth.self) {
self = .authOAuth(value)
} else if let value = try? container.decode(AuthGoogleServiceAccount.self) {
self = .authGoogleServiceAccount(value)
} else if let value = try? container.decode(AuthBasic.self) {
self = .authBasic(value)
} else if let value = try? container.decode(AuthAPIKey.self) {
self = .authAPIKey(value)
} else if let value = try? container.decode(AuthOAuth.self) {
self = .authOAuth(value)
} else if let value = try? container.decode(AuthAlgolia.self) {
self = .authAlgolia(value)
} else if let value = try? container.decode(AuthAlgoliaInsights.self) {
Expand All @@ -56,14 +56,14 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {

public func GetActualInstance() -> Encodable {
switch self {
case let .authOAuth(value):
value as AuthOAuth
case let .authGoogleServiceAccount(value):
value as AuthGoogleServiceAccount
case let .authBasic(value):
value as AuthBasic
case let .authAPIKey(value):
value as AuthAPIKey
case let .authOAuth(value):
value as AuthOAuth
case let .authAlgolia(value):
value as AuthAlgolia
case let .authAlgoliaInsights(value):
Expand Down
42 changes: 21 additions & 21 deletions Sources/Ingestion/Models/SourceInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,55 @@ import Foundation
#endif

public enum SourceInput: Codable, JSONEncodable, AbstractEncodable {
case sourceDocker(SourceDocker)
case sourceGA4BigQueryExport(SourceGA4BigQueryExport)
case sourceCommercetools(SourceCommercetools)
case sourceBigCommerce(SourceBigCommerce)
case sourceBigQuery(SourceBigQuery)
case sourceGA4BigQueryExport(SourceGA4BigQueryExport)
case sourceShopify(SourceShopify)
case sourceJSON(SourceJSON)
case sourceCSV(SourceCSV)
case sourceDocker(SourceDocker)
case sourceShopify(SourceShopify)

public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
switch self {
case let .sourceDocker(value):
try container.encode(value)
case let .sourceGA4BigQueryExport(value):
try container.encode(value)
case let .sourceCommercetools(value):
try container.encode(value)
case let .sourceBigCommerce(value):
try container.encode(value)
case let .sourceBigQuery(value):
try container.encode(value)
case let .sourceGA4BigQueryExport(value):
case let .sourceShopify(value):
try container.encode(value)
case let .sourceJSON(value):
try container.encode(value)
case let .sourceCSV(value):
try container.encode(value)
case let .sourceDocker(value):
try container.encode(value)
case let .sourceShopify(value):
try container.encode(value)
}
}

public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let value = try? container.decode(SourceCommercetools.self) {
if let value = try? container.decode(SourceDocker.self) {
self = .sourceDocker(value)
} else if let value = try? container.decode(SourceGA4BigQueryExport.self) {
self = .sourceGA4BigQueryExport(value)
} else if let value = try? container.decode(SourceCommercetools.self) {
self = .sourceCommercetools(value)
} else if let value = try? container.decode(SourceBigCommerce.self) {
self = .sourceBigCommerce(value)
} else if let value = try? container.decode(SourceBigQuery.self) {
self = .sourceBigQuery(value)
} else if let value = try? container.decode(SourceGA4BigQueryExport.self) {
self = .sourceGA4BigQueryExport(value)
} else if let value = try? container.decode(SourceShopify.self) {
self = .sourceShopify(value)
} else if let value = try? container.decode(SourceJSON.self) {
self = .sourceJSON(value)
} else if let value = try? container.decode(SourceCSV.self) {
self = .sourceCSV(value)
} else if let value = try? container.decode(SourceDocker.self) {
self = .sourceDocker(value)
} else if let value = try? container.decode(SourceShopify.self) {
self = .sourceShopify(value)
} else {
throw DecodingError.typeMismatch(
Self.Type.self,
Expand All @@ -66,22 +66,22 @@ public enum SourceInput: Codable, JSONEncodable, AbstractEncodable {

public func GetActualInstance() -> Encodable {
switch self {
case let .sourceDocker(value):
value as SourceDocker
case let .sourceGA4BigQueryExport(value):
value as SourceGA4BigQueryExport
case let .sourceCommercetools(value):
value as SourceCommercetools
case let .sourceBigCommerce(value):
value as SourceBigCommerce
case let .sourceBigQuery(value):
value as SourceBigQuery
case let .sourceGA4BigQueryExport(value):
value as SourceGA4BigQueryExport
case let .sourceShopify(value):
value as SourceShopify
case let .sourceJSON(value):
value as SourceJSON
case let .sourceCSV(value):
value as SourceCSV
case let .sourceDocker(value):
value as SourceDocker
case let .sourceShopify(value):
value as SourceShopify
}
}
}
Expand Down
Loading

0 comments on commit 2415076

Please sign in to comment.