// Code generated by tools/generate.py; DO NOT EDIT. import Foundation public typealias JSONObject = [String: String] public let schemaSHA256 = "b8a69785112bb94d45f47c2250ca59d0bde47e3667b8ad89c9b0e2c4cfb25aec" public let currentWireVersion = "1" public let nMinus1WireVersion = "0" public let nMinus2WireVersion = "-1" public struct AllocationPolicy: Codable, Equatable { public let minimumKbps: Int64 public let targetKbps: Int64 public let maximumKbps: Int64 public let tier: String public let audience: String public let protocolValue: String public let protocolVersion: Int64 public let grantTtlSeconds: Int64 public let reservationLeaseSeconds: Int64 enum CodingKeys: String, CodingKey { case minimumKbps = "minimum_kbps" case targetKbps = "target_kbps" case maximumKbps = "maximum_kbps" case tier = "tier" case audience = "audience" case protocolValue = "protocol" case protocolVersion = "protocol_version" case grantTtlSeconds = "grant_ttl_seconds" case reservationLeaseSeconds = "reservation_lease_seconds" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) minimumKbps = try c.decode(Int64.self, forKey: .minimumKbps) targetKbps = try c.decode(Int64.self, forKey: .targetKbps) maximumKbps = try c.decode(Int64.self, forKey: .maximumKbps) tier = try c.decode(String.self, forKey: .tier) audience = try c.decode(String.self, forKey: .audience) protocolValue = try c.decode(String.self, forKey: .protocolValue) protocolVersion = try c.decode(Int64.self, forKey: .protocolVersion) grantTtlSeconds = try c.decode(Int64.self, forKey: .grantTtlSeconds) reservationLeaseSeconds = try c.decode(Int64.self, forKey: .reservationLeaseSeconds) } } public struct AssignedDesktop: Codable, Equatable { public let assignmentId: String public let poolId: String public let name: String public let availability: String enum CodingKeys: String, CodingKey { case assignmentId = "assignment_id" case poolId = "pool_id" case name = "name" case availability = "availability" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) assignmentId = try c.decode(String.self, forKey: .assignmentId) poolId = try c.decode(String.self, forKey: .poolId) name = try c.decode(String.self, forKey: .name) availability = try c.decode(String.self, forKey: .availability) } } public struct BrokerSession: Codable, Equatable { public let id: String public let principalId: String public let poolId: String public let assignmentId: String? public let state: String public let policySnapshot: AllocationPolicy public let reconnectDeadline: String? public let outcome: String? public let failureCode: String? public let cleanupState: String public let idempotencyKey: String public let correlationId: String public let requestedAt: String public let endedAt: String? public let version: Int64 enum CodingKeys: String, CodingKey { case id = "id" case principalId = "principal_id" case poolId = "pool_id" case assignmentId = "assignment_id" case state = "state" case policySnapshot = "policy_snapshot" case reconnectDeadline = "reconnect_deadline" case outcome = "outcome" case failureCode = "failure_code" case cleanupState = "cleanup_state" case idempotencyKey = "idempotency_key" case correlationId = "correlation_id" case requestedAt = "requested_at" case endedAt = "ended_at" case version = "version" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) id = try c.decode(String.self, forKey: .id) principalId = try c.decode(String.self, forKey: .principalId) poolId = try c.decode(String.self, forKey: .poolId) assignmentId = try c.decodeIfPresent(String.self, forKey: .assignmentId) state = try c.decode(String.self, forKey: .state) policySnapshot = try c.decode(AllocationPolicy.self, forKey: .policySnapshot) reconnectDeadline = try c.decodeIfPresent(String.self, forKey: .reconnectDeadline) outcome = try c.decodeIfPresent(String.self, forKey: .outcome) failureCode = try c.decodeIfPresent(String.self, forKey: .failureCode) cleanupState = try c.decode(String.self, forKey: .cleanupState) idempotencyKey = try c.decode(String.self, forKey: .idempotencyKey) correlationId = try c.decode(String.self, forKey: .correlationId) requestedAt = try c.decode(String.self, forKey: .requestedAt) endedAt = try c.decodeIfPresent(String.self, forKey: .endedAt) version = try c.decode(Int64.self, forKey: .version) } } public struct CapabilityProfile: Codable, Equatable { public let transport: String public let framing: String public let media: String public let audio: String public let sourceRateControl: String public let clientDecode: String enum CodingKeys: String, CodingKey { case transport = "transport" case framing = "framing" case media = "media" case audio = "audio" case sourceRateControl = "source_rate_control" case clientDecode = "client_decode" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) transport = try c.decode(String.self, forKey: .transport) framing = try c.decode(String.self, forKey: .framing) media = try c.decode(String.self, forKey: .media) audio = try c.decode(String.self, forKey: .audio) sourceRateControl = try c.decode(String.self, forKey: .sourceRateControl) clientDecode = try c.decode(String.self, forKey: .clientDecode) } } public struct ChannelFrame: Codable, Equatable { public let version: String public let flowId: String public let sequence: Int64 public let flags: Int64 public let fragmentIndex: Int64 public let fragmentCount: Int64 public let timestampMs: Int64 public let payload: String enum CodingKeys: String, CodingKey { case version = "version" case flowId = "flow_id" case sequence = "sequence" case flags = "flags" case fragmentIndex = "fragment_index" case fragmentCount = "fragment_count" case timestampMs = "timestamp_ms" case payload = "payload" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) flowId = try c.decode(String.self, forKey: .flowId) sequence = try c.decode(Int64.self, forKey: .sequence) flags = try c.decode(Int64.self, forKey: .flags) fragmentIndex = try c.decode(Int64.self, forKey: .fragmentIndex) fragmentCount = try c.decode(Int64.self, forKey: .fragmentCount) timestampMs = try c.decode(Int64.self, forKey: .timestampMs) payload = try c.decode(String.self, forKey: .payload) } } public struct ClipboardText: Codable, Equatable { public let text: String public let encoding: String enum CodingKeys: String, CodingKey { case text = "text" case encoding = "encoding" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) text = try c.decode(String.self, forKey: .text) encoding = try c.decode(String.self, forKey: .encoding) } } public struct ConnectionManifest: Codable, Equatable { public let version: String public let purpose: String public let sessionId: String public let reconnectSequence: Int64 public let gateway: ManifestGateway public let tunnel: ManifestTunnel public let profile: ManifestProfile public let grant: GrantReference public let correlationId: String enum CodingKeys: String, CodingKey { case version = "version" case purpose = "purpose" case sessionId = "session_id" case reconnectSequence = "reconnect_sequence" case gateway = "gateway" case tunnel = "tunnel" case profile = "profile" case grant = "grant" case correlationId = "correlation_id" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) purpose = try c.decode(String.self, forKey: .purpose) sessionId = try c.decode(String.self, forKey: .sessionId) reconnectSequence = try c.decode(Int64.self, forKey: .reconnectSequence) gateway = try c.decode(ManifestGateway.self, forKey: .gateway) tunnel = try c.decode(ManifestTunnel.self, forKey: .tunnel) profile = try c.decode(ManifestProfile.self, forKey: .profile) grant = try c.decode(GrantReference.self, forKey: .grant) correlationId = try c.decode(String.self, forKey: .correlationId) } } public struct DeviceChallenge: Codable, Equatable { public let deviceId: String public let serverId: String public let principalId: String public let challenge: String public let expiresAt: String public let algorithm: String public let signatureFormat: String enum CodingKeys: String, CodingKey { case deviceId = "device_id" case serverId = "server_id" case principalId = "principal_id" case challenge = "challenge" case expiresAt = "expires_at" case algorithm = "algorithm" case signatureFormat = "signature_format" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) deviceId = try c.decode(String.self, forKey: .deviceId) serverId = try c.decode(String.self, forKey: .serverId) principalId = try c.decode(String.self, forKey: .principalId) challenge = try c.decode(String.self, forKey: .challenge) expiresAt = try c.decode(String.self, forKey: .expiresAt) algorithm = try c.decode(String.self, forKey: .algorithm) signatureFormat = try c.decode(String.self, forKey: .signatureFormat) } } public struct DeviceProofRequest: Codable, Equatable { public let challenge: String public let signature: String enum CodingKeys: String, CodingKey { case challenge = "challenge" case signature = "signature" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) challenge = try c.decode(String.self, forKey: .challenge) signature = try c.decode(String.self, forKey: .signature) } } public struct DeviceRegistrationRequest: Codable, Equatable { public let name: String public let platform: String public let deviceSubject: String public let algorithm: String public let publicKey: String enum CodingKeys: String, CodingKey { case name = "name" case platform = "platform" case deviceSubject = "device_subject" case algorithm = "algorithm" case publicKey = "public_key" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) name = try c.decode(String.self, forKey: .name) platform = try c.decode(String.self, forKey: .platform) deviceSubject = try c.decode(String.self, forKey: .deviceSubject) algorithm = try c.decode(String.self, forKey: .algorithm) publicKey = try c.decode(String.self, forKey: .publicKey) } } public struct EntitledPool: Codable, Equatable { public let poolId: String public let name: String public let assignmentState: String enum CodingKeys: String, CodingKey { case poolId = "pool_id" case name = "name" case assignmentState = "assignment_state" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) poolId = try c.decode(String.self, forKey: .poolId) name = try c.decode(String.self, forKey: .name) assignmentState = try c.decode(String.self, forKey: .assignmentState) } } public struct ErrorEnvelope: Codable, Equatable { public let status: Bool public let error: String public let code: String public let message: String public let resolution: String public let requestId: String public let violations: [FieldViolation] enum CodingKeys: String, CodingKey { case status = "status" case error = "error" case code = "code" case message = "message" case resolution = "resolution" case requestId = "request_id" case violations = "violations" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) status = try c.decode(Bool.self, forKey: .status) error = try c.decode(String.self, forKey: .error) code = try c.decode(String.self, forKey: .code) message = try c.decode(String.self, forKey: .message) resolution = try c.decode(String.self, forKey: .resolution) requestId = try c.decode(String.self, forKey: .requestId) violations = try c.decode([FieldViolation].self, forKey: .violations) } } public struct EventEnvelope: Codable, Equatable { public let eventId: String public let sequence: Int64 public let type: String public let version: Int64 public let resource: ResourceLink public let occurredAt: String public let correlationId: String public let payload: JSONObject enum CodingKeys: String, CodingKey { case eventId = "event_id" case sequence = "sequence" case type = "type" case version = "version" case resource = "resource" case occurredAt = "occurred_at" case correlationId = "correlation_id" case payload = "payload" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) eventId = try c.decode(String.self, forKey: .eventId) sequence = try c.decode(Int64.self, forKey: .sequence) type = try c.decode(String.self, forKey: .type) version = try c.decode(Int64.self, forKey: .version) resource = try c.decode(ResourceLink.self, forKey: .resource) occurredAt = try c.decode(String.self, forKey: .occurredAt) correlationId = try c.decode(String.self, forKey: .correlationId) payload = try c.decode(JSONObject.self, forKey: .payload) } } public struct EventResume: Codable, Equatable { public let cursor: String public let lastSequence: Int64 enum CodingKeys: String, CodingKey { case cursor = "cursor" case lastSequence = "last_sequence" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) cursor = try c.decode(String.self, forKey: .cursor) lastSequence = try c.decode(Int64.self, forKey: .lastSequence) } } public struct FieldViolation: Codable, Equatable { public let field: String public let code: String enum CodingKeys: String, CodingKey { case field = "field" case code = "code" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) field = try c.decode(String.self, forKey: .field) code = try c.decode(String.self, forKey: .code) } } public struct GatewayDrain: Codable, Equatable { public let version: String public let gatewayId: String public let sequence: Int64 public let reason: String public let deadline: String enum CodingKeys: String, CodingKey { case version = "version" case gatewayId = "gateway_id" case sequence = "sequence" case reason = "reason" case deadline = "deadline" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) gatewayId = try c.decode(String.self, forKey: .gatewayId) sequence = try c.decode(Int64.self, forKey: .sequence) reason = try c.decode(String.self, forKey: .reason) deadline = try c.decode(String.self, forKey: .deadline) } } public struct GatewayHeartbeat: Codable, Equatable { public let version: String public let gatewayId: String public let sequence: Int64 public let observedAt: String public let activeConnections: Int64 public let egressKbps: Int64 public let state: String enum CodingKeys: String, CodingKey { case version = "version" case gatewayId = "gateway_id" case sequence = "sequence" case observedAt = "observed_at" case activeConnections = "active_connections" case egressKbps = "egress_kbps" case state = "state" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) gatewayId = try c.decode(String.self, forKey: .gatewayId) sequence = try c.decode(Int64.self, forKey: .sequence) observedAt = try c.decode(String.self, forKey: .observedAt) activeConnections = try c.decode(Int64.self, forKey: .activeConnections) egressKbps = try c.decode(Int64.self, forKey: .egressKbps) state = try c.decode(String.self, forKey: .state) } } public struct GatewayRegistration: Codable, Equatable { public let version: String public let gatewayId: String public let instanceIdentity: String public let certificateIdentity: String public let publicIdentity: String public let address: String public let providerIdentity: String public let protocolMinVersion: Int64 public let protocolMaxVersion: Int64 public let connectionCapacity: Int64 public let bandwidthCapacityKbps: Int64 public let features: [String] public let capabilities: CapabilityProfile enum CodingKeys: String, CodingKey { case version = "version" case gatewayId = "gateway_id" case instanceIdentity = "instance_identity" case certificateIdentity = "certificate_identity" case publicIdentity = "public_identity" case address = "address" case providerIdentity = "provider_identity" case protocolMinVersion = "protocol_min_version" case protocolMaxVersion = "protocol_max_version" case connectionCapacity = "connection_capacity" case bandwidthCapacityKbps = "bandwidth_capacity_kbps" case features = "features" case capabilities = "capabilities" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) gatewayId = try c.decode(String.self, forKey: .gatewayId) instanceIdentity = try c.decode(String.self, forKey: .instanceIdentity) certificateIdentity = try c.decode(String.self, forKey: .certificateIdentity) publicIdentity = try c.decode(String.self, forKey: .publicIdentity) address = try c.decode(String.self, forKey: .address) providerIdentity = try c.decode(String.self, forKey: .providerIdentity) protocolMinVersion = try c.decode(Int64.self, forKey: .protocolMinVersion) protocolMaxVersion = try c.decode(Int64.self, forKey: .protocolMaxVersion) connectionCapacity = try c.decode(Int64.self, forKey: .connectionCapacity) bandwidthCapacityKbps = try c.decode(Int64.self, forKey: .bandwidthCapacityKbps) features = try c.decode([String].self, forKey: .features) capabilities = try c.decode(CapabilityProfile.self, forKey: .capabilities) } } public struct GrantReference: Codable, Equatable { public let opaqueValue: String public let expiresAt: String public let audience: String enum CodingKeys: String, CodingKey { case opaqueValue = "opaque_value" case expiresAt = "expires_at" case audience = "audience" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) opaqueValue = try c.decode(String.self, forKey: .opaqueValue) expiresAt = try c.decode(String.self, forKey: .expiresAt) audience = try c.decode(String.self, forKey: .audience) } } public struct LoginRequest: Codable, Equatable { public let provider: String? public let username: String public let password: String enum CodingKeys: String, CodingKey { case provider = "provider" case username = "username" case password = "password" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) provider = try c.decodeIfPresent(String.self, forKey: .provider) username = try c.decode(String.self, forKey: .username) password = try c.decode(String.self, forKey: .password) } } public struct ManifestBounds: Codable, Equatable { public let minimumKbps: Int64 public let targetKbps: Int64 public let maximumKbps: Int64 enum CodingKeys: String, CodingKey { case minimumKbps = "minimum_kbps" case targetKbps = "target_kbps" case maximumKbps = "maximum_kbps" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) minimumKbps = try c.decode(Int64.self, forKey: .minimumKbps) targetKbps = try c.decode(Int64.self, forKey: .targetKbps) maximumKbps = try c.decode(Int64.self, forKey: .maximumKbps) } } public struct ManifestGateway: Codable, Equatable { public let id: String public let addresses: [String] public let publicIdentity: String enum CodingKeys: String, CodingKey { case id = "id" case addresses = "addresses" case publicIdentity = "public_identity" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) id = try c.decode(String.self, forKey: .id) addresses = try c.decode([String].self, forKey: .addresses) publicIdentity = try c.decode(String.self, forKey: .publicIdentity) } } public struct ManifestProfile: Codable, Equatable { public let id: String public let bounds: ManifestBounds enum CodingKeys: String, CodingKey { case id = "id" case bounds = "bounds" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) id = try c.decode(String.self, forKey: .id) bounds = try c.decode(ManifestBounds.self, forKey: .bounds) } } public struct ManifestTunnel: Codable, Equatable { public let versions: [String] public let features: [String] enum CodingKeys: String, CodingKey { case versions = "versions" case features = "features" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) versions = try c.decode([String].self, forKey: .versions) features = try c.decode([String].self, forKey: .features) } } public struct NativeCredential: Codable, Equatable { public let deviceId: String? public let familyId: String public let accessToken: String public let refreshToken: String public let expiresAt: String public let refreshExpiresAt: String? enum CodingKeys: String, CodingKey { case deviceId = "device_id" case familyId = "family_id" case accessToken = "access_token" case refreshToken = "refresh_token" case expiresAt = "expires_at" case refreshExpiresAt = "refresh_expires_at" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) deviceId = try c.decodeIfPresent(String.self, forKey: .deviceId) familyId = try c.decode(String.self, forKey: .familyId) accessToken = try c.decode(String.self, forKey: .accessToken) refreshToken = try c.decode(String.self, forKey: .refreshToken) expiresAt = try c.decode(String.self, forKey: .expiresAt) refreshExpiresAt = try c.decodeIfPresent(String.self, forKey: .refreshExpiresAt) } } public struct PageInfo: Codable, Equatable { public let limit: Int64 public let nextCursor: String enum CodingKeys: String, CodingKey { case limit = "limit" case nextCursor = "next_cursor" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) limit = try c.decode(Int64.self, forKey: .limit) nextCursor = try c.decode(String.self, forKey: .nextCursor) } } public struct ProviderState: Codable, Equatable { public let version: String public let sessionId: String public let state: String public let cleanupPending: Bool public let channels: [String] enum CodingKeys: String, CodingKey { case version = "version" case sessionId = "session_id" case state = "state" case cleanupPending = "cleanup_pending" case channels = "channels" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) sessionId = try c.decode(String.self, forKey: .sessionId) state = try c.decode(String.self, forKey: .state) cleanupPending = try c.decode(Bool.self, forKey: .cleanupPending) channels = try c.decode([String].self, forKey: .channels) } } public struct ReauthGrant: Codable, Equatable { public let token: String public let purpose: String public let expiresAt: String enum CodingKeys: String, CodingKey { case token = "token" case purpose = "purpose" case expiresAt = "expires_at" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) token = try c.decode(String.self, forKey: .token) purpose = try c.decode(String.self, forKey: .purpose) expiresAt = try c.decode(String.self, forKey: .expiresAt) } } public struct ReauthRequest: Codable, Equatable { public let password: String public let purpose: String enum CodingKeys: String, CodingKey { case password = "password" case purpose = "purpose" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) password = try c.decode(String.self, forKey: .password) purpose = try c.decode(String.self, forKey: .purpose) } } public struct ReconnectRequest: Codable, Equatable { public let clientDeviceId: String public let deviceKeyId: String public let expectedVersion: Int64 enum CodingKeys: String, CodingKey { case clientDeviceId = "client_device_id" case deviceKeyId = "device_key_id" case expectedVersion = "expected_version" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) clientDeviceId = try c.decode(String.self, forKey: .clientDeviceId) deviceKeyId = try c.decode(String.self, forKey: .deviceKeyId) expectedVersion = try c.decode(Int64.self, forKey: .expectedVersion) } } public struct RefreshRequest: Codable, Equatable { public let familyId: String public let refreshToken: String enum CodingKeys: String, CodingKey { case familyId = "family_id" case refreshToken = "refresh_token" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) familyId = try c.decode(String.self, forKey: .familyId) refreshToken = try c.decode(String.self, forKey: .refreshToken) } } public struct Resource: Codable, Equatable { public let id: String public let kind: String public let name: String public let state: String public let assignmentState: String? public let version: Int64 public let links: [ResourceLink] enum CodingKeys: String, CodingKey { case id = "id" case kind = "kind" case name = "name" case state = "state" case assignmentState = "assignment_state" case version = "version" case links = "links" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) id = try c.decode(String.self, forKey: .id) kind = try c.decode(String.self, forKey: .kind) name = try c.decode(String.self, forKey: .name) state = try c.decode(String.self, forKey: .state) assignmentState = try c.decodeIfPresent(String.self, forKey: .assignmentState) version = try c.decode(Int64.self, forKey: .version) links = try c.decode([ResourceLink].self, forKey: .links) } } public struct ResourceLink: Codable, Equatable { public let type: String public let id: String public let version: Int64 enum CodingKeys: String, CodingKey { case type = "type" case id = "id" case version = "version" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) type = try c.decode(String.self, forKey: .type) id = try c.decode(String.self, forKey: .id) version = try c.decode(Int64.self, forKey: .version) } } public struct ResourceList: Codable, Equatable { public let assignedDesktops: [AssignedDesktop] public let entitledPools: [EntitledPool] public let page: PageInfo enum CodingKeys: String, CodingKey { case assignedDesktops = "assigned_desktops" case entitledPools = "entitled_pools" case page = "page" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) assignedDesktops = try c.decode([AssignedDesktop].self, forKey: .assignedDesktops) entitledPools = try c.decode([EntitledPool].self, forKey: .entitledPools) page = try c.decode(PageInfo.self, forKey: .page) } } public struct SessionAuthority: Codable, Equatable { public let version: String public let sessionId: String public let gatewayId: String public let audience: String public let reconnectSequence: Int64 public let expiresAt: String public let capabilities: CapabilityProfile public let providerProfile: String public let providerIdentity: String enum CodingKeys: String, CodingKey { case version = "version" case sessionId = "session_id" case gatewayId = "gateway_id" case audience = "audience" case reconnectSequence = "reconnect_sequence" case expiresAt = "expires_at" case capabilities = "capabilities" case providerProfile = "provider_profile" case providerIdentity = "provider_identity" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) sessionId = try c.decode(String.self, forKey: .sessionId) gatewayId = try c.decode(String.self, forKey: .gatewayId) audience = try c.decode(String.self, forKey: .audience) reconnectSequence = try c.decode(Int64.self, forKey: .reconnectSequence) expiresAt = try c.decode(String.self, forKey: .expiresAt) capabilities = try c.decode(CapabilityProfile.self, forKey: .capabilities) providerProfile = try c.decode(String.self, forKey: .providerProfile) providerIdentity = try c.decode(String.self, forKey: .providerIdentity) } } public struct SessionRequest: Codable, Equatable { public let clientDeviceId: String public let deviceKeyId: String public let poolId: String public let idempotencyKey: String public let policySnapshot: AllocationPolicy enum CodingKeys: String, CodingKey { case clientDeviceId = "client_device_id" case deviceKeyId = "device_key_id" case poolId = "pool_id" case idempotencyKey = "idempotency_key" case policySnapshot = "policy_snapshot" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) clientDeviceId = try c.decode(String.self, forKey: .clientDeviceId) deviceKeyId = try c.decode(String.self, forKey: .deviceKeyId) poolId = try c.decode(String.self, forKey: .poolId) idempotencyKey = try c.decode(String.self, forKey: .idempotencyKey) policySnapshot = try c.decode(AllocationPolicy.self, forKey: .policySnapshot) } } public struct StableError: Codable, Equatable { public let version: String public let code: String public let message: String public let retryable: Bool enum CodingKeys: String, CodingKey { case version = "version" case code = "code" case message = "message" case retryable = "retryable" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) code = try c.decode(String.self, forKey: .code) message = try c.decode(String.self, forKey: .message) retryable = try c.decode(Bool.self, forKey: .retryable) } } public struct TunnelAdmissionRequest: Codable, Equatable { public let version: String public let sessionId: String public let gatewayId: String public let audience: String public let grant: String public let reconnectSequence: Int64 public let clientNonce: String public let capabilities: CapabilityProfile enum CodingKeys: String, CodingKey { case version = "version" case sessionId = "session_id" case gatewayId = "gateway_id" case audience = "audience" case grant = "grant" case reconnectSequence = "reconnect_sequence" case clientNonce = "client_nonce" case capabilities = "capabilities" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) version = try c.decode(String.self, forKey: .version) sessionId = try c.decode(String.self, forKey: .sessionId) gatewayId = try c.decode(String.self, forKey: .gatewayId) audience = try c.decode(String.self, forKey: .audience) grant = try c.decode(String.self, forKey: .grant) reconnectSequence = try c.decode(Int64.self, forKey: .reconnectSequence) clientNonce = try c.decode(String.self, forKey: .clientNonce) capabilities = try c.decode(CapabilityProfile.self, forKey: .capabilities) } } public struct VersionNegotiation: Codable, Equatable { public let supportedVersions: [String] public let features: [String] enum CodingKeys: String, CodingKey { case supportedVersions = "supported_versions" case features = "features" } public init(from decoder: Decoder) throws { let c = try decoder.container(keyedBy: CodingKeys.self) supportedVersions = try c.decode([String].self, forKey: .supportedVersions) features = try c.decode([String].self, forKey: .features) } }