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)]
18#[serde(rename_all = "camelCase")]
19pub struct Artifact<'a> {
20 ///the artifact
21 #[serde(borrow)]
22 pub artifact: jacquard_common::types::blob::Blob<'a>,
23 ///time of creation of this artifact
24 pub created_at: jacquard_common::types::string::Datetime,
25 ///name of the artifact
26 #[serde(borrow)]
27 pub name: jacquard_common::CowStr<'a>,
28 ///repo that this artifact is being uploaded to
29 #[serde(borrow)]
30 pub repo: jacquard_common::types::string::AtUri<'a>,
31 ///hash of the tag object that this artifact is attached to (only annotated tags are supported)
32 pub tag: bytes::Bytes,
33}
34
35/// Typed wrapper for GetRecord response with this collection's record type.
36#[derive(
37 serde::Serialize,
38 serde::Deserialize,
39 Debug,
40 Clone,
41 PartialEq,
42 Eq,
43 jacquard_derive::IntoStatic
44)]
45#[serde(rename_all = "camelCase")]
46pub struct ArtifactGetRecordOutput<'a> {
47 #[serde(skip_serializing_if = "std::option::Option::is_none")]
48 #[serde(borrow)]
49 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
50 #[serde(borrow)]
51 pub uri: jacquard_common::types::string::AtUri<'a>,
52 #[serde(borrow)]
53 pub value: Artifact<'a>,
54}
55
56/// Marker type for deserializing records from this collection.
57pub struct ArtifactRecord;
58impl jacquard_common::xrpc::XrpcResp for ArtifactRecord {
59 const NSID: &'static str = "sh.tangled.repo.artifact";
60 const ENCODING: &'static str = "application/json";
61 type Output<'de> = ArtifactGetRecordOutput<'de>;
62 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
63}
64
65impl jacquard_common::types::collection::Collection for Artifact<'_> {
66 const NSID: &'static str = "sh.tangled.repo.artifact";
67 type Record = ArtifactRecord;
68}
69
70impl From<ArtifactGetRecordOutput<'_>> for Artifact<'_> {
71 fn from(output: ArtifactGetRecordOutput<'_>) -> Self {
72 use jacquard_common::IntoStatic;
73 output.value.into_static()
74 }
75}