bsky.lexicons.app.bsky.embed

AtProto lexicons record types of app.bsky.embed.*
struct Images;
Embed data of images
string type;
Type
struct Image;
Image[] images;
Images data
Blob image;
Blob of image
string alt;
Alt text
pure nothrow @nogc @safe this(Image[] images);
pure nothrow @safe this(Image image);
pure nothrow @safe this(Blob blob, string alt);
Constructor
struct External;
Embed data of external link
string type;
Type
struct External;
External external;
External data
string uri;
URL of external link
string title;
Title of external link
string description;
Descriptions
Blob thumb;
Thumbnail of external link
pure nothrow @nogc @safe this(External external);
Constructor
struct Record;
Embed data of record
string type;
Type
alias Record = bsky.lexicons.com.atproto.repo.StrongRef;
Record record;
Record data
pure nothrow @nogc @safe this(Record record);
pure nothrow @nogc @safe this(string uri, string cid);
Constructor
struct RecordWithMedia;
Embed data of external link
Examples: Embed data of external link
import std.json;
import bsky._internal.json;
auto rwm = RecordWithMedia(
	record: Record("at://test.bsly.social/app.bsky.feed.post/3kpadeirzya27", "abcde"),
	image: Images.Image(Blob.init, "test"));
auto jv = rwm.serializeToJson();
assert(jv.getValue!string("$type") == "app.bsky.embed.recordWithMedia");
assert("record" in jv);
assert("record" in jv["record"]);
assert("media" in jv);
assert(jv["record"]["record"].type == JSONType.object);
assert(jv["record"]["record"].getValue!string("uri") == "at://test.bsly.social/app.bsky.feed.post/3kpadeirzya27");
assert(jv["record"]["record"].getValue!string("cid") == "abcde");
assert(jv["media"].getValue!string("$type") == "app.bsky.embed.images");
auto rwm2 = jv.deserializeFromJson!RecordWithMedia;
assert(rwm == rwm2);
string type;
Type
Record record;
Record data
alias Media = std.sumtype.SumType!(Images, External).SumType;
Media media;
Image/External data
pure nothrow @nogc @safe this(Record record, Media media);
pure nothrow @nogc @safe this(Record record, External external);
pure nothrow @nogc @safe this(Record record, Images images);
pure nothrow @safe this(Record record, Images.Image image);
pure nothrow @nogc @safe this(StrongRef record, Media media);
pure nothrow @nogc @safe this(StrongRef record, External external);
pure nothrow @safe this(StrongRef record, Images.Image image);
pure nothrow @nogc @safe this(StrongRef record, Images images);
Constructor