Hutch/Models/ArtifactInfo.swift

b5af561d68e7535726b79d4ceec0d0a45abf0042
hutch/Hutch/Models/ArtifactInfo.swift history · blame · raw

22 lines · 556 bytes

 1import Foundation
 2
 3/// An artifact with its parent reference name, used in the artifacts tab.
 4struct ArtifactInfo: Codable, Sendable, Identifiable {
 5    let id: Int
 6    let filename: String
 7    let checksum: String
 8    let size: Int
 9    let url: URL
10}
11
12struct ArtifactPage: Codable, Sendable {
13    let results: [ArtifactInfo]
14    let cursor: String?
15}
16
17/// A reference (tag) that has associated artifacts.
18struct ReferenceWithArtifacts: Codable, Sendable, Identifiable {
19    var id: String { name }
20    let name: String
21    let artifacts: [ArtifactInfo]
22}