@@ -7,32 +7,32 @@ import Foundation
7
7
#endif
8
8
9
9
public struct TransformationSearch : Codable , JSONEncodable {
10
- public var transformationsIDs : [ String ]
10
+ public var transformationIDs : [ String ] ?
11
11
12
- public init ( transformationsIDs : [ String ] ) {
13
- self . transformationsIDs = transformationsIDs
12
+ public init ( transformationIDs : [ String ] ? = nil ) {
13
+ self . transformationIDs = transformationIDs
14
14
}
15
15
16
16
public enum CodingKeys : String , CodingKey , CaseIterable {
17
- case transformationsIDs
17
+ case transformationIDs
18
18
}
19
19
20
20
// Encodable protocol methods
21
21
22
22
public func encode( to encoder: Encoder ) throws {
23
23
var container = encoder. container ( keyedBy: CodingKeys . self)
24
- try container. encode ( self . transformationsIDs , forKey: . transformationsIDs )
24
+ try container. encodeIfPresent ( self . transformationIDs , forKey: . transformationIDs )
25
25
}
26
26
}
27
27
28
28
extension TransformationSearch : Equatable {
29
29
public static func == ( lhs: TransformationSearch , rhs: TransformationSearch ) -> Bool {
30
- lhs. transformationsIDs == rhs. transformationsIDs
30
+ lhs. transformationIDs == rhs. transformationIDs
31
31
}
32
32
}
33
33
34
34
extension TransformationSearch : Hashable {
35
35
public func hash( into hasher: inout Hasher ) {
36
- hasher. combine ( self . transformationsIDs . hashValue)
36
+ hasher. combine ( self . transformationIDs ? . hashValue)
37
37
}
38
38
}
0 commit comments