Skip to content

Commit 2415076

Browse files
algolia-botshortcutsmillotp
committed
fix(clients): highlight and snippet results e2e (generated)
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]>
1 parent dfead63 commit 2415076

File tree

12 files changed

+142
-142
lines changed

12 files changed

+142
-142
lines changed

Sources/Abtesting/Models/ABTest.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public struct ABTest: Codable, JSONEncodable {
3030

3131
public init(
3232
abTestID: Int,
33-
clickSignificance: Double?,
34-
conversionSignificance: Double?,
35-
addToCartSignificance: Double?,
36-
purchaseSignificance: Double?,
37-
revenueSignificance: [String: Double]?,
33+
clickSignificance: Double? = nil,
34+
conversionSignificance: Double? = nil,
35+
addToCartSignificance: Double? = nil,
36+
purchaseSignificance: Double? = nil,
37+
revenueSignificance: [String: Double]? = nil,
3838
updatedAt: String,
3939
createdAt: String,
4040
endAt: String,
@@ -79,11 +79,11 @@ public struct ABTest: Codable, JSONEncodable {
7979
public func encode(to encoder: Encoder) throws {
8080
var container = encoder.container(keyedBy: CodingKeys.self)
8181
try container.encode(self.abTestID, forKey: .abTestID)
82-
try container.encode(self.clickSignificance, forKey: .clickSignificance)
83-
try container.encode(self.conversionSignificance, forKey: .conversionSignificance)
84-
try container.encode(self.addToCartSignificance, forKey: .addToCartSignificance)
85-
try container.encode(self.purchaseSignificance, forKey: .purchaseSignificance)
86-
try container.encode(self.revenueSignificance, forKey: .revenueSignificance)
82+
try container.encodeIfPresent(self.clickSignificance, forKey: .clickSignificance)
83+
try container.encodeIfPresent(self.conversionSignificance, forKey: .conversionSignificance)
84+
try container.encodeIfPresent(self.addToCartSignificance, forKey: .addToCartSignificance)
85+
try container.encodeIfPresent(self.purchaseSignificance, forKey: .purchaseSignificance)
86+
try container.encodeIfPresent(self.revenueSignificance, forKey: .revenueSignificance)
8787
try container.encode(self.updatedAt, forKey: .updatedAt)
8888
try container.encode(self.createdAt, forKey: .createdAt)
8989
try container.encode(self.endAt, forKey: .endAt)
@@ -115,11 +115,11 @@ extension ABTest: Equatable {
115115
extension ABTest: Hashable {
116116
public func hash(into hasher: inout Hasher) {
117117
hasher.combine(self.abTestID.hashValue)
118-
hasher.combine(self.clickSignificance.hashValue)
119-
hasher.combine(self.conversionSignificance.hashValue)
120-
hasher.combine(self.addToCartSignificance.hashValue)
121-
hasher.combine(self.purchaseSignificance.hashValue)
122-
hasher.combine(self.revenueSignificance.hashValue)
118+
hasher.combine(self.clickSignificance?.hashValue)
119+
hasher.combine(self.conversionSignificance?.hashValue)
120+
hasher.combine(self.addToCartSignificance?.hashValue)
121+
hasher.combine(self.purchaseSignificance?.hashValue)
122+
hasher.combine(self.revenueSignificance?.hashValue)
123123
hasher.combine(self.updatedAt.hashValue)
124124
hasher.combine(self.createdAt.hashValue)
125125
hasher.combine(self.endAt.hashValue)

Sources/Abtesting/Models/AddABTestsVariant.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ import Foundation
77
#endif
88

99
public enum AddABTestsVariant: Codable, JSONEncodable, AbstractEncodable {
10-
case abTestsVariant(AbTestsVariant)
1110
case abTestsVariantSearchParams(AbTestsVariantSearchParams)
11+
case abTestsVariant(AbTestsVariant)
1212

1313
public func encode(to encoder: Encoder) throws {
1414
var container = encoder.singleValueContainer()
1515
switch self {
16-
case let .abTestsVariant(value):
17-
try container.encode(value)
1816
case let .abTestsVariantSearchParams(value):
1917
try container.encode(value)
18+
case let .abTestsVariant(value):
19+
try container.encode(value)
2020
}
2121
}
2222

2323
public init(from decoder: Decoder) throws {
2424
let container = try decoder.singleValueContainer()
25-
if let value = try? container.decode(AbTestsVariant.self) {
26-
self = .abTestsVariant(value)
27-
} else if let value = try? container.decode(AbTestsVariantSearchParams.self) {
25+
if let value = try? container.decode(AbTestsVariantSearchParams.self) {
2826
self = .abTestsVariantSearchParams(value)
27+
} else if let value = try? container.decode(AbTestsVariant.self) {
28+
self = .abTestsVariant(value)
2929
} else {
3030
throw DecodingError.typeMismatch(
3131
Self.Type.self,
@@ -39,10 +39,10 @@ public enum AddABTestsVariant: Codable, JSONEncodable, AbstractEncodable {
3939

4040
public func GetActualInstance() -> Encodable {
4141
switch self {
42-
case let .abTestsVariant(value):
43-
value as AbTestsVariant
4442
case let .abTestsVariantSearchParams(value):
4543
value as AbTestsVariantSearchParams
44+
case let .abTestsVariant(value):
45+
value as AbTestsVariant
4646
}
4747
}
4848
}

Sources/Abtesting/Models/Variant.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ public struct Variant: Codable, JSONEncodable {
5757

5858
public init(
5959
addToCartCount: Int,
60-
addToCartRate: Double?,
61-
averageClickPosition: Int?,
60+
addToCartRate: Double? = nil,
61+
averageClickPosition: Int? = nil,
6262
clickCount: Int,
63-
clickThroughRate: Double?,
63+
clickThroughRate: Double? = nil,
6464
conversionCount: Int,
65-
conversionRate: Double?,
65+
conversionRate: Double? = nil,
6666
currencies: [String: Currency]? = nil,
6767
description: String,
6868
estimatedSampleSize: Int? = nil,
6969
filterEffects: FilterEffects? = nil,
7070
index: String,
7171
noResultCount: Int?,
7272
purchaseCount: Int,
73-
purchaseRate: Double?,
73+
purchaseRate: Double? = nil,
7474
searchCount: Int?,
7575
trackedSearchCount: Int? = nil,
7676
trafficPercentage: Int,
@@ -127,20 +127,20 @@ public struct Variant: Codable, JSONEncodable {
127127
public func encode(to encoder: Encoder) throws {
128128
var container = encoder.container(keyedBy: CodingKeys.self)
129129
try container.encode(self.addToCartCount, forKey: .addToCartCount)
130-
try container.encode(self.addToCartRate, forKey: .addToCartRate)
131-
try container.encode(self.averageClickPosition, forKey: .averageClickPosition)
130+
try container.encodeIfPresent(self.addToCartRate, forKey: .addToCartRate)
131+
try container.encodeIfPresent(self.averageClickPosition, forKey: .averageClickPosition)
132132
try container.encode(self.clickCount, forKey: .clickCount)
133-
try container.encode(self.clickThroughRate, forKey: .clickThroughRate)
133+
try container.encodeIfPresent(self.clickThroughRate, forKey: .clickThroughRate)
134134
try container.encode(self.conversionCount, forKey: .conversionCount)
135-
try container.encode(self.conversionRate, forKey: .conversionRate)
135+
try container.encodeIfPresent(self.conversionRate, forKey: .conversionRate)
136136
try container.encodeIfPresent(self.currencies, forKey: .currencies)
137137
try container.encode(self.description, forKey: .description)
138138
try container.encodeIfPresent(self.estimatedSampleSize, forKey: .estimatedSampleSize)
139139
try container.encodeIfPresent(self.filterEffects, forKey: .filterEffects)
140140
try container.encode(self.index, forKey: .index)
141141
try container.encode(self.noResultCount, forKey: .noResultCount)
142142
try container.encode(self.purchaseCount, forKey: .purchaseCount)
143-
try container.encode(self.purchaseRate, forKey: .purchaseRate)
143+
try container.encodeIfPresent(self.purchaseRate, forKey: .purchaseRate)
144144
try container.encode(self.searchCount, forKey: .searchCount)
145145
try container.encodeIfPresent(self.trackedSearchCount, forKey: .trackedSearchCount)
146146
try container.encode(self.trafficPercentage, forKey: .trafficPercentage)
@@ -177,20 +177,20 @@ extension Variant: Equatable {
177177
extension Variant: Hashable {
178178
public func hash(into hasher: inout Hasher) {
179179
hasher.combine(self.addToCartCount.hashValue)
180-
hasher.combine(self.addToCartRate.hashValue)
181-
hasher.combine(self.averageClickPosition.hashValue)
180+
hasher.combine(self.addToCartRate?.hashValue)
181+
hasher.combine(self.averageClickPosition?.hashValue)
182182
hasher.combine(self.clickCount.hashValue)
183-
hasher.combine(self.clickThroughRate.hashValue)
183+
hasher.combine(self.clickThroughRate?.hashValue)
184184
hasher.combine(self.conversionCount.hashValue)
185-
hasher.combine(self.conversionRate.hashValue)
185+
hasher.combine(self.conversionRate?.hashValue)
186186
hasher.combine(self.currencies?.hashValue)
187187
hasher.combine(self.description.hashValue)
188188
hasher.combine(self.estimatedSampleSize?.hashValue)
189189
hasher.combine(self.filterEffects?.hashValue)
190190
hasher.combine(self.index.hashValue)
191191
hasher.combine(self.noResultCount.hashValue)
192192
hasher.combine(self.purchaseCount.hashValue)
193-
hasher.combine(self.purchaseRate.hashValue)
193+
hasher.combine(self.purchaseRate?.hashValue)
194194
hasher.combine(self.searchCount.hashValue)
195195
hasher.combine(self.trackedSearchCount?.hashValue)
196196
hasher.combine(self.trafficPercentage.hashValue)

Sources/Ingestion/Models/AuthInput.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ import Foundation
77
#endif
88

99
public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {
10+
case authOAuth(AuthOAuth)
1011
case authGoogleServiceAccount(AuthGoogleServiceAccount)
1112
case authBasic(AuthBasic)
1213
case authAPIKey(AuthAPIKey)
13-
case authOAuth(AuthOAuth)
1414
case authAlgolia(AuthAlgolia)
1515
case authAlgoliaInsights(AuthAlgoliaInsights)
1616

1717
public func encode(to encoder: Encoder) throws {
1818
var container = encoder.singleValueContainer()
1919
switch self {
20+
case let .authOAuth(value):
21+
try container.encode(value)
2022
case let .authGoogleServiceAccount(value):
2123
try container.encode(value)
2224
case let .authBasic(value):
2325
try container.encode(value)
2426
case let .authAPIKey(value):
2527
try container.encode(value)
26-
case let .authOAuth(value):
27-
try container.encode(value)
2828
case let .authAlgolia(value):
2929
try container.encode(value)
3030
case let .authAlgoliaInsights(value):
@@ -34,14 +34,14 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {
3434

3535
public init(from decoder: Decoder) throws {
3636
let container = try decoder.singleValueContainer()
37-
if let value = try? container.decode(AuthGoogleServiceAccount.self) {
37+
if let value = try? container.decode(AuthOAuth.self) {
38+
self = .authOAuth(value)
39+
} else if let value = try? container.decode(AuthGoogleServiceAccount.self) {
3840
self = .authGoogleServiceAccount(value)
3941
} else if let value = try? container.decode(AuthBasic.self) {
4042
self = .authBasic(value)
4143
} else if let value = try? container.decode(AuthAPIKey.self) {
4244
self = .authAPIKey(value)
43-
} else if let value = try? container.decode(AuthOAuth.self) {
44-
self = .authOAuth(value)
4545
} else if let value = try? container.decode(AuthAlgolia.self) {
4646
self = .authAlgolia(value)
4747
} else if let value = try? container.decode(AuthAlgoliaInsights.self) {
@@ -56,14 +56,14 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {
5656

5757
public func GetActualInstance() -> Encodable {
5858
switch self {
59+
case let .authOAuth(value):
60+
value as AuthOAuth
5961
case let .authGoogleServiceAccount(value):
6062
value as AuthGoogleServiceAccount
6163
case let .authBasic(value):
6264
value as AuthBasic
6365
case let .authAPIKey(value):
6466
value as AuthAPIKey
65-
case let .authOAuth(value):
66-
value as AuthOAuth
6767
case let .authAlgolia(value):
6868
value as AuthAlgolia
6969
case let .authAlgoliaInsights(value):

Sources/Ingestion/Models/SourceInput.swift

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,55 @@ import Foundation
77
#endif
88

99
public enum SourceInput: Codable, JSONEncodable, AbstractEncodable {
10+
case sourceDocker(SourceDocker)
11+
case sourceGA4BigQueryExport(SourceGA4BigQueryExport)
1012
case sourceCommercetools(SourceCommercetools)
1113
case sourceBigCommerce(SourceBigCommerce)
1214
case sourceBigQuery(SourceBigQuery)
13-
case sourceGA4BigQueryExport(SourceGA4BigQueryExport)
15+
case sourceShopify(SourceShopify)
1416
case sourceJSON(SourceJSON)
1517
case sourceCSV(SourceCSV)
16-
case sourceDocker(SourceDocker)
17-
case sourceShopify(SourceShopify)
1818

1919
public func encode(to encoder: Encoder) throws {
2020
var container = encoder.singleValueContainer()
2121
switch self {
22+
case let .sourceDocker(value):
23+
try container.encode(value)
24+
case let .sourceGA4BigQueryExport(value):
25+
try container.encode(value)
2226
case let .sourceCommercetools(value):
2327
try container.encode(value)
2428
case let .sourceBigCommerce(value):
2529
try container.encode(value)
2630
case let .sourceBigQuery(value):
2731
try container.encode(value)
28-
case let .sourceGA4BigQueryExport(value):
32+
case let .sourceShopify(value):
2933
try container.encode(value)
3034
case let .sourceJSON(value):
3135
try container.encode(value)
3236
case let .sourceCSV(value):
3337
try container.encode(value)
34-
case let .sourceDocker(value):
35-
try container.encode(value)
36-
case let .sourceShopify(value):
37-
try container.encode(value)
3838
}
3939
}
4040

4141
public init(from decoder: Decoder) throws {
4242
let container = try decoder.singleValueContainer()
43-
if let value = try? container.decode(SourceCommercetools.self) {
43+
if let value = try? container.decode(SourceDocker.self) {
44+
self = .sourceDocker(value)
45+
} else if let value = try? container.decode(SourceGA4BigQueryExport.self) {
46+
self = .sourceGA4BigQueryExport(value)
47+
} else if let value = try? container.decode(SourceCommercetools.self) {
4448
self = .sourceCommercetools(value)
4549
} else if let value = try? container.decode(SourceBigCommerce.self) {
4650
self = .sourceBigCommerce(value)
4751
} else if let value = try? container.decode(SourceBigQuery.self) {
4852
self = .sourceBigQuery(value)
49-
} else if let value = try? container.decode(SourceGA4BigQueryExport.self) {
50-
self = .sourceGA4BigQueryExport(value)
53+
} else if let value = try? container.decode(SourceShopify.self) {
54+
self = .sourceShopify(value)
5155
} else if let value = try? container.decode(SourceJSON.self) {
5256
self = .sourceJSON(value)
5357
} else if let value = try? container.decode(SourceCSV.self) {
5458
self = .sourceCSV(value)
55-
} else if let value = try? container.decode(SourceDocker.self) {
56-
self = .sourceDocker(value)
57-
} else if let value = try? container.decode(SourceShopify.self) {
58-
self = .sourceShopify(value)
5959
} else {
6060
throw DecodingError.typeMismatch(
6161
Self.Type.self,
@@ -66,22 +66,22 @@ public enum SourceInput: Codable, JSONEncodable, AbstractEncodable {
6666

6767
public func GetActualInstance() -> Encodable {
6868
switch self {
69+
case let .sourceDocker(value):
70+
value as SourceDocker
71+
case let .sourceGA4BigQueryExport(value):
72+
value as SourceGA4BigQueryExport
6973
case let .sourceCommercetools(value):
7074
value as SourceCommercetools
7175
case let .sourceBigCommerce(value):
7276
value as SourceBigCommerce
7377
case let .sourceBigQuery(value):
7478
value as SourceBigQuery
75-
case let .sourceGA4BigQueryExport(value):
76-
value as SourceGA4BigQueryExport
79+
case let .sourceShopify(value):
80+
value as SourceShopify
7781
case let .sourceJSON(value):
7882
value as SourceJSON
7983
case let .sourceCSV(value):
8084
value as SourceCSV
81-
case let .sourceDocker(value):
82-
value as SourceDocker
83-
case let .sourceShopify(value):
84-
value as SourceShopify
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)