Skip to content

Commit 09667cd

Browse files
fix(specs): updated watchResponse (generated)
algolia/api-clients-automation#4879 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 8c8b1bf commit 09667cd

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

Sources/Ingestion/Models/WatchResponse.swift

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,73 @@ import Foundation
99
public struct WatchResponse: Codable, JSONEncodable {
1010
/// Universally unique identifier (UUID) of a task run.
1111
public var runID: String
12+
/// Universally unique identifier (UUID) of an event.
13+
public var eventID: String?
1214
/// when used with discovering or validating sources, the sampled data of your source is returned.
1315
public var data: [AnyCodable]?
1416
/// in case of error, observability events will be added to the response, if any.
1517
public var events: [Event]?
1618
/// a message describing the outcome of a validate run.
1719
public var message: String?
20+
/// Date of creation in RFC 3339 format.
21+
public var createdAt: String?
1822

19-
public init(runID: String, data: [AnyCodable]? = nil, events: [Event]? = nil, message: String? = nil) {
23+
public init(
24+
runID: String,
25+
eventID: String? = nil,
26+
data: [AnyCodable]? = nil,
27+
events: [Event]? = nil,
28+
message: String? = nil,
29+
createdAt: String? = nil
30+
) {
2031
self.runID = runID
32+
self.eventID = eventID
2133
self.data = data
2234
self.events = events
2335
self.message = message
36+
self.createdAt = createdAt
2437
}
2538

2639
public enum CodingKeys: String, CodingKey, CaseIterable {
2740
case runID
41+
case eventID
2842
case data
2943
case events
3044
case message
45+
case createdAt
3146
}
3247

3348
// Encodable protocol methods
3449

3550
public func encode(to encoder: Encoder) throws {
3651
var container = encoder.container(keyedBy: CodingKeys.self)
3752
try container.encode(self.runID, forKey: .runID)
53+
try container.encodeIfPresent(self.eventID, forKey: .eventID)
3854
try container.encodeIfPresent(self.data, forKey: .data)
3955
try container.encodeIfPresent(self.events, forKey: .events)
4056
try container.encodeIfPresent(self.message, forKey: .message)
57+
try container.encodeIfPresent(self.createdAt, forKey: .createdAt)
4158
}
4259
}
4360

4461
extension WatchResponse: Equatable {
4562
public static func ==(lhs: WatchResponse, rhs: WatchResponse) -> Bool {
4663
lhs.runID == rhs.runID &&
64+
lhs.eventID == rhs.eventID &&
4765
lhs.data == rhs.data &&
4866
lhs.events == rhs.events &&
49-
lhs.message == rhs.message
67+
lhs.message == rhs.message &&
68+
lhs.createdAt == rhs.createdAt
5069
}
5170
}
5271

5372
extension WatchResponse: Hashable {
5473
public func hash(into hasher: inout Hasher) {
5574
hasher.combine(self.runID.hashValue)
75+
hasher.combine(self.eventID?.hashValue)
5676
hasher.combine(self.data?.hashValue)
5777
hasher.combine(self.events?.hashValue)
5878
hasher.combine(self.message?.hashValue)
79+
hasher.combine(self.createdAt?.hashValue)
5980
}
6081
}

0 commit comments

Comments
 (0)