Files
VCCPlusOSS/platforms/macos/Companion/CompanionDiskTransfer.swift
T

42 lines
1.1 KiB
Swift

// SPDX-License-Identifier: GPL-3.0-or-later
import Foundation
/// Immutable disk copies only. No writable file URL is passed between hosts.
enum CompanionDiskTransfer {
static let version = 1
struct Slot: Codable, Identifiable, Sendable {
let number: Int
let name: String?
let editing: Bool
var mediaID: UUID? = nil
var id: Int { number }
}
struct Destination: Codable, Identifiable, Sendable {
let id: UUID
let name: String
let permissionGranted: Bool
let slots: [Slot]
}
struct Request: Codable, Sendable {
let destination: UUID
let drive: Int
let name: String
let bytes: Data
let expectedDiskName: String?
var expectedMediaID: UUID? = nil
}
struct Receipt: Codable, Sendable {
enum Status: String, Codable { case waitingForPermission, received, denied }
let id: UUID
let status: Status
let message: String
}
}
struct CompanionCapabilities: Codable, Sendable {
let protocolVersion: Int
let productVersion: String
let diskEditor: Bool
let diskLibrary: Bool
}