style: swiftformat gateway models
This commit is contained in:
@@ -26,8 +26,8 @@ public struct ConnectParams: Codable {
|
|||||||
caps: [String]?,
|
caps: [String]?,
|
||||||
auth: [String: AnyCodable]?,
|
auth: [String: AnyCodable]?,
|
||||||
locale: String?,
|
locale: String?,
|
||||||
useragent: String?
|
useragent: String?)
|
||||||
) {
|
{
|
||||||
self.minprotocol = minprotocol
|
self.minprotocol = minprotocol
|
||||||
self.maxprotocol = maxprotocol
|
self.maxprotocol = maxprotocol
|
||||||
self.client = client
|
self.client = client
|
||||||
@@ -36,6 +36,7 @@ public struct ConnectParams: Codable {
|
|||||||
self.locale = locale
|
self.locale = locale
|
||||||
self.useragent = useragent
|
self.useragent = useragent
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case minprotocol = "minProtocol"
|
case minprotocol = "minProtocol"
|
||||||
case maxprotocol = "maxProtocol"
|
case maxprotocol = "maxProtocol"
|
||||||
@@ -63,8 +64,8 @@ public struct HelloOk: Codable {
|
|||||||
features: [String: AnyCodable],
|
features: [String: AnyCodable],
|
||||||
snapshot: Snapshot,
|
snapshot: Snapshot,
|
||||||
canvashosturl: String?,
|
canvashosturl: String?,
|
||||||
policy: [String: AnyCodable]
|
policy: [String: AnyCodable])
|
||||||
) {
|
{
|
||||||
self.type = type
|
self.type = type
|
||||||
self._protocol = _protocol
|
self._protocol = _protocol
|
||||||
self.server = server
|
self.server = server
|
||||||
@@ -73,6 +74,7 @@ public struct HelloOk: Codable {
|
|||||||
self.canvashosturl = canvashosturl
|
self.canvashosturl = canvashosturl
|
||||||
self.policy = policy
|
self.policy = policy
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case type
|
case type
|
||||||
case _protocol = "protocol"
|
case _protocol = "protocol"
|
||||||
@@ -94,13 +96,14 @@ public struct RequestFrame: Codable {
|
|||||||
type: String,
|
type: String,
|
||||||
id: String,
|
id: String,
|
||||||
method: String,
|
method: String,
|
||||||
params: AnyCodable?
|
params: AnyCodable?)
|
||||||
) {
|
{
|
||||||
self.type = type
|
self.type = type
|
||||||
self.id = id
|
self.id = id
|
||||||
self.method = method
|
self.method = method
|
||||||
self.params = params
|
self.params = params
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case type
|
case type
|
||||||
case id
|
case id
|
||||||
@@ -121,14 +124,15 @@ public struct ResponseFrame: Codable {
|
|||||||
id: String,
|
id: String,
|
||||||
ok: Bool,
|
ok: Bool,
|
||||||
payload: AnyCodable?,
|
payload: AnyCodable?,
|
||||||
error: [String: AnyCodable]?
|
error: [String: AnyCodable]?)
|
||||||
) {
|
{
|
||||||
self.type = type
|
self.type = type
|
||||||
self.id = id
|
self.id = id
|
||||||
self.ok = ok
|
self.ok = ok
|
||||||
self.payload = payload
|
self.payload = payload
|
||||||
self.error = error
|
self.error = error
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case type
|
case type
|
||||||
case id
|
case id
|
||||||
@@ -150,14 +154,15 @@ public struct EventFrame: Codable {
|
|||||||
event: String,
|
event: String,
|
||||||
payload: AnyCodable?,
|
payload: AnyCodable?,
|
||||||
seq: Int?,
|
seq: Int?,
|
||||||
stateversion: [String: AnyCodable]?
|
stateversion: [String: AnyCodable]?)
|
||||||
) {
|
{
|
||||||
self.type = type
|
self.type = type
|
||||||
self.event = event
|
self.event = event
|
||||||
self.payload = payload
|
self.payload = payload
|
||||||
self.seq = seq
|
self.seq = seq
|
||||||
self.stateversion = stateversion
|
self.stateversion = stateversion
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case type
|
case type
|
||||||
case event
|
case event
|
||||||
@@ -195,8 +200,8 @@ public struct PresenceEntry: Codable {
|
|||||||
tags: [String]?,
|
tags: [String]?,
|
||||||
text: String?,
|
text: String?,
|
||||||
ts: Int,
|
ts: Int,
|
||||||
instanceid: String?
|
instanceid: String?)
|
||||||
) {
|
{
|
||||||
self.host = host
|
self.host = host
|
||||||
self.ip = ip
|
self.ip = ip
|
||||||
self.version = version
|
self.version = version
|
||||||
@@ -211,6 +216,7 @@ public struct PresenceEntry: Codable {
|
|||||||
self.ts = ts
|
self.ts = ts
|
||||||
self.instanceid = instanceid
|
self.instanceid = instanceid
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case host
|
case host
|
||||||
case ip
|
case ip
|
||||||
@@ -234,11 +240,12 @@ public struct StateVersion: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
presence: Int,
|
presence: Int,
|
||||||
health: Int
|
health: Int)
|
||||||
) {
|
{
|
||||||
self.presence = presence
|
self.presence = presence
|
||||||
self.health = health
|
self.health = health
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case presence
|
case presence
|
||||||
case health
|
case health
|
||||||
@@ -259,8 +266,8 @@ public struct Snapshot: Codable {
|
|||||||
stateversion: StateVersion,
|
stateversion: StateVersion,
|
||||||
uptimems: Int,
|
uptimems: Int,
|
||||||
configpath: String?,
|
configpath: String?,
|
||||||
statedir: String?
|
statedir: String?)
|
||||||
) {
|
{
|
||||||
self.presence = presence
|
self.presence = presence
|
||||||
self.health = health
|
self.health = health
|
||||||
self.stateversion = stateversion
|
self.stateversion = stateversion
|
||||||
@@ -268,6 +275,7 @@ public struct Snapshot: Codable {
|
|||||||
self.configpath = configpath
|
self.configpath = configpath
|
||||||
self.statedir = statedir
|
self.statedir = statedir
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case presence
|
case presence
|
||||||
case health
|
case health
|
||||||
@@ -290,14 +298,15 @@ public struct ErrorShape: Codable {
|
|||||||
message: String,
|
message: String,
|
||||||
details: AnyCodable?,
|
details: AnyCodable?,
|
||||||
retryable: Bool?,
|
retryable: Bool?,
|
||||||
retryafterms: Int?
|
retryafterms: Int?)
|
||||||
) {
|
{
|
||||||
self.code = code
|
self.code = code
|
||||||
self.message = message
|
self.message = message
|
||||||
self.details = details
|
self.details = details
|
||||||
self.retryable = retryable
|
self.retryable = retryable
|
||||||
self.retryafterms = retryafterms
|
self.retryafterms = retryafterms
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case code
|
case code
|
||||||
case message
|
case message
|
||||||
@@ -319,14 +328,15 @@ public struct AgentEvent: Codable {
|
|||||||
seq: Int,
|
seq: Int,
|
||||||
stream: String,
|
stream: String,
|
||||||
ts: Int,
|
ts: Int,
|
||||||
data: [String: AnyCodable]
|
data: [String: AnyCodable])
|
||||||
) {
|
{
|
||||||
self.runid = runid
|
self.runid = runid
|
||||||
self.seq = seq
|
self.seq = seq
|
||||||
self.stream = stream
|
self.stream = stream
|
||||||
self.ts = ts
|
self.ts = ts
|
||||||
self.data = data
|
self.data = data
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case runid = "runId"
|
case runid = "runId"
|
||||||
case seq
|
case seq
|
||||||
@@ -350,8 +360,8 @@ public struct SendParams: Codable {
|
|||||||
mediaurl: String?,
|
mediaurl: String?,
|
||||||
gifplayback: Bool?,
|
gifplayback: Bool?,
|
||||||
provider: String?,
|
provider: String?,
|
||||||
idempotencykey: String
|
idempotencykey: String)
|
||||||
) {
|
{
|
||||||
self.to = to
|
self.to = to
|
||||||
self.message = message
|
self.message = message
|
||||||
self.mediaurl = mediaurl
|
self.mediaurl = mediaurl
|
||||||
@@ -359,6 +369,7 @@ public struct SendParams: Codable {
|
|||||||
self.provider = provider
|
self.provider = provider
|
||||||
self.idempotencykey = idempotencykey
|
self.idempotencykey = idempotencykey
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case to
|
case to
|
||||||
case message
|
case message
|
||||||
@@ -393,8 +404,8 @@ public struct AgentParams: Codable {
|
|||||||
timeout: Int?,
|
timeout: Int?,
|
||||||
lane: String?,
|
lane: String?,
|
||||||
extrasystemprompt: String?,
|
extrasystemprompt: String?,
|
||||||
idempotencykey: String
|
idempotencykey: String)
|
||||||
) {
|
{
|
||||||
self.message = message
|
self.message = message
|
||||||
self.to = to
|
self.to = to
|
||||||
self.sessionid = sessionid
|
self.sessionid = sessionid
|
||||||
@@ -407,6 +418,7 @@ public struct AgentParams: Codable {
|
|||||||
self.extrasystemprompt = extrasystemprompt
|
self.extrasystemprompt = extrasystemprompt
|
||||||
self.idempotencykey = idempotencykey
|
self.idempotencykey = idempotencykey
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case message
|
case message
|
||||||
case to
|
case to
|
||||||
@@ -430,12 +442,13 @@ public struct AgentWaitParams: Codable {
|
|||||||
public init(
|
public init(
|
||||||
runid: String,
|
runid: String,
|
||||||
afterms: Int?,
|
afterms: Int?,
|
||||||
timeoutms: Int?
|
timeoutms: Int?)
|
||||||
) {
|
{
|
||||||
self.runid = runid
|
self.runid = runid
|
||||||
self.afterms = afterms
|
self.afterms = afterms
|
||||||
self.timeoutms = timeoutms
|
self.timeoutms = timeoutms
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case runid = "runId"
|
case runid = "runId"
|
||||||
case afterms = "afterMs"
|
case afterms = "afterMs"
|
||||||
@@ -449,11 +462,12 @@ public struct WakeParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
mode: AnyCodable,
|
mode: AnyCodable,
|
||||||
text: String
|
text: String)
|
||||||
) {
|
{
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.text = text
|
self.text = text
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case mode
|
case mode
|
||||||
case text
|
case text
|
||||||
@@ -482,8 +496,8 @@ public struct NodePairRequestParams: Codable {
|
|||||||
caps: [String]?,
|
caps: [String]?,
|
||||||
commands: [String]?,
|
commands: [String]?,
|
||||||
remoteip: String?,
|
remoteip: String?,
|
||||||
silent: Bool?
|
silent: Bool?)
|
||||||
) {
|
{
|
||||||
self.nodeid = nodeid
|
self.nodeid = nodeid
|
||||||
self.displayname = displayname
|
self.displayname = displayname
|
||||||
self.platform = platform
|
self.platform = platform
|
||||||
@@ -495,6 +509,7 @@ public struct NodePairRequestParams: Codable {
|
|||||||
self.remoteip = remoteip
|
self.remoteip = remoteip
|
||||||
self.silent = silent
|
self.silent = silent
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case nodeid = "nodeId"
|
case nodeid = "nodeId"
|
||||||
case displayname = "displayName"
|
case displayname = "displayName"
|
||||||
@@ -509,17 +524,17 @@ public struct NodePairRequestParams: Codable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct NodePairListParams: Codable {
|
public struct NodePairListParams: Codable {}
|
||||||
}
|
|
||||||
|
|
||||||
public struct NodePairApproveParams: Codable {
|
public struct NodePairApproveParams: Codable {
|
||||||
public let requestid: String
|
public let requestid: String
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
requestid: String
|
requestid: String)
|
||||||
) {
|
{
|
||||||
self.requestid = requestid
|
self.requestid = requestid
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case requestid = "requestId"
|
case requestid = "requestId"
|
||||||
}
|
}
|
||||||
@@ -529,10 +544,11 @@ public struct NodePairRejectParams: Codable {
|
|||||||
public let requestid: String
|
public let requestid: String
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
requestid: String
|
requestid: String)
|
||||||
) {
|
{
|
||||||
self.requestid = requestid
|
self.requestid = requestid
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case requestid = "requestId"
|
case requestid = "requestId"
|
||||||
}
|
}
|
||||||
@@ -544,11 +560,12 @@ public struct NodePairVerifyParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
nodeid: String,
|
nodeid: String,
|
||||||
token: String
|
token: String)
|
||||||
) {
|
{
|
||||||
self.nodeid = nodeid
|
self.nodeid = nodeid
|
||||||
self.token = token
|
self.token = token
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case nodeid = "nodeId"
|
case nodeid = "nodeId"
|
||||||
case token
|
case token
|
||||||
@@ -561,28 +578,29 @@ public struct NodeRenameParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
nodeid: String,
|
nodeid: String,
|
||||||
displayname: String
|
displayname: String)
|
||||||
) {
|
{
|
||||||
self.nodeid = nodeid
|
self.nodeid = nodeid
|
||||||
self.displayname = displayname
|
self.displayname = displayname
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case nodeid = "nodeId"
|
case nodeid = "nodeId"
|
||||||
case displayname = "displayName"
|
case displayname = "displayName"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct NodeListParams: Codable {
|
public struct NodeListParams: Codable {}
|
||||||
}
|
|
||||||
|
|
||||||
public struct NodeDescribeParams: Codable {
|
public struct NodeDescribeParams: Codable {
|
||||||
public let nodeid: String
|
public let nodeid: String
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
nodeid: String
|
nodeid: String)
|
||||||
) {
|
{
|
||||||
self.nodeid = nodeid
|
self.nodeid = nodeid
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case nodeid = "nodeId"
|
case nodeid = "nodeId"
|
||||||
}
|
}
|
||||||
@@ -600,14 +618,15 @@ public struct NodeInvokeParams: Codable {
|
|||||||
command: String,
|
command: String,
|
||||||
params: AnyCodable?,
|
params: AnyCodable?,
|
||||||
timeoutms: Int?,
|
timeoutms: Int?,
|
||||||
idempotencykey: String
|
idempotencykey: String)
|
||||||
) {
|
{
|
||||||
self.nodeid = nodeid
|
self.nodeid = nodeid
|
||||||
self.command = command
|
self.command = command
|
||||||
self.params = params
|
self.params = params
|
||||||
self.timeoutms = timeoutms
|
self.timeoutms = timeoutms
|
||||||
self.idempotencykey = idempotencykey
|
self.idempotencykey = idempotencykey
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case nodeid = "nodeId"
|
case nodeid = "nodeId"
|
||||||
case command
|
case command
|
||||||
@@ -627,13 +646,14 @@ public struct SessionsListParams: Codable {
|
|||||||
limit: Int?,
|
limit: Int?,
|
||||||
activeminutes: Int?,
|
activeminutes: Int?,
|
||||||
includeglobal: Bool?,
|
includeglobal: Bool?,
|
||||||
includeunknown: Bool?
|
includeunknown: Bool?)
|
||||||
) {
|
{
|
||||||
self.limit = limit
|
self.limit = limit
|
||||||
self.activeminutes = activeminutes
|
self.activeminutes = activeminutes
|
||||||
self.includeglobal = includeglobal
|
self.includeglobal = includeglobal
|
||||||
self.includeunknown = includeunknown
|
self.includeunknown = includeunknown
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case limit
|
case limit
|
||||||
case activeminutes = "activeMinutes"
|
case activeminutes = "activeMinutes"
|
||||||
@@ -658,8 +678,8 @@ public struct SessionsPatchParams: Codable {
|
|||||||
elevatedlevel: AnyCodable?,
|
elevatedlevel: AnyCodable?,
|
||||||
model: AnyCodable?,
|
model: AnyCodable?,
|
||||||
sendpolicy: AnyCodable?,
|
sendpolicy: AnyCodable?,
|
||||||
groupactivation: AnyCodable?
|
groupactivation: AnyCodable?)
|
||||||
) {
|
{
|
||||||
self.key = key
|
self.key = key
|
||||||
self.thinkinglevel = thinkinglevel
|
self.thinkinglevel = thinkinglevel
|
||||||
self.verboselevel = verboselevel
|
self.verboselevel = verboselevel
|
||||||
@@ -668,6 +688,7 @@ public struct SessionsPatchParams: Codable {
|
|||||||
self.sendpolicy = sendpolicy
|
self.sendpolicy = sendpolicy
|
||||||
self.groupactivation = groupactivation
|
self.groupactivation = groupactivation
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case key
|
case key
|
||||||
case thinkinglevel = "thinkingLevel"
|
case thinkinglevel = "thinkingLevel"
|
||||||
@@ -683,10 +704,11 @@ public struct SessionsResetParams: Codable {
|
|||||||
public let key: String
|
public let key: String
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
key: String
|
key: String)
|
||||||
) {
|
{
|
||||||
self.key = key
|
self.key = key
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case key
|
case key
|
||||||
}
|
}
|
||||||
@@ -698,11 +720,12 @@ public struct SessionsDeleteParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
key: String,
|
key: String,
|
||||||
deletetranscript: Bool?
|
deletetranscript: Bool?)
|
||||||
) {
|
{
|
||||||
self.key = key
|
self.key = key
|
||||||
self.deletetranscript = deletetranscript
|
self.deletetranscript = deletetranscript
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case key
|
case key
|
||||||
case deletetranscript = "deleteTranscript"
|
case deletetranscript = "deleteTranscript"
|
||||||
@@ -715,35 +738,35 @@ public struct SessionsCompactParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
key: String,
|
key: String,
|
||||||
maxlines: Int?
|
maxlines: Int?)
|
||||||
) {
|
{
|
||||||
self.key = key
|
self.key = key
|
||||||
self.maxlines = maxlines
|
self.maxlines = maxlines
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case key
|
case key
|
||||||
case maxlines = "maxLines"
|
case maxlines = "maxLines"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConfigGetParams: Codable {
|
public struct ConfigGetParams: Codable {}
|
||||||
}
|
|
||||||
|
|
||||||
public struct ConfigSetParams: Codable {
|
public struct ConfigSetParams: Codable {
|
||||||
public let raw: String
|
public let raw: String
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
raw: String
|
raw: String)
|
||||||
) {
|
{
|
||||||
self.raw = raw
|
self.raw = raw
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case raw
|
case raw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConfigSchemaParams: Codable {
|
public struct ConfigSchemaParams: Codable {}
|
||||||
}
|
|
||||||
|
|
||||||
public struct ConfigSchemaResponse: Codable {
|
public struct ConfigSchemaResponse: Codable {
|
||||||
public let schema: AnyCodable
|
public let schema: AnyCodable
|
||||||
@@ -755,13 +778,14 @@ public struct ConfigSchemaResponse: Codable {
|
|||||||
schema: AnyCodable,
|
schema: AnyCodable,
|
||||||
uihints: [String: AnyCodable],
|
uihints: [String: AnyCodable],
|
||||||
version: String,
|
version: String,
|
||||||
generatedat: String
|
generatedat: String)
|
||||||
) {
|
{
|
||||||
self.schema = schema
|
self.schema = schema
|
||||||
self.uihints = uihints
|
self.uihints = uihints
|
||||||
self.version = version
|
self.version = version
|
||||||
self.generatedat = generatedat
|
self.generatedat = generatedat
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case schema
|
case schema
|
||||||
case uihints = "uiHints"
|
case uihints = "uiHints"
|
||||||
@@ -776,11 +800,12 @@ public struct WizardStartParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
mode: AnyCodable?,
|
mode: AnyCodable?,
|
||||||
workspace: String?
|
workspace: String?)
|
||||||
) {
|
{
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.workspace = workspace
|
self.workspace = workspace
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case mode
|
case mode
|
||||||
case workspace
|
case workspace
|
||||||
@@ -793,11 +818,12 @@ public struct WizardNextParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
sessionid: String,
|
sessionid: String,
|
||||||
answer: [String: AnyCodable]?
|
answer: [String: AnyCodable]?)
|
||||||
) {
|
{
|
||||||
self.sessionid = sessionid
|
self.sessionid = sessionid
|
||||||
self.answer = answer
|
self.answer = answer
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case sessionid = "sessionId"
|
case sessionid = "sessionId"
|
||||||
case answer
|
case answer
|
||||||
@@ -808,10 +834,11 @@ public struct WizardCancelParams: Codable {
|
|||||||
public let sessionid: String
|
public let sessionid: String
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
sessionid: String
|
sessionid: String)
|
||||||
) {
|
{
|
||||||
self.sessionid = sessionid
|
self.sessionid = sessionid
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case sessionid = "sessionId"
|
case sessionid = "sessionId"
|
||||||
}
|
}
|
||||||
@@ -821,10 +848,11 @@ public struct WizardStatusParams: Codable {
|
|||||||
public let sessionid: String
|
public let sessionid: String
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
sessionid: String
|
sessionid: String)
|
||||||
) {
|
{
|
||||||
self.sessionid = sessionid
|
self.sessionid = sessionid
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case sessionid = "sessionId"
|
case sessionid = "sessionId"
|
||||||
}
|
}
|
||||||
@@ -850,8 +878,8 @@ public struct WizardStep: Codable {
|
|||||||
initialvalue: AnyCodable?,
|
initialvalue: AnyCodable?,
|
||||||
placeholder: String?,
|
placeholder: String?,
|
||||||
sensitive: Bool?,
|
sensitive: Bool?,
|
||||||
executor: AnyCodable?
|
executor: AnyCodable?)
|
||||||
) {
|
{
|
||||||
self.id = id
|
self.id = id
|
||||||
self.type = type
|
self.type = type
|
||||||
self.title = title
|
self.title = title
|
||||||
@@ -862,6 +890,7 @@ public struct WizardStep: Codable {
|
|||||||
self.sensitive = sensitive
|
self.sensitive = sensitive
|
||||||
self.executor = executor
|
self.executor = executor
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case id
|
case id
|
||||||
case type
|
case type
|
||||||
@@ -885,13 +914,14 @@ public struct WizardNextResult: Codable, Sendable {
|
|||||||
done: Bool,
|
done: Bool,
|
||||||
step: [String: AnyCodable]?,
|
step: [String: AnyCodable]?,
|
||||||
status: AnyCodable?,
|
status: AnyCodable?,
|
||||||
error: String?
|
error: String?)
|
||||||
) {
|
{
|
||||||
self.done = done
|
self.done = done
|
||||||
self.step = step
|
self.step = step
|
||||||
self.status = status
|
self.status = status
|
||||||
self.error = error
|
self.error = error
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case done
|
case done
|
||||||
case step
|
case step
|
||||||
@@ -912,14 +942,15 @@ public struct WizardStartResult: Codable, Sendable {
|
|||||||
done: Bool,
|
done: Bool,
|
||||||
step: [String: AnyCodable]?,
|
step: [String: AnyCodable]?,
|
||||||
status: AnyCodable?,
|
status: AnyCodable?,
|
||||||
error: String?
|
error: String?)
|
||||||
) {
|
{
|
||||||
self.sessionid = sessionid
|
self.sessionid = sessionid
|
||||||
self.done = done
|
self.done = done
|
||||||
self.step = step
|
self.step = step
|
||||||
self.status = status
|
self.status = status
|
||||||
self.error = error
|
self.error = error
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case sessionid = "sessionId"
|
case sessionid = "sessionId"
|
||||||
case done
|
case done
|
||||||
@@ -935,11 +966,12 @@ public struct WizardStatusResult: Codable, Sendable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
status: AnyCodable,
|
status: AnyCodable,
|
||||||
error: String?
|
error: String?)
|
||||||
) {
|
{
|
||||||
self.status = status
|
self.status = status
|
||||||
self.error = error
|
self.error = error
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case status
|
case status
|
||||||
case error
|
case error
|
||||||
@@ -952,11 +984,12 @@ public struct TalkModeParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
enabled: Bool,
|
enabled: Bool,
|
||||||
phase: String?
|
phase: String?)
|
||||||
) {
|
{
|
||||||
self.enabled = enabled
|
self.enabled = enabled
|
||||||
self.phase = phase
|
self.phase = phase
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case enabled
|
case enabled
|
||||||
case phase
|
case phase
|
||||||
@@ -969,11 +1002,12 @@ public struct ProvidersStatusParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
probe: Bool?,
|
probe: Bool?,
|
||||||
timeoutms: Int?
|
timeoutms: Int?)
|
||||||
) {
|
{
|
||||||
self.probe = probe
|
self.probe = probe
|
||||||
self.timeoutms = timeoutms
|
self.timeoutms = timeoutms
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case probe
|
case probe
|
||||||
case timeoutms = "timeoutMs"
|
case timeoutms = "timeoutMs"
|
||||||
@@ -988,12 +1022,13 @@ public struct WebLoginStartParams: Codable {
|
|||||||
public init(
|
public init(
|
||||||
force: Bool?,
|
force: Bool?,
|
||||||
timeoutms: Int?,
|
timeoutms: Int?,
|
||||||
verbose: Bool?
|
verbose: Bool?)
|
||||||
) {
|
{
|
||||||
self.force = force
|
self.force = force
|
||||||
self.timeoutms = timeoutms
|
self.timeoutms = timeoutms
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case force
|
case force
|
||||||
case timeoutms = "timeoutMs"
|
case timeoutms = "timeoutMs"
|
||||||
@@ -1005,10 +1040,11 @@ public struct WebLoginWaitParams: Codable {
|
|||||||
public let timeoutms: Int?
|
public let timeoutms: Int?
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
timeoutms: Int?
|
timeoutms: Int?)
|
||||||
) {
|
{
|
||||||
self.timeoutms = timeoutms
|
self.timeoutms = timeoutms
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case timeoutms = "timeoutMs"
|
case timeoutms = "timeoutMs"
|
||||||
}
|
}
|
||||||
@@ -1026,14 +1062,15 @@ public struct ModelChoice: Codable {
|
|||||||
name: String,
|
name: String,
|
||||||
provider: String,
|
provider: String,
|
||||||
contextwindow: Int?,
|
contextwindow: Int?,
|
||||||
reasoning: Bool?
|
reasoning: Bool?)
|
||||||
) {
|
{
|
||||||
self.id = id
|
self.id = id
|
||||||
self.name = name
|
self.name = name
|
||||||
self.provider = provider
|
self.provider = provider
|
||||||
self.contextwindow = contextwindow
|
self.contextwindow = contextwindow
|
||||||
self.reasoning = reasoning
|
self.reasoning = reasoning
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case id
|
case id
|
||||||
case name
|
case name
|
||||||
@@ -1043,24 +1080,23 @@ public struct ModelChoice: Codable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ModelsListParams: Codable {
|
public struct ModelsListParams: Codable {}
|
||||||
}
|
|
||||||
|
|
||||||
public struct ModelsListResult: Codable {
|
public struct ModelsListResult: Codable {
|
||||||
public let models: [ModelChoice]
|
public let models: [ModelChoice]
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
models: [ModelChoice]
|
models: [ModelChoice])
|
||||||
) {
|
{
|
||||||
self.models = models
|
self.models = models
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case models
|
case models
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct SkillsStatusParams: Codable {
|
public struct SkillsStatusParams: Codable {}
|
||||||
}
|
|
||||||
|
|
||||||
public struct SkillsInstallParams: Codable {
|
public struct SkillsInstallParams: Codable {
|
||||||
public let name: String
|
public let name: String
|
||||||
@@ -1070,12 +1106,13 @@ public struct SkillsInstallParams: Codable {
|
|||||||
public init(
|
public init(
|
||||||
name: String,
|
name: String,
|
||||||
installid: String,
|
installid: String,
|
||||||
timeoutms: Int?
|
timeoutms: Int?)
|
||||||
) {
|
{
|
||||||
self.name = name
|
self.name = name
|
||||||
self.installid = installid
|
self.installid = installid
|
||||||
self.timeoutms = timeoutms
|
self.timeoutms = timeoutms
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case name
|
case name
|
||||||
case installid = "installId"
|
case installid = "installId"
|
||||||
@@ -1093,13 +1130,14 @@ public struct SkillsUpdateParams: Codable {
|
|||||||
skillkey: String,
|
skillkey: String,
|
||||||
enabled: Bool?,
|
enabled: Bool?,
|
||||||
apikey: String?,
|
apikey: String?,
|
||||||
env: [String: AnyCodable]?
|
env: [String: AnyCodable]?)
|
||||||
) {
|
{
|
||||||
self.skillkey = skillkey
|
self.skillkey = skillkey
|
||||||
self.enabled = enabled
|
self.enabled = enabled
|
||||||
self.apikey = apikey
|
self.apikey = apikey
|
||||||
self.env = env
|
self.env = env
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case skillkey = "skillKey"
|
case skillkey = "skillKey"
|
||||||
case enabled
|
case enabled
|
||||||
@@ -1134,8 +1172,8 @@ public struct CronJob: Codable {
|
|||||||
wakemode: AnyCodable,
|
wakemode: AnyCodable,
|
||||||
payload: AnyCodable,
|
payload: AnyCodable,
|
||||||
isolation: [String: AnyCodable]?,
|
isolation: [String: AnyCodable]?,
|
||||||
state: [String: AnyCodable]
|
state: [String: AnyCodable])
|
||||||
) {
|
{
|
||||||
self.id = id
|
self.id = id
|
||||||
self.name = name
|
self.name = name
|
||||||
self.description = description
|
self.description = description
|
||||||
@@ -1149,6 +1187,7 @@ public struct CronJob: Codable {
|
|||||||
self.isolation = isolation
|
self.isolation = isolation
|
||||||
self.state = state
|
self.state = state
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case id
|
case id
|
||||||
case name
|
case name
|
||||||
@@ -1169,17 +1208,17 @@ public struct CronListParams: Codable {
|
|||||||
public let includedisabled: Bool?
|
public let includedisabled: Bool?
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
includedisabled: Bool?
|
includedisabled: Bool?)
|
||||||
) {
|
{
|
||||||
self.includedisabled = includedisabled
|
self.includedisabled = includedisabled
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case includedisabled = "includeDisabled"
|
case includedisabled = "includeDisabled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct CronStatusParams: Codable {
|
public struct CronStatusParams: Codable {}
|
||||||
}
|
|
||||||
|
|
||||||
public struct CronAddParams: Codable {
|
public struct CronAddParams: Codable {
|
||||||
public let name: String
|
public let name: String
|
||||||
@@ -1199,8 +1238,8 @@ public struct CronAddParams: Codable {
|
|||||||
sessiontarget: AnyCodable,
|
sessiontarget: AnyCodable,
|
||||||
wakemode: AnyCodable,
|
wakemode: AnyCodable,
|
||||||
payload: AnyCodable,
|
payload: AnyCodable,
|
||||||
isolation: [String: AnyCodable]?
|
isolation: [String: AnyCodable]?)
|
||||||
) {
|
{
|
||||||
self.name = name
|
self.name = name
|
||||||
self.description = description
|
self.description = description
|
||||||
self.enabled = enabled
|
self.enabled = enabled
|
||||||
@@ -1210,6 +1249,7 @@ public struct CronAddParams: Codable {
|
|||||||
self.payload = payload
|
self.payload = payload
|
||||||
self.isolation = isolation
|
self.isolation = isolation
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case name
|
case name
|
||||||
case description
|
case description
|
||||||
@@ -1228,11 +1268,12 @@ public struct CronUpdateParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
id: String,
|
id: String,
|
||||||
patch: [String: AnyCodable]
|
patch: [String: AnyCodable])
|
||||||
) {
|
{
|
||||||
self.id = id
|
self.id = id
|
||||||
self.patch = patch
|
self.patch = patch
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case id
|
case id
|
||||||
case patch
|
case patch
|
||||||
@@ -1243,10 +1284,11 @@ public struct CronRemoveParams: Codable {
|
|||||||
public let id: String
|
public let id: String
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
id: String
|
id: String)
|
||||||
) {
|
{
|
||||||
self.id = id
|
self.id = id
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case id
|
case id
|
||||||
}
|
}
|
||||||
@@ -1258,11 +1300,12 @@ public struct CronRunParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
id: String,
|
id: String,
|
||||||
mode: AnyCodable?
|
mode: AnyCodable?)
|
||||||
) {
|
{
|
||||||
self.id = id
|
self.id = id
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case id
|
case id
|
||||||
case mode
|
case mode
|
||||||
@@ -1275,11 +1318,12 @@ public struct CronRunsParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
id: String,
|
id: String,
|
||||||
limit: Int?
|
limit: Int?)
|
||||||
) {
|
{
|
||||||
self.id = id
|
self.id = id
|
||||||
self.limit = limit
|
self.limit = limit
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case id
|
case id
|
||||||
case limit
|
case limit
|
||||||
@@ -1306,8 +1350,8 @@ public struct CronRunLogEntry: Codable {
|
|||||||
summary: String?,
|
summary: String?,
|
||||||
runatms: Int?,
|
runatms: Int?,
|
||||||
durationms: Int?,
|
durationms: Int?,
|
||||||
nextrunatms: Int?
|
nextrunatms: Int?)
|
||||||
) {
|
{
|
||||||
self.ts = ts
|
self.ts = ts
|
||||||
self.jobid = jobid
|
self.jobid = jobid
|
||||||
self.action = action
|
self.action = action
|
||||||
@@ -1318,6 +1362,7 @@ public struct CronRunLogEntry: Codable {
|
|||||||
self.durationms = durationms
|
self.durationms = durationms
|
||||||
self.nextrunatms = nextrunatms
|
self.nextrunatms = nextrunatms
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case ts
|
case ts
|
||||||
case jobid = "jobId"
|
case jobid = "jobId"
|
||||||
@@ -1337,11 +1382,12 @@ public struct ChatHistoryParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
sessionkey: String,
|
sessionkey: String,
|
||||||
limit: Int?
|
limit: Int?)
|
||||||
) {
|
{
|
||||||
self.sessionkey = sessionkey
|
self.sessionkey = sessionkey
|
||||||
self.limit = limit
|
self.limit = limit
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case sessionkey = "sessionKey"
|
case sessionkey = "sessionKey"
|
||||||
case limit
|
case limit
|
||||||
@@ -1364,8 +1410,8 @@ public struct ChatSendParams: Codable {
|
|||||||
deliver: Bool?,
|
deliver: Bool?,
|
||||||
attachments: [AnyCodable]?,
|
attachments: [AnyCodable]?,
|
||||||
timeoutms: Int?,
|
timeoutms: Int?,
|
||||||
idempotencykey: String
|
idempotencykey: String)
|
||||||
) {
|
{
|
||||||
self.sessionkey = sessionkey
|
self.sessionkey = sessionkey
|
||||||
self.message = message
|
self.message = message
|
||||||
self.thinking = thinking
|
self.thinking = thinking
|
||||||
@@ -1374,6 +1420,7 @@ public struct ChatSendParams: Codable {
|
|||||||
self.timeoutms = timeoutms
|
self.timeoutms = timeoutms
|
||||||
self.idempotencykey = idempotencykey
|
self.idempotencykey = idempotencykey
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case sessionkey = "sessionKey"
|
case sessionkey = "sessionKey"
|
||||||
case message
|
case message
|
||||||
@@ -1391,11 +1438,12 @@ public struct ChatAbortParams: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
sessionkey: String,
|
sessionkey: String,
|
||||||
runid: String
|
runid: String)
|
||||||
) {
|
{
|
||||||
self.sessionkey = sessionkey
|
self.sessionkey = sessionkey
|
||||||
self.runid = runid
|
self.runid = runid
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case sessionkey = "sessionKey"
|
case sessionkey = "sessionKey"
|
||||||
case runid = "runId"
|
case runid = "runId"
|
||||||
@@ -1420,8 +1468,8 @@ public struct ChatEvent: Codable {
|
|||||||
message: AnyCodable?,
|
message: AnyCodable?,
|
||||||
errormessage: String?,
|
errormessage: String?,
|
||||||
usage: AnyCodable?,
|
usage: AnyCodable?,
|
||||||
stopreason: String?
|
stopreason: String?)
|
||||||
) {
|
{
|
||||||
self.runid = runid
|
self.runid = runid
|
||||||
self.sessionkey = sessionkey
|
self.sessionkey = sessionkey
|
||||||
self.seq = seq
|
self.seq = seq
|
||||||
@@ -1431,6 +1479,7 @@ public struct ChatEvent: Codable {
|
|||||||
self.usage = usage
|
self.usage = usage
|
||||||
self.stopreason = stopreason
|
self.stopreason = stopreason
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case runid = "runId"
|
case runid = "runId"
|
||||||
case sessionkey = "sessionKey"
|
case sessionkey = "sessionKey"
|
||||||
@@ -1447,10 +1496,11 @@ public struct TickEvent: Codable {
|
|||||||
public let ts: Int
|
public let ts: Int
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
ts: Int
|
ts: Int)
|
||||||
) {
|
{
|
||||||
self.ts = ts
|
self.ts = ts
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case ts
|
case ts
|
||||||
}
|
}
|
||||||
@@ -1462,11 +1512,12 @@ public struct ShutdownEvent: Codable {
|
|||||||
|
|
||||||
public init(
|
public init(
|
||||||
reason: String,
|
reason: String,
|
||||||
restartexpectedms: Int?
|
restartexpectedms: Int?)
|
||||||
) {
|
{
|
||||||
self.reason = reason
|
self.reason = reason
|
||||||
self.restartexpectedms = restartexpectedms
|
self.restartexpectedms = restartexpectedms
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case reason
|
case reason
|
||||||
case restartexpectedms = "restartExpectedMs"
|
case restartexpectedms = "restartExpectedMs"
|
||||||
@@ -1488,11 +1539,11 @@ public enum GatewayFrame: Codable {
|
|||||||
let type = try typeContainer.decode(String.self, forKey: .type)
|
let type = try typeContainer.decode(String.self, forKey: .type)
|
||||||
switch type {
|
switch type {
|
||||||
case "req":
|
case "req":
|
||||||
self = .req(try RequestFrame(from: decoder))
|
self = try .req(RequestFrame(from: decoder))
|
||||||
case "res":
|
case "res":
|
||||||
self = .res(try ResponseFrame(from: decoder))
|
self = try .res(ResponseFrame(from: decoder))
|
||||||
case "event":
|
case "event":
|
||||||
self = .event(try EventFrame(from: decoder))
|
self = try .event(EventFrame(from: decoder))
|
||||||
default:
|
default:
|
||||||
let container = try decoder.singleValueContainer()
|
let container = try decoder.singleValueContainer()
|
||||||
let raw = try container.decode([String: AnyCodable].self)
|
let raw = try container.decode([String: AnyCodable].self)
|
||||||
@@ -1502,13 +1553,12 @@ public enum GatewayFrame: Codable {
|
|||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
switch self {
|
switch self {
|
||||||
case .req(let v): try v.encode(to: encoder)
|
case let .req(v): try v.encode(to: encoder)
|
||||||
case .res(let v): try v.encode(to: encoder)
|
case let .res(v): try v.encode(to: encoder)
|
||||||
case .event(let v): try v.encode(to: encoder)
|
case let .event(v): try v.encode(to: encoder)
|
||||||
case .unknown(_, let raw):
|
case let .unknown(_, raw):
|
||||||
var container = encoder.singleValueContainer()
|
var container = encoder.singleValueContainer()
|
||||||
try container.encode(raw)
|
try container.encode(raw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user