@@ -152,6 +152,11 @@ public enum SessionPlacementState: String, Codable, Sendable {
152152 case failed = "failed"
153153}
154154
155+ public enum SessionMovePlacementState: String, Codable, Sendable {
156+ case local = "local"
157+ case active = "active"
158+ }
159+
155160public enum SessionDiscussionState: String, Codable, Sendable {
156161 case none = "none"
157162 case available = "available"
@@ -7615,6 +7620,263 @@ public struct SessionsReclaimResult: Codable, Sendable {
76157620 }
76167621}
76177622
7623+ public struct SessionMoveExpectedSource: Codable, Sendable {
7624+ public let generation: Int
7625+ public let environmentid: String
7626+ public let ownerepoch: Int
7627+
7628+ public init(
7629+ generation: Int,
7630+ environmentid: String,
7631+ ownerepoch: Int)
7632+ {
7633+ self.generation = generation
7634+ self.environmentid = environmentid
7635+ self.ownerepoch = ownerepoch
7636+ }
7637+
7638+ private enum CodingKeys: String, CodingKey {
7639+ case generation
7640+ case environmentid = "environmentId"
7641+ case ownerepoch = "ownerEpoch"
7642+ }
7643+ }
7644+
7645+ public struct SessionMoveGatewayTarget: Codable, Sendable {
7646+ public let kind: String
7647+
7648+ public init()
7649+ {
7650+ self.kind = "gateway"
7651+ }
7652+
7653+ private enum CodingKeys: String, CodingKey {
7654+ case kind
7655+ }
7656+
7657+ public init(from decoder: Decoder) throws {
7658+ let rawContainer = try decoder.container(keyedBy: GatewayAnyCodingKey.self)
7659+ let unexpectedKeys = rawContainer.allKeys
7660+ .map(\.stringValue)
7661+ .filter { !Set(["kind"]).contains($0) }
7662+ if !unexpectedKeys.isEmpty {
7663+ throw DecodingError.dataCorrupted(
7664+ .init(
7665+ codingPath: rawContainer.codingPath,
7666+ debugDescription: "Unexpected keys for SessionMoveGatewayTarget: \(unexpectedKeys.sorted().joined(separator: ", "))"
7667+ )
7668+ )
7669+ }
7670+ let container = try decoder.container(keyedBy: CodingKeys.self)
7671+ let decodedKind = try container.decode(String.self, forKey: .kind)
7672+ guard decodedKind == "gateway" else {
7673+ throw DecodingError.dataCorruptedError(
7674+ forKey: .kind,
7675+ in: container,
7676+ debugDescription: "Expected kind to equal gateway"
7677+ )
7678+ }
7679+ self.kind = "gateway"
7680+ }
7681+
7682+ public func encode(to encoder: Encoder) throws {
7683+ var container = encoder.container(keyedBy: CodingKeys.self)
7684+ try container.encode("gateway", forKey: .kind)
7685+ }
7686+ }
7687+
7688+ public struct SessionMoveProfileTarget: Codable, Sendable {
7689+ public let kind: String
7690+ public let profileid: String
7691+
7692+ public init(
7693+ profileid: String
7694+ )
7695+ {
7696+ self.kind = "profile"
7697+ self.profileid = profileid
7698+ }
7699+
7700+ private enum CodingKeys: String, CodingKey {
7701+ case kind
7702+ case profileid = "profileId"
7703+ }
7704+
7705+ public init(from decoder: Decoder) throws {
7706+ let rawContainer = try decoder.container(keyedBy: GatewayAnyCodingKey.self)
7707+ let unexpectedKeys = rawContainer.allKeys
7708+ .map(\.stringValue)
7709+ .filter { !Set(["kind", "profileId"]).contains($0) }
7710+ if !unexpectedKeys.isEmpty {
7711+ throw DecodingError.dataCorrupted(
7712+ .init(
7713+ codingPath: rawContainer.codingPath,
7714+ debugDescription: "Unexpected keys for SessionMoveProfileTarget: \(unexpectedKeys.sorted().joined(separator: ", "))"
7715+ )
7716+ )
7717+ }
7718+ let container = try decoder.container(keyedBy: CodingKeys.self)
7719+ let decodedKind = try container.decode(String.self, forKey: .kind)
7720+ guard decodedKind == "profile" else {
7721+ throw DecodingError.dataCorruptedError(
7722+ forKey: .kind,
7723+ in: container,
7724+ debugDescription: "Expected kind to equal profile"
7725+ )
7726+ }
7727+ self.kind = "profile"
7728+ self.profileid = try container.decode(String.self, forKey: .profileid)
7729+ }
7730+
7731+ public func encode(to encoder: Encoder) throws {
7732+ var container = encoder.container(keyedBy: CodingKeys.self)
7733+ try container.encode("profile", forKey: .kind)
7734+ try container.encode(profileid, forKey: .profileid)
7735+ }
7736+ }
7737+
7738+ public struct SessionMoveDeviceTarget: Codable, Sendable {
7739+ public let kind: String
7740+ public let deviceid: String
7741+
7742+ public init(
7743+ deviceid: String
7744+ )
7745+ {
7746+ self.kind = "device"
7747+ self.deviceid = deviceid
7748+ }
7749+
7750+ private enum CodingKeys: String, CodingKey {
7751+ case kind
7752+ case deviceid = "deviceId"
7753+ }
7754+
7755+ public init(from decoder: Decoder) throws {
7756+ let rawContainer = try decoder.container(keyedBy: GatewayAnyCodingKey.self)
7757+ let unexpectedKeys = rawContainer.allKeys
7758+ .map(\.stringValue)
7759+ .filter { !Set(["kind", "deviceId"]).contains($0) }
7760+ if !unexpectedKeys.isEmpty {
7761+ throw DecodingError.dataCorrupted(
7762+ .init(
7763+ codingPath: rawContainer.codingPath,
7764+ debugDescription: "Unexpected keys for SessionMoveDeviceTarget: \(unexpectedKeys.sorted().joined(separator: ", "))"
7765+ )
7766+ )
7767+ }
7768+ let container = try decoder.container(keyedBy: CodingKeys.self)
7769+ let decodedKind = try container.decode(String.self, forKey: .kind)
7770+ guard decodedKind == "device" else {
7771+ throw DecodingError.dataCorruptedError(
7772+ forKey: .kind,
7773+ in: container,
7774+ debugDescription: "Expected kind to equal device"
7775+ )
7776+ }
7777+ self.kind = "device"
7778+ self.deviceid = try container.decode(String.self, forKey: .deviceid)
7779+ }
7780+
7781+ public func encode(to encoder: Encoder) throws {
7782+ var container = encoder.container(keyedBy: CodingKeys.self)
7783+ try container.encode("device", forKey: .kind)
7784+ try container.encode(deviceid, forKey: .deviceid)
7785+ }
7786+ }
7787+
7788+ public struct SessionPlacementMove: Codable, Sendable {
7789+ public let target: SessionMoveTarget
7790+ public let updatedatms: Int
7791+ public let error: String?
7792+
7793+ public init(
7794+ target: SessionMoveTarget,
7795+ updatedatms: Int,
7796+ error: String? = nil)
7797+ {
7798+ self.target = target
7799+ self.updatedatms = updatedatms
7800+ self.error = error
7801+ }
7802+
7803+ private enum CodingKeys: String, CodingKey {
7804+ case target
7805+ case updatedatms = "updatedAtMs"
7806+ case error
7807+ }
7808+ }
7809+
7810+ public struct SessionsMoveParams: Codable, Sendable {
7811+ public let key: String
7812+ public let agentid: String?
7813+ public let expected: SessionMoveExpectedSource
7814+ public let target: SessionMoveTarget
7815+
7816+ public init(
7817+ key: String,
7818+ agentid: String? = nil,
7819+ expected: SessionMoveExpectedSource,
7820+ target: SessionMoveTarget)
7821+ {
7822+ self.key = key
7823+ self.agentid = agentid
7824+ self.expected = expected
7825+ self.target = target
7826+ }
7827+
7828+ private enum CodingKeys: String, CodingKey {
7829+ case key
7830+ case agentid = "agentId"
7831+ case expected
7832+ case target
7833+ }
7834+ }
7835+
7836+ public struct SessionMovePlacement: Codable, Sendable {
7837+ public let state: SessionMovePlacementState
7838+ public let generation: Int
7839+
7840+ public init(
7841+ state: SessionMovePlacementState,
7842+ generation: Int)
7843+ {
7844+ self.state = state
7845+ self.generation = generation
7846+ }
7847+
7848+ private enum CodingKeys: String, CodingKey {
7849+ case state
7850+ case generation
7851+ }
7852+ }
7853+
7854+ public struct SessionsMoveResult: Codable, Sendable {
7855+ public let ok: Bool
7856+ public let key: String
7857+ public let sessionid: String
7858+ public let placement: SessionMovePlacement
7859+
7860+ public init(
7861+ ok: Bool,
7862+ key: String,
7863+ sessionid: String,
7864+ placement: SessionMovePlacement)
7865+ {
7866+ self.ok = ok
7867+ self.key = key
7868+ self.sessionid = sessionid
7869+ self.placement = placement
7870+ }
7871+
7872+ private enum CodingKeys: String, CodingKey {
7873+ case ok
7874+ case key
7875+ case sessionid = "sessionId"
7876+ case placement
7877+ }
7878+ }
7879+
76187880public struct SessionDiscussionInfo: Codable, Sendable {
76197881 public let state: SessionDiscussionState
76207882 public let embedurl: String?
@@ -20395,6 +20657,40 @@ public enum SessionsReclaimResultPlacement: Codable, Sendable {
2039520657 }
2039620658}
2039720659
20660+ public enum SessionMoveTarget: Codable, Sendable {
20661+ case gateway(SessionMoveGatewayTarget)
20662+ case profile(SessionMoveProfileTarget)
20663+ case device(SessionMoveDeviceTarget)
20664+
20665+ private enum CodingKeys: String, CodingKey {
20666+ case discriminator = "kind"
20667+ }
20668+
20669+ public init(from decoder: Decoder) throws {
20670+ let container = try decoder.container(keyedBy: CodingKeys.self)
20671+ let discriminator = try container.decode(String.self, forKey: .discriminator)
20672+ switch discriminator {
20673+ case "gateway": self = try .gateway(SessionMoveGatewayTarget(from: decoder))
20674+ case "profile": self = try .profile(SessionMoveProfileTarget(from: decoder))
20675+ case "device": self = try .device(SessionMoveDeviceTarget(from: decoder))
20676+ default:
20677+ throw DecodingError.dataCorruptedError(
20678+ forKey: .discriminator,
20679+ in: container,
20680+ debugDescription: "Unknown SessionMoveTarget discriminator value"
20681+ )
20682+ }
20683+ }
20684+
20685+ public func encode(to encoder: Encoder) throws {
20686+ switch self {
20687+ case .gateway(let value): try value.encode(to: encoder)
20688+ case .profile(let value): try value.encode(to: encoder)
20689+ case .device(let value): try value.encode(to: encoder)
20690+ }
20691+ }
20692+ }
20693+
2039820694public enum AuditActivityEventV1: Codable, Sendable {
2039920695 case agentRun(AuditActivityAgentRunV1)
2040020696 case toolAction(AuditActivityToolActionV1)
0 commit comments