@@ -8,15 +8,15 @@ import Foundation
88
99public struct WatchResponse : Codable , JSONEncodable {
1010 /// Universally unique identifier (UUID) of a task run.
11- public var runID : String ?
11+ public var runID : String
1212 /// when used with discovering or validating sources, the sampled data of your source is returned.
1313 public var data : [ AnyCodable ] ?
1414 /// in case of error, observability events will be added to the response, if any.
1515 public var events : [ Event ] ?
1616 /// a message describing the outcome of a validate run.
17- public var message : String
17+ public var message : String ?
1818
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 ) {
2020 self . runID = runID
2121 self . data = data
2222 self . events = events
@@ -34,10 +34,10 @@ public struct WatchResponse: Codable, JSONEncodable {
3434
3535 public func encode( to encoder: Encoder ) throws {
3636 var container = encoder. container ( keyedBy: CodingKeys . self)
37- try container. encodeIfPresent ( self . runID, forKey: . runID)
37+ try container. encode ( self . runID, forKey: . runID)
3838 try container. encodeIfPresent ( self . data, forKey: . data)
3939 try container. encodeIfPresent ( self . events, forKey: . events)
40- try container. encode ( self . message, forKey: . message)
40+ try container. encodeIfPresent ( self . message, forKey: . message)
4141 }
4242}
4343
@@ -52,9 +52,9 @@ extension WatchResponse: Equatable {
5252
5353extension WatchResponse : Hashable {
5454 public func hash( into hasher: inout Hasher ) {
55- hasher. combine ( self . runID? . hashValue)
55+ hasher. combine ( self . runID. hashValue)
5656 hasher. combine ( self . data? . hashValue)
5757 hasher. combine ( self . events? . hashValue)
58- hasher. combine ( self . message. hashValue)
58+ hasher. combine ( self . message? . hashValue)
5959 }
6060}
0 commit comments