Skip to main content

hanzo_client/models/
entry.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Entry {
16    /// 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.
17    #[serde(rename = "archetype", skip_serializing_if = "Option::is_none")]
18    pub archetype: Option<String>,
19    /// 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.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// 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\".
23    #[serde(rename = "forkable", skip_serializing_if = "Option::is_none")]
24    pub forkable: Option<bool>,
25    /// 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.
26    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
27    pub id: Option<String>,
28    /// repo | site
29    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
30    pub kind: Option<String>,
31    /// 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.
32    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
33    pub language: Option<String>,
34    /// 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.
35    #[serde(rename = "license", skip_serializing_if = "Option::is_none")]
36    pub license: Option<String>,
37    /// 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.
38    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
39    pub name: Option<String>,
40    /// 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.
41    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
42    pub note: Option<String>,
43    /// hanzo | lux | zoo
44    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
45    pub org: Option<String>,
46    /// 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.
47    #[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
48    pub origin: Option<String>,
49    /// source
50    #[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
51    pub repo: Option<String>,
52    /// 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.
53    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
54    pub scope: Option<String>,
55    /// 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.
56    #[serde(rename = "stars", skip_serializing_if = "Option::is_none")]
57    pub stars: Option<i32>,
58    /// lineage, if forked from one
59    #[serde(rename = "template", skip_serializing_if = "Option::is_none")]
60    pub template: Option<String>,
61    /// 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.
62    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
63    pub title: Option<String>,
64    /// 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.
65    #[serde(rename = "updated", skip_serializing_if = "Option::is_none")]
66    pub updated: Option<String>,
67    /// 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.
68    #[serde(rename = "upstream", skip_serializing_if = "Option::is_none")]
69    pub upstream: Option<String>,
70    /// live, if it is deployed
71    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
72    pub url: Option<String>,
73}
74
75impl Entry {
76    pub fn new() -> Entry {
77        Entry {
78            archetype: None,
79            description: None,
80            forkable: None,
81            id: None,
82            kind: None,
83            language: None,
84            license: None,
85            name: None,
86            note: None,
87            org: None,
88            origin: None,
89            repo: None,
90            scope: None,
91            stars: None,
92            template: None,
93            title: None,
94            updated: None,
95            upstream: None,
96            url: None,
97        }
98    }
99}
100