fix(protocol): fence gateway work recovery
This commit is contained in:
+65
-28
@@ -1,13 +1,14 @@
|
||||
// Code generated by tools/generate.py; DO NOT EDIT.
|
||||
import Foundation
|
||||
public typealias JSONObject = [String: String]
|
||||
public let schemaSHA256 = "614fa11dd1f49b8e10bf21b8c10eadbc1468d16bfcc6ed0a26d29671a5e61300"
|
||||
public let schemaSHA256 = "8c1ed430127cf5774a919f14ff4770b2509d322c8518bf30c412e1e89eeffced"
|
||||
public let currentWireVersion = "2"
|
||||
public let nMinus1WireVersion = "1"
|
||||
public let nMinus2WireVersion = "0"
|
||||
public struct ContractValidationError: Error, Equatable { public let field: String; public let code: String }
|
||||
private struct AnyCodingKey: CodingKey { let stringValue: String; let intValue: Int?; init?(stringValue: String) { self.stringValue = stringValue; self.intValue = nil }; init?(intValue: Int) { self.stringValue = String(intValue); self.intValue = intValue } }
|
||||
private func rejectDuplicateJSONKeys(_ data: Data) throws {
|
||||
guard data.count <= 1_048_576 else { throw ContractValidationError(field: "json", code: "payload_too_large") }
|
||||
var index = 0
|
||||
func skipWhitespace() { while index < data.count && [9, 10, 13, 32].contains(data[index]) { index += 1 } }
|
||||
func parseString() throws -> String {
|
||||
@@ -21,7 +22,8 @@ private func rejectDuplicateJSONKeys(_ data: Data) throws {
|
||||
}
|
||||
throw ContractValidationError(field: "json", code: "invalid_json")
|
||||
}
|
||||
func parseValue() throws {
|
||||
func parseValue(_ depth: Int) throws {
|
||||
guard depth <= 64 else { throw ContractValidationError(field: "json", code: "nesting_too_deep") }
|
||||
skipWhitespace()
|
||||
guard index < data.count else { throw ContractValidationError(field: "json", code: "invalid_json") }
|
||||
if data[index] == 123 {
|
||||
@@ -36,7 +38,7 @@ private func rejectDuplicateJSONKeys(_ data: Data) throws {
|
||||
skipWhitespace()
|
||||
guard index < data.count, data[index] == 58 else { throw ContractValidationError(field: "json", code: "invalid_json") }
|
||||
index += 1
|
||||
try parseValue()
|
||||
try parseValue(depth + 1)
|
||||
skipWhitespace()
|
||||
guard index < data.count else { throw ContractValidationError(field: "json", code: "invalid_json") }
|
||||
if data[index] == 125 { index += 1; return }
|
||||
@@ -49,7 +51,7 @@ private func rejectDuplicateJSONKeys(_ data: Data) throws {
|
||||
skipWhitespace()
|
||||
if index < data.count, data[index] == 93 { index += 1; return }
|
||||
while true {
|
||||
try parseValue()
|
||||
try parseValue(depth + 1)
|
||||
skipWhitespace()
|
||||
guard index < data.count else { throw ContractValidationError(field: "json", code: "invalid_json") }
|
||||
if data[index] == 93 { index += 1; return }
|
||||
@@ -62,7 +64,7 @@ private func rejectDuplicateJSONKeys(_ data: Data) throws {
|
||||
while index < data.count && ![9, 10, 13, 32, 44, 93, 125].contains(data[index]) { index += 1 }
|
||||
guard index > start else { throw ContractValidationError(field: "json", code: "invalid_json") }
|
||||
}
|
||||
try parseValue()
|
||||
try parseValue(0)
|
||||
skipWhitespace()
|
||||
guard index == data.count else { throw ContractValidationError(field: "json", code: "trailing_json") }
|
||||
}
|
||||
@@ -1434,8 +1436,9 @@ public struct GatewayQualityAck: Codable, Equatable {
|
||||
public let reconnectSequence: Int64
|
||||
public let operationId: String
|
||||
public let revision: Int64
|
||||
public let leaseGeneration: Int64
|
||||
public let outcome: String
|
||||
public let currentAppliedRevision: Int64
|
||||
public let currentAppliedRevision: Int64?
|
||||
public let failureCode: String?
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
@@ -1444,18 +1447,20 @@ public struct GatewayQualityAck: Codable, Equatable {
|
||||
case reconnectSequence = "reconnect_sequence"
|
||||
case operationId = "operation_id"
|
||||
case revision = "revision"
|
||||
case leaseGeneration = "lease_generation"
|
||||
case outcome = "outcome"
|
||||
case currentAppliedRevision = "current_applied_revision"
|
||||
case failureCode = "failure_code"
|
||||
}
|
||||
|
||||
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, operationId: String, revision: Int64, outcome: String, currentAppliedRevision: Int64, failureCode: String?) throws {
|
||||
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, operationId: String, revision: Int64, leaseGeneration: Int64, outcome: String, currentAppliedRevision: Int64?, failureCode: String?) throws {
|
||||
self.version = version
|
||||
self.sessionId = sessionId
|
||||
self.gatewayId = gatewayId
|
||||
self.reconnectSequence = reconnectSequence
|
||||
self.operationId = operationId
|
||||
self.revision = revision
|
||||
self.leaseGeneration = leaseGeneration
|
||||
self.outcome = outcome
|
||||
self.currentAppliedRevision = currentAppliedRevision
|
||||
self.failureCode = failureCode
|
||||
@@ -1466,7 +1471,7 @@ public struct GatewayQualityAck: Codable, Equatable {
|
||||
let all = try decoder.container(keyedBy: AnyCodingKey.self)
|
||||
for key in all.allKeys where CodingKeys(stringValue: key.stringValue) == nil { throw ContractValidationError(field: key.stringValue, code: "unknown_field") }
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), operationId: try c.decode(String.self, forKey: .operationId), revision: try c.decode(Int64.self, forKey: .revision), outcome: try c.decode(String.self, forKey: .outcome), currentAppliedRevision: try c.decode(Int64.self, forKey: .currentAppliedRevision), failureCode: try c.decodeIfPresent(String.self, forKey: .failureCode))
|
||||
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), operationId: try c.decode(String.self, forKey: .operationId), revision: try c.decode(Int64.self, forKey: .revision), leaseGeneration: try c.decode(Int64.self, forKey: .leaseGeneration), outcome: try c.decode(String.self, forKey: .outcome), currentAppliedRevision: try c.decodeIfPresent(Int64.self, forKey: .currentAppliedRevision), failureCode: try c.decodeIfPresent(String.self, forKey: .failureCode))
|
||||
}
|
||||
|
||||
public func validate() throws {
|
||||
@@ -1483,12 +1488,18 @@ public struct GatewayQualityAck: Codable, Equatable {
|
||||
if self.operationId.utf8.count > 36 { throw ContractValidationError(field: "operation_id", code: "max_length") }
|
||||
if !validCanonicalUUID(self.operationId) { throw ContractValidationError(field: "operation_id", code: "invalid_uuid") }
|
||||
if self.revision < 1 { throw ContractValidationError(field: "revision", code: "minimum") }
|
||||
if !["applied", "not_applied", "uncertain"].contains(self.outcome) { throw ContractValidationError(field: "outcome", code: "invalid_value") }
|
||||
if self.currentAppliedRevision < 0 { throw ContractValidationError(field: "current_applied_revision", code: "minimum") }
|
||||
if self.leaseGeneration < 1 { throw ContractValidationError(field: "lease_generation", code: "minimum") }
|
||||
if !["applied", "proven_prior", "unknown"].contains(self.outcome) { throw ContractValidationError(field: "outcome", code: "invalid_value") }
|
||||
if let value = self.currentAppliedRevision {
|
||||
if value < 0 { throw ContractValidationError(field: "current_applied_revision", code: "minimum") }
|
||||
}
|
||||
if let value = self.failureCode {
|
||||
if !value.isEmpty && value.utf8.count < 1 { throw ContractValidationError(field: "failure_code", code: "min_length") }
|
||||
if value.utf8.count > 128 { throw ContractValidationError(field: "failure_code", code: "max_length") }
|
||||
}
|
||||
if outcome == "applied" && currentAppliedRevision != revision { throw ContractValidationError(field: "current_applied_revision", code: "invalid_tagged_value") }
|
||||
if outcome == "proven_prior" && (currentAppliedRevision == nil || currentAppliedRevision! >= revision) { throw ContractValidationError(field: "current_applied_revision", code: "invalid_tagged_value") }
|
||||
if outcome == "unknown" && currentAppliedRevision != nil { throw ContractValidationError(field: "current_applied_revision", code: "invalid_tagged_value") }
|
||||
}
|
||||
|
||||
public static func decodeJSON(_ data: Data) throws -> Self { try rejectDuplicateJSONKeys(data); return try JSONDecoder().decode(Self.self, from: data) }
|
||||
@@ -1502,6 +1513,7 @@ public struct GatewayQualityWork: Codable, Equatable {
|
||||
public let reconnectSequence: Int64
|
||||
public let operationId: String
|
||||
public let revision: Int64
|
||||
public let leaseGeneration: Int64
|
||||
public let leaseExpiresAt: String
|
||||
public let selectedDescriptor: SelectedSessionDescriptor
|
||||
public let currentAppliedRevision: Int64?
|
||||
@@ -1512,18 +1524,20 @@ public struct GatewayQualityWork: Codable, Equatable {
|
||||
case reconnectSequence = "reconnect_sequence"
|
||||
case operationId = "operation_id"
|
||||
case revision = "revision"
|
||||
case leaseGeneration = "lease_generation"
|
||||
case leaseExpiresAt = "lease_expires_at"
|
||||
case selectedDescriptor = "selected_descriptor"
|
||||
case currentAppliedRevision = "current_applied_revision"
|
||||
}
|
||||
|
||||
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, operationId: String, revision: Int64, leaseExpiresAt: String, selectedDescriptor: SelectedSessionDescriptor, currentAppliedRevision: Int64?) throws {
|
||||
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, operationId: String, revision: Int64, leaseGeneration: Int64, leaseExpiresAt: String, selectedDescriptor: SelectedSessionDescriptor, currentAppliedRevision: Int64?) throws {
|
||||
self.version = version
|
||||
self.sessionId = sessionId
|
||||
self.gatewayId = gatewayId
|
||||
self.reconnectSequence = reconnectSequence
|
||||
self.operationId = operationId
|
||||
self.revision = revision
|
||||
self.leaseGeneration = leaseGeneration
|
||||
self.leaseExpiresAt = leaseExpiresAt
|
||||
self.selectedDescriptor = selectedDescriptor
|
||||
self.currentAppliedRevision = currentAppliedRevision
|
||||
@@ -1534,7 +1548,7 @@ public struct GatewayQualityWork: Codable, Equatable {
|
||||
let all = try decoder.container(keyedBy: AnyCodingKey.self)
|
||||
for key in all.allKeys where CodingKeys(stringValue: key.stringValue) == nil { throw ContractValidationError(field: key.stringValue, code: "unknown_field") }
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), operationId: try c.decode(String.self, forKey: .operationId), revision: try c.decode(Int64.self, forKey: .revision), leaseExpiresAt: try c.decode(String.self, forKey: .leaseExpiresAt), selectedDescriptor: try c.decode(SelectedSessionDescriptor.self, forKey: .selectedDescriptor), currentAppliedRevision: try c.decodeIfPresent(Int64.self, forKey: .currentAppliedRevision))
|
||||
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), operationId: try c.decode(String.self, forKey: .operationId), revision: try c.decode(Int64.self, forKey: .revision), leaseGeneration: try c.decode(Int64.self, forKey: .leaseGeneration), leaseExpiresAt: try c.decode(String.self, forKey: .leaseExpiresAt), selectedDescriptor: try c.decode(SelectedSessionDescriptor.self, forKey: .selectedDescriptor), currentAppliedRevision: try c.decodeIfPresent(Int64.self, forKey: .currentAppliedRevision))
|
||||
}
|
||||
|
||||
public func validate() throws {
|
||||
@@ -1551,6 +1565,7 @@ public struct GatewayQualityWork: Codable, Equatable {
|
||||
if self.operationId.utf8.count > 36 { throw ContractValidationError(field: "operation_id", code: "max_length") }
|
||||
if !validCanonicalUUID(self.operationId) { throw ContractValidationError(field: "operation_id", code: "invalid_uuid") }
|
||||
if self.revision < 1 { throw ContractValidationError(field: "revision", code: "minimum") }
|
||||
if self.leaseGeneration < 1 { throw ContractValidationError(field: "lease_generation", code: "minimum") }
|
||||
if self.leaseExpiresAt.utf8.count > 64 { throw ContractValidationError(field: "lease_expires_at", code: "max_length") }
|
||||
if !validRFC3339UTC(self.leaseExpiresAt) { throw ContractValidationError(field: "lease_expires_at", code: "invalid_time") }
|
||||
try self.selectedDescriptor.validate()
|
||||
@@ -1568,26 +1583,32 @@ public struct GatewayQualityWorkRequest: Codable, Equatable {
|
||||
public let sessionId: String
|
||||
public let gatewayId: String
|
||||
public let reconnectSequence: Int64
|
||||
public let operationId: String
|
||||
public let revision: Int64
|
||||
public let acquisition: String
|
||||
public let operationId: String?
|
||||
public let revision: Int64?
|
||||
public let leaseGeneration: Int64?
|
||||
public let currentAppliedRevision: Int64?
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case sessionId = "session_id"
|
||||
case gatewayId = "gateway_id"
|
||||
case reconnectSequence = "reconnect_sequence"
|
||||
case acquisition = "acquisition"
|
||||
case operationId = "operation_id"
|
||||
case revision = "revision"
|
||||
case leaseGeneration = "lease_generation"
|
||||
case currentAppliedRevision = "current_applied_revision"
|
||||
}
|
||||
|
||||
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, operationId: String, revision: Int64, currentAppliedRevision: Int64?) throws {
|
||||
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, acquisition: String, operationId: String?, revision: Int64?, leaseGeneration: Int64?, currentAppliedRevision: Int64?) throws {
|
||||
self.version = version
|
||||
self.sessionId = sessionId
|
||||
self.gatewayId = gatewayId
|
||||
self.reconnectSequence = reconnectSequence
|
||||
self.acquisition = acquisition
|
||||
self.operationId = operationId
|
||||
self.revision = revision
|
||||
self.leaseGeneration = leaseGeneration
|
||||
self.currentAppliedRevision = currentAppliedRevision
|
||||
try validate()
|
||||
}
|
||||
@@ -1596,7 +1617,7 @@ public struct GatewayQualityWorkRequest: Codable, Equatable {
|
||||
let all = try decoder.container(keyedBy: AnyCodingKey.self)
|
||||
for key in all.allKeys where CodingKeys(stringValue: key.stringValue) == nil { throw ContractValidationError(field: key.stringValue, code: "unknown_field") }
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), operationId: try c.decode(String.self, forKey: .operationId), revision: try c.decode(Int64.self, forKey: .revision), currentAppliedRevision: try c.decodeIfPresent(Int64.self, forKey: .currentAppliedRevision))
|
||||
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), acquisition: try c.decode(String.self, forKey: .acquisition), operationId: try c.decodeIfPresent(String.self, forKey: .operationId), revision: try c.decodeIfPresent(Int64.self, forKey: .revision), leaseGeneration: try c.decodeIfPresent(Int64.self, forKey: .leaseGeneration), currentAppliedRevision: try c.decodeIfPresent(Int64.self, forKey: .currentAppliedRevision))
|
||||
}
|
||||
|
||||
public func validate() throws {
|
||||
@@ -1608,14 +1629,24 @@ public struct GatewayQualityWorkRequest: Codable, Equatable {
|
||||
if !self.gatewayId.isEmpty && self.gatewayId.utf8.count < 1 { throw ContractValidationError(field: "gateway_id", code: "min_length") }
|
||||
if self.gatewayId.utf8.count > 128 { throw ContractValidationError(field: "gateway_id", code: "max_length") }
|
||||
if self.reconnectSequence < 0 { throw ContractValidationError(field: "reconnect_sequence", code: "minimum") }
|
||||
if self.operationId.isEmpty { throw ContractValidationError(field: "operation_id", code: "required") }
|
||||
if !self.operationId.isEmpty && self.operationId.utf8.count < 36 { throw ContractValidationError(field: "operation_id", code: "min_length") }
|
||||
if self.operationId.utf8.count > 36 { throw ContractValidationError(field: "operation_id", code: "max_length") }
|
||||
if !validCanonicalUUID(self.operationId) { throw ContractValidationError(field: "operation_id", code: "invalid_uuid") }
|
||||
if self.revision < 1 { throw ContractValidationError(field: "revision", code: "minimum") }
|
||||
if !["poll", "prompt", "observation"].contains(self.acquisition) { throw ContractValidationError(field: "acquisition", code: "invalid_value") }
|
||||
if let value = self.operationId {
|
||||
if !value.isEmpty && value.utf8.count < 36 { throw ContractValidationError(field: "operation_id", code: "min_length") }
|
||||
if value.utf8.count > 36 { throw ContractValidationError(field: "operation_id", code: "max_length") }
|
||||
if !validCanonicalUUID(value) { throw ContractValidationError(field: "operation_id", code: "invalid_uuid") }
|
||||
}
|
||||
if let value = self.revision {
|
||||
if value < 1 { throw ContractValidationError(field: "revision", code: "minimum") }
|
||||
}
|
||||
if let value = self.leaseGeneration {
|
||||
if value < 1 { throw ContractValidationError(field: "lease_generation", code: "minimum") }
|
||||
}
|
||||
if let value = self.currentAppliedRevision {
|
||||
if value < 0 { throw ContractValidationError(field: "current_applied_revision", code: "minimum") }
|
||||
}
|
||||
if acquisition == "poll" && (operationId != nil || revision != nil || leaseGeneration != nil || currentAppliedRevision != nil) { throw ContractValidationError(field: "acquisition", code: "invalid_tagged_value") }
|
||||
if acquisition == "prompt" && (operationId == nil || revision == nil || leaseGeneration != nil || currentAppliedRevision != nil) { throw ContractValidationError(field: "acquisition", code: "invalid_tagged_value") }
|
||||
if acquisition == "observation" && (operationId == nil || revision == nil || leaseGeneration == nil || currentAppliedRevision == nil) { throw ContractValidationError(field: "acquisition", code: "invalid_tagged_value") }
|
||||
}
|
||||
|
||||
public static func decodeJSON(_ data: Data) throws -> Self { try rejectDuplicateJSONKeys(data); return try JSONDecoder().decode(Self.self, from: data) }
|
||||
@@ -1834,20 +1865,23 @@ public struct GatewayStopWorkRequest: Codable, Equatable {
|
||||
public let sessionId: String
|
||||
public let gatewayId: String
|
||||
public let reconnectSequence: Int64
|
||||
public let operationId: String
|
||||
public let acquisition: String
|
||||
public let operationId: String?
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case sessionId = "session_id"
|
||||
case gatewayId = "gateway_id"
|
||||
case reconnectSequence = "reconnect_sequence"
|
||||
case acquisition = "acquisition"
|
||||
case operationId = "operation_id"
|
||||
}
|
||||
|
||||
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, operationId: String) throws {
|
||||
public init(version: String, sessionId: String, gatewayId: String, reconnectSequence: Int64, acquisition: String, operationId: String?) throws {
|
||||
self.version = version
|
||||
self.sessionId = sessionId
|
||||
self.gatewayId = gatewayId
|
||||
self.reconnectSequence = reconnectSequence
|
||||
self.acquisition = acquisition
|
||||
self.operationId = operationId
|
||||
try validate()
|
||||
}
|
||||
@@ -1856,7 +1890,7 @@ public struct GatewayStopWorkRequest: Codable, Equatable {
|
||||
let all = try decoder.container(keyedBy: AnyCodingKey.self)
|
||||
for key in all.allKeys where CodingKeys(stringValue: key.stringValue) == nil { throw ContractValidationError(field: key.stringValue, code: "unknown_field") }
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), operationId: try c.decode(String.self, forKey: .operationId))
|
||||
try self.init(version: try c.decode(String.self, forKey: .version), sessionId: try c.decode(String.self, forKey: .sessionId), gatewayId: try c.decode(String.self, forKey: .gatewayId), reconnectSequence: try c.decode(Int64.self, forKey: .reconnectSequence), acquisition: try c.decode(String.self, forKey: .acquisition), operationId: try c.decodeIfPresent(String.self, forKey: .operationId))
|
||||
}
|
||||
|
||||
public func validate() throws {
|
||||
@@ -1868,10 +1902,13 @@ public struct GatewayStopWorkRequest: Codable, Equatable {
|
||||
if !self.gatewayId.isEmpty && self.gatewayId.utf8.count < 1 { throw ContractValidationError(field: "gateway_id", code: "min_length") }
|
||||
if self.gatewayId.utf8.count > 128 { throw ContractValidationError(field: "gateway_id", code: "max_length") }
|
||||
if self.reconnectSequence < 0 { throw ContractValidationError(field: "reconnect_sequence", code: "minimum") }
|
||||
if self.operationId.isEmpty { throw ContractValidationError(field: "operation_id", code: "required") }
|
||||
if !self.operationId.isEmpty && self.operationId.utf8.count < 36 { throw ContractValidationError(field: "operation_id", code: "min_length") }
|
||||
if self.operationId.utf8.count > 36 { throw ContractValidationError(field: "operation_id", code: "max_length") }
|
||||
if !validCanonicalUUID(self.operationId) { throw ContractValidationError(field: "operation_id", code: "invalid_uuid") }
|
||||
if !["poll", "prompt"].contains(self.acquisition) { throw ContractValidationError(field: "acquisition", code: "invalid_value") }
|
||||
if let value = self.operationId {
|
||||
if !value.isEmpty && value.utf8.count < 36 { throw ContractValidationError(field: "operation_id", code: "min_length") }
|
||||
if value.utf8.count > 36 { throw ContractValidationError(field: "operation_id", code: "max_length") }
|
||||
if !validCanonicalUUID(value) { throw ContractValidationError(field: "operation_id", code: "invalid_uuid") }
|
||||
}
|
||||
if acquisition == "poll" && operationId != nil || acquisition == "prompt" && operationId == nil { throw ContractValidationError(field: "acquisition", code: "invalid_tagged_value") }
|
||||
}
|
||||
|
||||
public static func decodeJSON(_ data: Data) throws -> Self { try rejectDuplicateJSONKeys(data); return try JSONDecoder().decode(Self.self, from: data) }
|
||||
|
||||
Reference in New Issue
Block a user