@@ -20,6 +20,8 @@ public struct Task: Codable, JSONEncodable {
2020 /// Maximum accepted percentage of failures for a task run to finish successfully.
2121 public var failureThreshold : Int ?
2222 public var action : ActionType
23+ /// Date of the last cursor in RFC 3339 format.
24+ public var cursor : String ?
2325 /// Date of creation in RFC 3339 format.
2426 public var createdAt : String
2527 /// Date of last update in RFC 3339 format.
@@ -34,6 +36,7 @@ public struct Task: Codable, JSONEncodable {
3436 enabled: Bool ,
3537 failureThreshold: Int ? = nil ,
3638 action: ActionType ,
39+ cursor: String ? = nil ,
3740 createdAt: String ,
3841 updatedAt: String ? = nil
3942 ) {
@@ -45,6 +48,7 @@ public struct Task: Codable, JSONEncodable {
4548 self . enabled = enabled
4649 self . failureThreshold = failureThreshold
4750 self . action = action
51+ self . cursor = cursor
4852 self . createdAt = createdAt
4953 self . updatedAt = updatedAt
5054 }
@@ -58,6 +62,7 @@ public struct Task: Codable, JSONEncodable {
5862 case enabled
5963 case failureThreshold
6064 case action
65+ case cursor
6166 case createdAt
6267 case updatedAt
6368 }
@@ -74,6 +79,7 @@ public struct Task: Codable, JSONEncodable {
7479 try container. encode ( self . enabled, forKey: . enabled)
7580 try container. encodeIfPresent ( self . failureThreshold, forKey: . failureThreshold)
7681 try container. encode ( self . action, forKey: . action)
82+ try container. encodeIfPresent ( self . cursor, forKey: . cursor)
7783 try container. encode ( self . createdAt, forKey: . createdAt)
7884 try container. encodeIfPresent ( self . updatedAt, forKey: . updatedAt)
7985 }
@@ -89,6 +95,7 @@ extension Task: Equatable {
8995 lhs. enabled == rhs. enabled &&
9096 lhs. failureThreshold == rhs. failureThreshold &&
9197 lhs. action == rhs. action &&
98+ lhs. cursor == rhs. cursor &&
9299 lhs. createdAt == rhs. createdAt &&
93100 lhs. updatedAt == rhs. updatedAt
94101 }
@@ -104,6 +111,7 @@ extension Task: Hashable {
104111 hasher. combine ( self . enabled. hashValue)
105112 hasher. combine ( self . failureThreshold? . hashValue)
106113 hasher. combine ( self . action. hashValue)
114+ hasher. combine ( self . cursor? . hashValue)
107115 hasher. combine ( self . createdAt. hashValue)
108116 hasher. combine ( self . updatedAt? . hashValue)
109117 }
0 commit comments