Skip to content

Commit fb6b2ec

Browse files
algolia-botsbellonemillotp
committed
feat(specs): add useImagesObjects property in commercetools source input (generated)
algolia/api-clients-automation#5586 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Sylvain Bellone <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 4119601 commit fb6b2ec

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Sources/Ingestion/Models/SourceCommercetools.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public struct SourceCommercetools: Codable, JSONEncodable {
1818
/// Predicate to filter out specific products when indexing. For more information, see [Query
1919
/// Predicate](https://docs.commercetools.com/api/predicates/query).
2020
public var productQueryPredicate: String?
21+
/// When set to true, the connector indexes objects with all images attributes instead of only the URLs.
22+
public var useImagesObjects: Bool?
2123
public var customFields: CommercetoolsCustomFields?
2224

2325
public init(
@@ -27,6 +29,7 @@ public struct SourceCommercetools: Codable, JSONEncodable {
2729
projectKey: String,
2830
fallbackIsInStockValue: Bool? = nil,
2931
productQueryPredicate: String? = nil,
32+
useImagesObjects: Bool? = nil,
3033
customFields: CommercetoolsCustomFields? = nil
3134
) {
3235
self.storeKeys = storeKeys
@@ -35,6 +38,7 @@ public struct SourceCommercetools: Codable, JSONEncodable {
3538
self.projectKey = projectKey
3639
self.fallbackIsInStockValue = fallbackIsInStockValue
3740
self.productQueryPredicate = productQueryPredicate
41+
self.useImagesObjects = useImagesObjects
3842
self.customFields = customFields
3943
}
4044

@@ -45,6 +49,7 @@ public struct SourceCommercetools: Codable, JSONEncodable {
4549
case projectKey
4650
case fallbackIsInStockValue
4751
case productQueryPredicate
52+
case useImagesObjects
4853
case customFields
4954
}
5055

@@ -58,6 +63,7 @@ public struct SourceCommercetools: Codable, JSONEncodable {
5863
try container.encode(self.projectKey, forKey: .projectKey)
5964
try container.encodeIfPresent(self.fallbackIsInStockValue, forKey: .fallbackIsInStockValue)
6065
try container.encodeIfPresent(self.productQueryPredicate, forKey: .productQueryPredicate)
66+
try container.encodeIfPresent(self.useImagesObjects, forKey: .useImagesObjects)
6167
try container.encodeIfPresent(self.customFields, forKey: .customFields)
6268
}
6369
}
@@ -70,6 +76,7 @@ extension SourceCommercetools: Equatable {
7076
lhs.projectKey == rhs.projectKey &&
7177
lhs.fallbackIsInStockValue == rhs.fallbackIsInStockValue &&
7278
lhs.productQueryPredicate == rhs.productQueryPredicate &&
79+
lhs.useImagesObjects == rhs.useImagesObjects &&
7380
lhs.customFields == rhs.customFields
7481
}
7582
}
@@ -82,6 +89,7 @@ extension SourceCommercetools: Hashable {
8289
hasher.combine(self.projectKey.hashValue)
8390
hasher.combine(self.fallbackIsInStockValue?.hashValue)
8491
hasher.combine(self.productQueryPredicate?.hashValue)
92+
hasher.combine(self.useImagesObjects?.hashValue)
8593
hasher.combine(self.customFields?.hashValue)
8694
}
8795
}

Sources/Ingestion/Models/SourceUpdateCommercetools.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public struct SourceUpdateCommercetools: Codable, JSONEncodable {
1717
/// Predicate to filter out specific products when indexing. For more information, see [Query
1818
/// Predicate](https://docs.commercetools.com/api/predicates/query).
1919
public var productQueryPredicate: String?
20+
/// When set to true, the connector indexes objects with all images attributes instead of only the URLs.
21+
public var useImagesObjects: Bool?
2022
public var customFields: CommercetoolsCustomFields?
2123

2224
public init(
@@ -25,13 +27,15 @@ public struct SourceUpdateCommercetools: Codable, JSONEncodable {
2527
url: String? = nil,
2628
fallbackIsInStockValue: Bool? = nil,
2729
productQueryPredicate: String? = nil,
30+
useImagesObjects: Bool? = nil,
2831
customFields: CommercetoolsCustomFields? = nil
2932
) {
3033
self.storeKeys = storeKeys
3134
self.locales = locales
3235
self.url = url
3336
self.fallbackIsInStockValue = fallbackIsInStockValue
3437
self.productQueryPredicate = productQueryPredicate
38+
self.useImagesObjects = useImagesObjects
3539
self.customFields = customFields
3640
}
3741

@@ -41,6 +45,7 @@ public struct SourceUpdateCommercetools: Codable, JSONEncodable {
4145
case url
4246
case fallbackIsInStockValue
4347
case productQueryPredicate
48+
case useImagesObjects
4449
case customFields
4550
}
4651

@@ -53,6 +58,7 @@ public struct SourceUpdateCommercetools: Codable, JSONEncodable {
5358
try container.encodeIfPresent(self.url, forKey: .url)
5459
try container.encodeIfPresent(self.fallbackIsInStockValue, forKey: .fallbackIsInStockValue)
5560
try container.encodeIfPresent(self.productQueryPredicate, forKey: .productQueryPredicate)
61+
try container.encodeIfPresent(self.useImagesObjects, forKey: .useImagesObjects)
5662
try container.encodeIfPresent(self.customFields, forKey: .customFields)
5763
}
5864
}
@@ -64,6 +70,7 @@ extension SourceUpdateCommercetools: Equatable {
6470
lhs.url == rhs.url &&
6571
lhs.fallbackIsInStockValue == rhs.fallbackIsInStockValue &&
6672
lhs.productQueryPredicate == rhs.productQueryPredicate &&
73+
lhs.useImagesObjects == rhs.useImagesObjects &&
6774
lhs.customFields == rhs.customFields
6875
}
6976
}
@@ -75,6 +82,7 @@ extension SourceUpdateCommercetools: Hashable {
7582
hasher.combine(self.url?.hashValue)
7683
hasher.combine(self.fallbackIsInStockValue?.hashValue)
7784
hasher.combine(self.productQueryPredicate?.hashValue)
85+
hasher.combine(self.useImagesObjects?.hashValue)
7886
hasher.combine(self.customFields?.hashValue)
7987
}
8088
}

0 commit comments

Comments
 (0)