mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
124 lines
7.9 KiB
Swift
124 lines
7.9 KiB
Swift
//
|
|
// Entry.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Entry: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Archetype is WHAT KIND OF THING this is, from a closed and ordered list — model | contract | chain | sdk | template | infra | site | app — derived from the repository's own topics, name and description, first match winning, and always `site` for a deployed site. It is DERIVED, never guessed by a model, because a wrong archetype hides a row from the browse rail more thoroughly than a missing one does. Empty when no topic matched: unclassified, not uncategorisable. */
|
|
public var archetype: String?
|
|
/** Description is the repository's own one-line GitHub description, carried verbatim. It comes from the SOURCE half of a row, so a site that was never matched to a repository has none, and nothing here is written by us. */
|
|
public var description: String?
|
|
/** Forkable is NOT omitempty: false is an answer here, not a missing field. Omitted, a client could not tell \"you cannot fork this\" from \"nobody said\". */
|
|
public var forkable: Bool?
|
|
/** ID is \"<org>/<name>\" and is the corpus's primary key: a re-published entry updates in place under it rather than accumulating duplicates, so it is the one handle stable enough to link to or to name in a `template` filter. Two orgs can spell the same id, and `canonical` picks which one keeps it. */
|
|
public var id: String?
|
|
/** repo | site */
|
|
public var kind: String?
|
|
/** Language is the repository's primary implementation language as GitHub computes it (\"Go\", \"TypeScript\"), and the case is GitHub's. Empty for a site with no source half and for a repository GitHub could not classify. */
|
|
public var language: String?
|
|
/** License is the terms that upstream work carries, in whichever form the half that credited it had: an SPDX id (\"MIT\", \"Apache-2.0\") on a GitHub fork, free text on a site whose publisher declared it. GitHub's NOASSERTION — \"we could not identify it\" — reads as none rather than as a licence by that name. So empty means UNDECLARED and never unencumbered, and Upstream is what says whether the question applies at all. */
|
|
public var license: String?
|
|
/** Name is the short identifier inside the org — the repository's name, or the site's slug — and is the half of ID after the slash. Not a display name; Title is. */
|
|
public var name: String?
|
|
/** Note is why a row is NOT in the published catalog, set by the admission gate (gate.go) on the sites it holds back. It is the difference between a demo that silently vanished from the public lens and one whose owner can read the reason and fix it. A published row never carries one. */
|
|
public var note: String?
|
|
/** hanzo | lux | zoo */
|
|
public var org: String?
|
|
/** Origin is WHAT THIS IS TO YOU: template | community | third-party | product (origin.go owns the four nouns and derives them). Not omitempty, for the same reason Forkable is not: every row has an answer, and a missing one is exactly the flattening this field exists to end. */
|
|
public var origin: String?
|
|
/** source */
|
|
public var repo: String?
|
|
/** Scope is provenance, not storage: \"public\" for a row from the published corpus, \"org\" for one only this caller can see. A UI that cannot tell them apart cannot warn before sharing a link. */
|
|
public var scope: String?
|
|
/** Stars is GitHub's stargazer count for the source repository, read at the last sync and never accumulated here. It is not a ranking — the page sorts on Updated — but it is the tiebreak when two orgs claim one ID. Absent for a site with no repository behind it, and for a repository nobody has starred. */
|
|
public var stars: Int64?
|
|
/** lineage, if forked from one */
|
|
public var template: String?
|
|
/** Title is what to SHOW. A site's human name wins where it has one; a repo row falls back to the repository name, so on a repo this usually just repeats Name. Absent only for a site whose project was never named — render Name. */
|
|
public var title: String?
|
|
/** Updated is when the thing last MOVED, as RFC 3339 in UTC: a repository's last push, or a site's last deploy. The page is ordered on it, most recent first, by comparing these strings — so the format is load-bearing and not cosmetic. Absent means the source reported no timestamp, and such a row sorts last. */
|
|
public var updated: String?
|
|
/** Upstream/License credit the third-party work an entry was published from: the difference between \"this org built it\" and \"somebody else built it and we are showing it to you\". WHO built it is Org, above — the account that paid for the project. There was once a separate admin-gated `official` boolean here claiming the same thing, and because it was gated it disagreed: apps Hanzo wrote and hosts were published by a script holding an ordinary org token, so it stayed false on all of them and this directory filed our own work as somebody else's. A field that restates an unforgeable fact can only ever be the wrong copy of it. */
|
|
public var upstream: String?
|
|
/** live, if it is deployed */
|
|
public var url: String?
|
|
|
|
public init(archetype: String? = nil, description: String? = nil, forkable: Bool? = nil, id: String? = nil, kind: String? = nil, language: String? = nil, license: String? = nil, name: String? = nil, note: String? = nil, org: String? = nil, origin: String? = nil, repo: String? = nil, scope: String? = nil, stars: Int64? = nil, template: String? = nil, title: String? = nil, updated: String? = nil, upstream: String? = nil, url: String? = nil) {
|
|
self.archetype = archetype
|
|
self.description = description
|
|
self.forkable = forkable
|
|
self.id = id
|
|
self.kind = kind
|
|
self.language = language
|
|
self.license = license
|
|
self.name = name
|
|
self.note = note
|
|
self.org = org
|
|
self.origin = origin
|
|
self.repo = repo
|
|
self.scope = scope
|
|
self.stars = stars
|
|
self.template = template
|
|
self.title = title
|
|
self.updated = updated
|
|
self.upstream = upstream
|
|
self.url = url
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case archetype
|
|
case description
|
|
case forkable
|
|
case id
|
|
case kind
|
|
case language
|
|
case license
|
|
case name
|
|
case note
|
|
case org
|
|
case origin
|
|
case repo
|
|
case scope
|
|
case stars
|
|
case template
|
|
case title
|
|
case updated
|
|
case upstream
|
|
case url
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(archetype, forKey: .archetype)
|
|
try container.encodeIfPresent(description, forKey: .description)
|
|
try container.encodeIfPresent(forkable, forKey: .forkable)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(kind, forKey: .kind)
|
|
try container.encodeIfPresent(language, forKey: .language)
|
|
try container.encodeIfPresent(license, forKey: .license)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(note, forKey: .note)
|
|
try container.encodeIfPresent(org, forKey: .org)
|
|
try container.encodeIfPresent(origin, forKey: .origin)
|
|
try container.encodeIfPresent(repo, forKey: .repo)
|
|
try container.encodeIfPresent(scope, forKey: .scope)
|
|
try container.encodeIfPresent(stars, forKey: .stars)
|
|
try container.encodeIfPresent(template, forKey: .template)
|
|
try container.encodeIfPresent(title, forKey: .title)
|
|
try container.encodeIfPresent(updated, forKey: .updated)
|
|
try container.encodeIfPresent(upstream, forKey: .upstream)
|
|
try container.encodeIfPresent(url, forKey: .url)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension Entry: Identifiable {}
|