Skip to content

Commit 4102306

Browse files
chore: generated code for commit 1dc08710. [skip ci]
algolia/api-clients-automation@1dc0871 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 3cb1212 commit 4102306

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Sources/Ingestion/Models/Task.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

Sources/Ingestion/Models/TaskCreate.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public struct TaskCreate: Codable, JSONEncodable {
1919
/// Maximum accepted percentage of failures for a task run to finish successfully.
2020
public var failureThreshold: Int?
2121
public var input: TaskInput?
22+
/// Date of the last cursor in RFC 3339 format.
23+
public var cursor: String?
2224

2325
public init(
2426
sourceID: String,
@@ -27,7 +29,8 @@ public struct TaskCreate: Codable, JSONEncodable {
2729
action: ActionType,
2830
enabled: Bool? = nil,
2931
failureThreshold: Int? = nil,
30-
input: TaskInput? = nil
32+
input: TaskInput? = nil,
33+
cursor: String? = nil
3134
) {
3235
self.sourceID = sourceID
3336
self.destinationID = destinationID
@@ -36,6 +39,7 @@ public struct TaskCreate: Codable, JSONEncodable {
3639
self.enabled = enabled
3740
self.failureThreshold = failureThreshold
3841
self.input = input
42+
self.cursor = cursor
3943
}
4044

4145
public enum CodingKeys: String, CodingKey, CaseIterable {
@@ -46,6 +50,7 @@ public struct TaskCreate: Codable, JSONEncodable {
4650
case enabled
4751
case failureThreshold
4852
case input
53+
case cursor
4954
}
5055

5156
// Encodable protocol methods
@@ -59,6 +64,7 @@ public struct TaskCreate: Codable, JSONEncodable {
5964
try container.encodeIfPresent(self.enabled, forKey: .enabled)
6065
try container.encodeIfPresent(self.failureThreshold, forKey: .failureThreshold)
6166
try container.encodeIfPresent(self.input, forKey: .input)
67+
try container.encodeIfPresent(self.cursor, forKey: .cursor)
6268
}
6369
}
6470

@@ -70,7 +76,8 @@ extension TaskCreate: Equatable {
7076
lhs.action == rhs.action &&
7177
lhs.enabled == rhs.enabled &&
7278
lhs.failureThreshold == rhs.failureThreshold &&
73-
lhs.input == rhs.input
79+
lhs.input == rhs.input &&
80+
lhs.cursor == rhs.cursor
7481
}
7582
}
7683

@@ -83,5 +90,6 @@ extension TaskCreate: Hashable {
8390
hasher.combine(self.enabled?.hashValue)
8491
hasher.combine(self.failureThreshold?.hashValue)
8592
hasher.combine(self.input?.hashValue)
93+
hasher.combine(self.cursor?.hashValue)
8694
}
8795
}

0 commit comments

Comments
 (0)