1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.weaver.embed.images
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 Image<'a> {
21 /// alt text description of the image
22 #[serde(borrow)]
23 #[builder(into)]
24 pub alt: jacquard_common::CowStr<'a>,
25 /// Blurhash string for the image, used for low-resolution placeholders. This must be a valid Blurhash string.
26 #[serde(skip_serializing_if = "std::option::Option::is_none")]
27 #[builder(into)]
28 #[serde(borrow)]
29 pub blurhash: Option<jacquard_common::CowStr<'a>>,
30 #[serde(skip_serializing_if = "std::option::Option::is_none")]
31 #[builder(into)]
32 #[serde(borrow)]
33 pub dimensions: Option<ImageDimensions<'a>>,
34 #[serde(borrow)]
35 pub image: jacquard_common::types::blob::Blob<'a>,
36}
37
38#[jacquard_derive::open_union]
39#[derive(
40 serde::Serialize,
41 serde::Deserialize,
42 Debug,
43 Clone,
44 PartialEq,
45 Eq,
46 jacquard_derive::IntoStatic
47)]
48#[serde(tag = "$type")]
49#[serde(bound(deserialize = "'de: 'a"))]
50pub enum ImageDimensions<'a> {
51 #[serde(rename = "app.bsky.embed.defs#aspectRatio")]
52 AspectRatio(Box<crate::app_bsky::embed::AspectRatio<'a>>),
53 #[serde(rename = "sh.weaver.embed.defs#percentSize")]
54 PercentSize(Box<crate::sh_weaver::embed::PercentSize<'a>>),
55 #[serde(rename = "sh.weaver.embed.defs#pixelSize")]
56 PixelSize(Box<crate::sh_weaver::embed::PixelSize<'a>>),
57}
58
59#[jacquard_derive::lexicon]
60#[derive(
61 serde::Serialize,
62 serde::Deserialize,
63 Debug,
64 Clone,
65 PartialEq,
66 Eq,
67 jacquard_derive::IntoStatic,
68 bon::Builder
69)]
70#[serde(rename_all = "camelCase")]
71pub struct Images<'a> {
72 #[serde(borrow)]
73 pub images: Vec<crate::sh_weaver::embed::images::Image<'a>>,
74}