@@ -7,32 +7,32 @@ import Foundation
77#endif
88
99public struct TransformationSearch : Codable , JSONEncodable {
10- public var transformationsIDs : [ String ]
10+ public var transformationIDs : [ String ] ?
1111
12- public init ( transformationsIDs : [ String ] ) {
13- self . transformationsIDs = transformationsIDs
12+ public init ( transformationIDs : [ String ] ? = nil ) {
13+ self . transformationIDs = transformationIDs
1414 }
1515
1616 public enum CodingKeys : String , CodingKey , CaseIterable {
17- case transformationsIDs
17+ case transformationIDs
1818 }
1919
2020 // Encodable protocol methods
2121
2222 public func encode( to encoder: Encoder ) throws {
2323 var container = encoder. container ( keyedBy: CodingKeys . self)
24- try container. encode ( self . transformationsIDs , forKey: . transformationsIDs )
24+ try container. encodeIfPresent ( self . transformationIDs , forKey: . transformationIDs )
2525 }
2626}
2727
2828extension TransformationSearch : Equatable {
2929 public static func == ( lhs: TransformationSearch , rhs: TransformationSearch ) -> Bool {
30- lhs. transformationsIDs == rhs. transformationsIDs
30+ lhs. transformationIDs == rhs. transformationIDs
3131 }
3232}
3333
3434extension TransformationSearch : Hashable {
3535 public func hash( into hasher: inout Hasher ) {
36- hasher. combine ( self . transformationsIDs . hashValue)
36+ hasher. combine ( self . transformationIDs ? . hashValue)
3737 }
3838}
0 commit comments