@@ -11,8 +11,11 @@ public struct Transformation: Codable, JSONEncodable {
1111 public var transformationID : String
1212 /// The authentications associated with the current transformation.
1313 public var authenticationIDs : [ String ] ?
14- /// The source code of the transformation.
14+ /// It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
15+ @available ( * , deprecated, message: " This property is deprecated. " )
1516 public var code : String
17+ public var type : TransformationType ?
18+ public var input : TransformationInput ?
1619 /// The uniquely identified name of your transformation.
1720 public var name : String
1821 /// A descriptive name for your transformation of what it does.
@@ -28,6 +31,8 @@ public struct Transformation: Codable, JSONEncodable {
2831 transformationID: String ,
2932 authenticationIDs: [ String ] ? = nil ,
3033 code: String ,
34+ type: TransformationType ? = nil ,
35+ input: TransformationInput ? = nil ,
3136 name: String ,
3237 description: String ? = nil ,
3338 owner: String ? = nil ,
@@ -37,6 +42,8 @@ public struct Transformation: Codable, JSONEncodable {
3742 self . transformationID = transformationID
3843 self . authenticationIDs = authenticationIDs
3944 self . code = code
45+ self . type = type
46+ self . input = input
4047 self . name = name
4148 self . description = description
4249 self . owner = owner
@@ -48,6 +55,8 @@ public struct Transformation: Codable, JSONEncodable {
4855 case transformationID
4956 case authenticationIDs
5057 case code
58+ case type
59+ case input
5160 case name
5261 case description
5362 case owner
@@ -62,6 +71,8 @@ public struct Transformation: Codable, JSONEncodable {
6271 try container. encode ( self . transformationID, forKey: . transformationID)
6372 try container. encodeIfPresent ( self . authenticationIDs, forKey: . authenticationIDs)
6473 try container. encode ( self . code, forKey: . code)
74+ try container. encodeIfPresent ( self . type, forKey: . type)
75+ try container. encodeIfPresent ( self . input, forKey: . input)
6576 try container. encode ( self . name, forKey: . name)
6677 try container. encodeIfPresent ( self . description, forKey: . description)
6778 try container. encodeIfPresent ( self . owner, forKey: . owner)
@@ -75,6 +86,8 @@ extension Transformation: Equatable {
7586 lhs. transformationID == rhs. transformationID &&
7687 lhs. authenticationIDs == rhs. authenticationIDs &&
7788 lhs. code == rhs. code &&
89+ lhs. type == rhs. type &&
90+ lhs. input == rhs. input &&
7891 lhs. name == rhs. name &&
7992 lhs. description == rhs. description &&
8093 lhs. owner == rhs. owner &&
@@ -88,6 +101,8 @@ extension Transformation: Hashable {
88101 hasher. combine ( self . transformationID. hashValue)
89102 hasher. combine ( self . authenticationIDs? . hashValue)
90103 hasher. combine ( self . code. hashValue)
104+ hasher. combine ( self . type? . hashValue)
105+ hasher. combine ( self . input? . hashValue)
91106 hasher. combine ( self . name. hashValue)
92107 hasher. combine ( self . description? . hashValue)
93108 hasher. combine ( self . owner? . hashValue)
0 commit comments