@@ -8,15 +8,15 @@ import Foundation
8
8
9
9
public struct WatchResponse : Codable , JSONEncodable {
10
10
/// Universally unique identifier (UUID) of a task run.
11
- public var runID : String ?
11
+ public var runID : String
12
12
/// when used with discovering or validating sources, the sampled data of your source is returned.
13
13
public var data : [ AnyCodable ] ?
14
14
/// in case of error, observability events will be added to the response, if any.
15
15
public var events : [ Event ] ?
16
16
/// a message describing the outcome of a validate run.
17
- public var message : String
17
+ public var message : String ?
18
18
19
- public init ( runID: String ? = nil , data: [ AnyCodable ] ? = nil , events: [ Event ] ? = nil , message: String ) {
19
+ public init ( runID: String , data: [ AnyCodable ] ? = nil , events: [ Event ] ? = nil , message: String ? = nil ) {
20
20
self . runID = runID
21
21
self . data = data
22
22
self . events = events
@@ -34,10 +34,10 @@ public struct WatchResponse: Codable, JSONEncodable {
34
34
35
35
public func encode( to encoder: Encoder ) throws {
36
36
var container = encoder. container ( keyedBy: CodingKeys . self)
37
- try container. encodeIfPresent ( self . runID, forKey: . runID)
37
+ try container. encode ( self . runID, forKey: . runID)
38
38
try container. encodeIfPresent ( self . data, forKey: . data)
39
39
try container. encodeIfPresent ( self . events, forKey: . events)
40
- try container. encode ( self . message, forKey: . message)
40
+ try container. encodeIfPresent ( self . message, forKey: . message)
41
41
}
42
42
}
43
43
@@ -52,9 +52,9 @@ extension WatchResponse: Equatable {
52
52
53
53
extension WatchResponse : Hashable {
54
54
public func hash( into hasher: inout Hasher ) {
55
- hasher. combine ( self . runID? . hashValue)
55
+ hasher. combine ( self . runID. hashValue)
56
56
hasher. combine ( self . data? . hashValue)
57
57
hasher. combine ( self . events? . hashValue)
58
- hasher. combine ( self . message. hashValue)
58
+ hasher. combine ( self . message? . hashValue)
59
59
}
60
60
}
0 commit comments