Skip to content

Commit 0877e28

Browse files
algolia-botmillotp
andcommitted
chore: generated code for commit 28003717. [skip ci]
algolia/api-clients-automation@2800371 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 72d6ed5 commit 0877e28

File tree

2 files changed

+16
-129
lines changed

2 files changed

+16
-129
lines changed

Sources/Ingestion/Models/SourceShopify.swift

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

99
public struct SourceShopify: Codable, JSONEncodable {
10-
/// Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs
11-
/// will be indexed even if `collectionIDIndexing` is false.
12-
public var collectionIDIndexing: Bool?
13-
/// Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per
14-
/// product. If false, 100 collections per product are indexed.
15-
public var increaseProductCollectionLimit: Bool?
16-
/// Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the
17-
/// ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If
18-
/// `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead.
19-
public var defaultPriceRatioAsOne: Bool?
20-
/// Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price`
21-
/// attributes.
22-
public var excludeOOSVariantsForPriceAtTRS: Bool?
23-
/// Whether to include an inventory with every variant for every product record.
24-
public var includeVariantsInventory: Bool?
25-
/// Whether to include collection IDs and handles in the product records.
26-
public var hasCollectionSearchPage: Bool?
27-
/// Whether to convert tags on products to named tags. To learn more, see [Named
28-
/// tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags).
29-
public var productNamedTags: Bool?
10+
/// Feature flags for the Shopify source.
11+
public var featureFlags: [String: AnyCodable]?
3012
/// URL of the Shopify store.
3113
public var shopURL: String
3214

33-
public init(
34-
collectionIDIndexing: Bool? = nil,
35-
increaseProductCollectionLimit: Bool? = nil,
36-
defaultPriceRatioAsOne: Bool? = nil,
37-
excludeOOSVariantsForPriceAtTRS: Bool? = nil,
38-
includeVariantsInventory: Bool? = nil,
39-
hasCollectionSearchPage: Bool? = nil,
40-
productNamedTags: Bool? = nil,
41-
shopURL: String
42-
) {
43-
self.collectionIDIndexing = collectionIDIndexing
44-
self.increaseProductCollectionLimit = increaseProductCollectionLimit
45-
self.defaultPriceRatioAsOne = defaultPriceRatioAsOne
46-
self.excludeOOSVariantsForPriceAtTRS = excludeOOSVariantsForPriceAtTRS
47-
self.includeVariantsInventory = includeVariantsInventory
48-
self.hasCollectionSearchPage = hasCollectionSearchPage
49-
self.productNamedTags = productNamedTags
15+
public init(featureFlags: [String: AnyCodable]? = nil, shopURL: String) {
16+
self.featureFlags = featureFlags
5017
self.shopURL = shopURL
5118
}
5219

5320
public enum CodingKeys: String, CodingKey, CaseIterable {
54-
case collectionIDIndexing
55-
case increaseProductCollectionLimit
56-
case defaultPriceRatioAsOne
57-
case excludeOOSVariantsForPriceAtTRS
58-
case includeVariantsInventory
59-
case hasCollectionSearchPage
60-
case productNamedTags
21+
case featureFlags
6122
case shopURL
6223
}
6324

6425
// Encodable protocol methods
6526

6627
public func encode(to encoder: Encoder) throws {
6728
var container = encoder.container(keyedBy: CodingKeys.self)
68-
try container.encodeIfPresent(self.collectionIDIndexing, forKey: .collectionIDIndexing)
69-
try container.encodeIfPresent(self.increaseProductCollectionLimit, forKey: .increaseProductCollectionLimit)
70-
try container.encodeIfPresent(self.defaultPriceRatioAsOne, forKey: .defaultPriceRatioAsOne)
71-
try container.encodeIfPresent(self.excludeOOSVariantsForPriceAtTRS, forKey: .excludeOOSVariantsForPriceAtTRS)
72-
try container.encodeIfPresent(self.includeVariantsInventory, forKey: .includeVariantsInventory)
73-
try container.encodeIfPresent(self.hasCollectionSearchPage, forKey: .hasCollectionSearchPage)
74-
try container.encodeIfPresent(self.productNamedTags, forKey: .productNamedTags)
29+
try container.encodeIfPresent(self.featureFlags, forKey: .featureFlags)
7530
try container.encode(self.shopURL, forKey: .shopURL)
7631
}
7732
}
7833

7934
extension SourceShopify: Equatable {
8035
public static func ==(lhs: SourceShopify, rhs: SourceShopify) -> Bool {
81-
lhs.collectionIDIndexing == rhs.collectionIDIndexing &&
82-
lhs.increaseProductCollectionLimit == rhs.increaseProductCollectionLimit &&
83-
lhs.defaultPriceRatioAsOne == rhs.defaultPriceRatioAsOne &&
84-
lhs.excludeOOSVariantsForPriceAtTRS == rhs.excludeOOSVariantsForPriceAtTRS &&
85-
lhs.includeVariantsInventory == rhs.includeVariantsInventory &&
86-
lhs.hasCollectionSearchPage == rhs.hasCollectionSearchPage &&
87-
lhs.productNamedTags == rhs.productNamedTags &&
36+
lhs.featureFlags == rhs.featureFlags &&
8837
lhs.shopURL == rhs.shopURL
8938
}
9039
}
9140

9241
extension SourceShopify: Hashable {
9342
public func hash(into hasher: inout Hasher) {
94-
hasher.combine(self.collectionIDIndexing?.hashValue)
95-
hasher.combine(self.increaseProductCollectionLimit?.hashValue)
96-
hasher.combine(self.defaultPriceRatioAsOne?.hashValue)
97-
hasher.combine(self.excludeOOSVariantsForPriceAtTRS?.hashValue)
98-
hasher.combine(self.includeVariantsInventory?.hashValue)
99-
hasher.combine(self.hasCollectionSearchPage?.hashValue)
100-
hasher.combine(self.productNamedTags?.hashValue)
43+
hasher.combine(self.featureFlags?.hashValue)
10144
hasher.combine(self.shopURL.hashValue)
10245
}
10346
}

Sources/Ingestion/Models/SourceUpdateShopify.swift

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

99
public struct SourceUpdateShopify: Codable, JSONEncodable {
10-
/// Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs
11-
/// will be indexed even if `collectionIDIndexing` is false.
12-
public var collectionIDIndexing: Bool?
13-
/// Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per
14-
/// product. If false, 100 collections per product are indexed.
15-
public var increaseProductCollectionLimit: Bool?
16-
/// Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the
17-
/// ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If
18-
/// `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead.
19-
public var defaultPriceRatioAsOne: Bool?
20-
/// Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price`
21-
/// attributes.
22-
public var excludeOOSVariantsForPriceAtTRS: Bool?
23-
/// Whether to include an inventory with every variant for every product record.
24-
public var includeVariantsInventory: Bool?
25-
/// Whether to include collection IDs and handles in the product records.
26-
public var hasCollectionSearchPage: Bool?
27-
/// Whether to convert tags on products to named tags. To learn more, see [Named
28-
/// tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags).
29-
public var productNamedTags: Bool?
10+
/// Feature flags for the Shopify source.
11+
public var featureFlags: [String: AnyCodable]?
3012

31-
public init(
32-
collectionIDIndexing: Bool? = nil,
33-
increaseProductCollectionLimit: Bool? = nil,
34-
defaultPriceRatioAsOne: Bool? = nil,
35-
excludeOOSVariantsForPriceAtTRS: Bool? = nil,
36-
includeVariantsInventory: Bool? = nil,
37-
hasCollectionSearchPage: Bool? = nil,
38-
productNamedTags: Bool? = nil
39-
) {
40-
self.collectionIDIndexing = collectionIDIndexing
41-
self.increaseProductCollectionLimit = increaseProductCollectionLimit
42-
self.defaultPriceRatioAsOne = defaultPriceRatioAsOne
43-
self.excludeOOSVariantsForPriceAtTRS = excludeOOSVariantsForPriceAtTRS
44-
self.includeVariantsInventory = includeVariantsInventory
45-
self.hasCollectionSearchPage = hasCollectionSearchPage
46-
self.productNamedTags = productNamedTags
13+
public init(featureFlags: [String: AnyCodable]? = nil) {
14+
self.featureFlags = featureFlags
4715
}
4816

4917
public enum CodingKeys: String, CodingKey, CaseIterable {
50-
case collectionIDIndexing
51-
case increaseProductCollectionLimit
52-
case defaultPriceRatioAsOne
53-
case excludeOOSVariantsForPriceAtTRS
54-
case includeVariantsInventory
55-
case hasCollectionSearchPage
56-
case productNamedTags
18+
case featureFlags
5719
}
5820

5921
// Encodable protocol methods
6022

6123
public func encode(to encoder: Encoder) throws {
6224
var container = encoder.container(keyedBy: CodingKeys.self)
63-
try container.encodeIfPresent(self.collectionIDIndexing, forKey: .collectionIDIndexing)
64-
try container.encodeIfPresent(self.increaseProductCollectionLimit, forKey: .increaseProductCollectionLimit)
65-
try container.encodeIfPresent(self.defaultPriceRatioAsOne, forKey: .defaultPriceRatioAsOne)
66-
try container.encodeIfPresent(self.excludeOOSVariantsForPriceAtTRS, forKey: .excludeOOSVariantsForPriceAtTRS)
67-
try container.encodeIfPresent(self.includeVariantsInventory, forKey: .includeVariantsInventory)
68-
try container.encodeIfPresent(self.hasCollectionSearchPage, forKey: .hasCollectionSearchPage)
69-
try container.encodeIfPresent(self.productNamedTags, forKey: .productNamedTags)
25+
try container.encodeIfPresent(self.featureFlags, forKey: .featureFlags)
7026
}
7127
}
7228

7329
extension SourceUpdateShopify: Equatable {
7430
public static func ==(lhs: SourceUpdateShopify, rhs: SourceUpdateShopify) -> Bool {
75-
lhs.collectionIDIndexing == rhs.collectionIDIndexing &&
76-
lhs.increaseProductCollectionLimit == rhs.increaseProductCollectionLimit &&
77-
lhs.defaultPriceRatioAsOne == rhs.defaultPriceRatioAsOne &&
78-
lhs.excludeOOSVariantsForPriceAtTRS == rhs.excludeOOSVariantsForPriceAtTRS &&
79-
lhs.includeVariantsInventory == rhs.includeVariantsInventory &&
80-
lhs.hasCollectionSearchPage == rhs.hasCollectionSearchPage &&
81-
lhs.productNamedTags == rhs.productNamedTags
31+
lhs.featureFlags == rhs.featureFlags
8232
}
8333
}
8434

8535
extension SourceUpdateShopify: Hashable {
8636
public func hash(into hasher: inout Hasher) {
87-
hasher.combine(self.collectionIDIndexing?.hashValue)
88-
hasher.combine(self.increaseProductCollectionLimit?.hashValue)
89-
hasher.combine(self.defaultPriceRatioAsOne?.hashValue)
90-
hasher.combine(self.excludeOOSVariantsForPriceAtTRS?.hashValue)
91-
hasher.combine(self.includeVariantsInventory?.hashValue)
92-
hasher.combine(self.hasCollectionSearchPage?.hashValue)
93-
hasher.combine(self.productNamedTags?.hashValue)
37+
hasher.combine(self.featureFlags?.hashValue)
9438
}
9539
}

0 commit comments

Comments
 (0)