1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.tangled.repo.artifact
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10 serde::Serialize,
11 serde::Deserialize,
12 Debug,
13 Clone,
14 PartialEq,
15 Eq,
16 jacquard_derive::IntoStatic,
17 bon::Builder
18)]
19#[serde(rename_all = "camelCase")]
20pub struct Artifact<'a> {
21 /// the artifact
22 #[serde(borrow)]
23 pub artifact: jacquard_common::types::blob::Blob<'a>,
24 /// time of creation of this artifact
25 pub created_at: jacquard_common::types::string::Datetime,
26 /// name of the artifact
27 #[serde(borrow)]
28 #[builder(into)]
29 pub name: jacquard_common::CowStr<'a>,
30 /// repo that this artifact is being uploaded to
31 #[serde(borrow)]
32 pub repo: jacquard_common::types::string::AtUri<'a>,
33 /// hash of the tag object that this artifact is attached to (only annotated tags are supported)
34 pub tag: bytes::Bytes,
35}
36
37/// Typed wrapper for GetRecord response with this collection's record type.
38#[derive(
39 serde::Serialize,
40 serde::Deserialize,
41 Debug,
42 Clone,
43 PartialEq,
44 Eq,
45 jacquard_derive::IntoStatic
46)]
47#[serde(rename_all = "camelCase")]
48pub struct ArtifactGetRecordOutput<'a> {
49 #[serde(skip_serializing_if = "std::option::Option::is_none")]
50 #[serde(borrow)]
51 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
52 #[serde(borrow)]
53 pub uri: jacquard_common::types::string::AtUri<'a>,
54 #[serde(borrow)]
55 pub value: Artifact<'a>,
56}
57
58/// Marker type for deserializing records from this collection.
59pub struct ArtifactRecord;
60impl jacquard_common::xrpc::XrpcResp for ArtifactRecord {
61 const NSID: &'static str = "sh.tangled.repo.artifact";
62 const ENCODING: &'static str = "application/json";
63 type Output<'de> = ArtifactGetRecordOutput<'de>;
64 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
65}
66
67impl jacquard_common::types::collection::Collection for Artifact<'_> {
68 const NSID: &'static str = "sh.tangled.repo.artifact";
69 type Record = ArtifactRecord;
70}
71
72impl From<ArtifactGetRecordOutput<'_>> for Artifact<'_> {
73 fn from(output: ArtifactGetRecordOutput<'_>) -> Self {
74 use jacquard_common::IntoStatic;
75 output.value.into_static()
76 }
77}