From b205332228458aeff1813dfa73ac109aa8a303d5 Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Sat, 11 Jan 2025 12:36:58 +0900 Subject: [PATCH] Update Bindings --- build_bindings.sh | 4 + src/FishyFlip/Lexicon/ATObject.g.cs | 8 + src/FishyFlip/Lexicon/ATProtocol.g.cs | 5 + .../Bookhive/ATProtoBookhiveExtensions.g.cs | 265 ++++++++++++++++ src/FishyFlip/Lexicon/Buzz/Bookhive/Book.g.cs | 168 ++++++++++ .../Buzz/Bookhive/BookhiveEndpoints.g.cs | 59 ++++ .../Buzz/Bookhive/BookhiveExtensions.g.cs | 287 ++++++++++++++++++ .../Lexicon/Buzz/Bookhive/BuzzBookhive.g.cs | 48 +++ .../Lexicon/Buzz/Bookhive/HiveBook.g.cs | 185 +++++++++++ .../Buzz/Bookhive/SearchBooksOutput.g.cs | 74 +++++ src/FishyFlip/Lexicon/CborExtensions.g.cs | 16 + .../Atproto/Moderation/ATProtoModeration.g.cs | 14 +- .../Moderation/ModerationEndpoints.g.cs | 14 +- .../Fm/Teal/Alpha/ATProtoAlphaExtensions.g.cs | 144 +++++++++ .../Alpha/Actor/ATProtoActorExtensions.g.cs | 251 +++++++++++++++ .../Fm/Teal/Alpha/Actor/FeaturedItem.g.cs | 76 +++++ .../Lexicon/Fm/Teal/Alpha/Actor/Profile.g.cs | 128 ++++++++ .../Lexicon/Fm/Teal/Alpha/Actor/Status.g.cs | 81 +++++ src/FishyFlip/Lexicon/Fm/Teal/Alpha/Play.g.cs | 184 +++++++++++ .../Lexicon/SourceGenerationContext.g.cs | 16 + .../ATProtoStatusphereExtensions.g.cs | 133 ++++++++ .../Lexicon/Xyz/Statusphere/Status.g.cs | 72 +++++ tools/FFSourceGen/Program.cs | 9 +- 23 files changed, 2226 insertions(+), 15 deletions(-) create mode 100644 src/FishyFlip/Lexicon/Buzz/Bookhive/ATProtoBookhiveExtensions.g.cs create mode 100644 src/FishyFlip/Lexicon/Buzz/Bookhive/Book.g.cs create mode 100644 src/FishyFlip/Lexicon/Buzz/Bookhive/BookhiveEndpoints.g.cs create mode 100644 src/FishyFlip/Lexicon/Buzz/Bookhive/BookhiveExtensions.g.cs create mode 100644 src/FishyFlip/Lexicon/Buzz/Bookhive/BuzzBookhive.g.cs create mode 100644 src/FishyFlip/Lexicon/Buzz/Bookhive/HiveBook.g.cs create mode 100644 src/FishyFlip/Lexicon/Buzz/Bookhive/SearchBooksOutput.g.cs create mode 100644 src/FishyFlip/Lexicon/Fm/Teal/Alpha/ATProtoAlphaExtensions.g.cs create mode 100644 src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/ATProtoActorExtensions.g.cs create mode 100644 src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/FeaturedItem.g.cs create mode 100644 src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/Profile.g.cs create mode 100644 src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/Status.g.cs create mode 100644 src/FishyFlip/Lexicon/Fm/Teal/Alpha/Play.g.cs create mode 100644 src/FishyFlip/Lexicon/Xyz/Statusphere/ATProtoStatusphereExtensions.g.cs create mode 100644 src/FishyFlip/Lexicon/Xyz/Statusphere/Status.g.cs diff --git a/build_bindings.sh b/build_bindings.sh index 71e90e7e..a5633709 100755 --- a/build_bindings.sh +++ b/build_bindings.sh @@ -18,6 +18,8 @@ REPOS=( "https://github.com/marukun712/AniBlue.git" "https://github.com/lexicon-community/lexicon.git" "https://github.com/icidasset/radical-edward.git" + "https://github.com/nperez0111/bookhive.git" + "https://github.com/teal-fm/teal.git" ) PWD=$(pwd) @@ -62,6 +64,8 @@ do REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/web/lexicons") elif [ "$target_dir" == "lexicon-community-lexicon" ]; then REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/community/lexicon") + elif [ "$target_dir" == "teal-fm-teal" ]; then + REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/packages/lexicons/real") elif [ "$target_dir" == "icidasset-radical-edward" ]; then REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/apps/byov/lexicons/ma/tokono/byov") else diff --git a/src/FishyFlip/Lexicon/ATObject.g.cs b/src/FishyFlip/Lexicon/ATObject.g.cs index a7bda19d..80c03cb9 100644 --- a/src/FishyFlip/Lexicon/ATObject.g.cs +++ b/src/FishyFlip/Lexicon/ATObject.g.cs @@ -30,6 +30,7 @@ namespace FishyFlip.Lexicon [JsonDerivedType(typeof(App.Bsky.Feed.BlockedPost), typeDiscriminator: "app.bsky.feed.defs#blockedPost")] [JsonDerivedType(typeof(Com.Whtwnd.Blog.BlogEntry), typeDiscriminator: "com.whtwnd.blog.defs#blogEntry")] [JsonDerivedType(typeof(Blue.Linkat.Board), typeDiscriminator: "blue.linkat.board")] + [JsonDerivedType(typeof(Buzz.Bookhive.Book), typeDiscriminator: "buzz.bookhive.book")] [JsonDerivedType(typeof(Community.Lexicon.Bookmarks.Bookmark), typeDiscriminator: "community.lexicon.bookmarks.bookmark")] [JsonDerivedType(typeof(Blue.Zio.Atfile.Browser), typeDiscriminator: "blue.zio.atfile.finger#browser")] [JsonDerivedType(typeof(App.Bsky.Actor.BskyAppProgressGuide), typeDiscriminator: "app.bsky.actor.defs#bskyAppProgressGuide")] @@ -96,6 +97,7 @@ namespace FishyFlip.Lexicon [JsonDerivedType(typeof(App.Bsky.Embed.External), typeDiscriminator: "app.bsky.embed.external#external")] [JsonDerivedType(typeof(App.Bsky.Richtext.Facet), typeDiscriminator: "app.bsky.richtext.facet")] [JsonDerivedType(typeof(Social.Psky.Richtext.Facet), typeDiscriminator: "social.psky.richtext.facet")] + [JsonDerivedType(typeof(Fm.Teal.Alpha.Actor.FeaturedItem), typeDiscriminator: "fm.teal.alpha.actor.profile#featuredItem")] [JsonDerivedType(typeof(App.Bsky.Feed.Feed), typeDiscriminator: "app.bsky.feed.describeFeedGenerator#feed")] [JsonDerivedType(typeof(App.Bsky.Graph.FeedItem), typeDiscriminator: "app.bsky.graph.starterpack#feedItem")] [JsonDerivedType(typeof(App.Bsky.Feed.FeedViewPost), typeDiscriminator: "app.bsky.feed.defs#feedViewPost")] @@ -181,6 +183,7 @@ namespace FishyFlip.Lexicon [JsonDerivedType(typeof(App.Bsky.Video.GetUploadLimitsOutput), typeDiscriminator: "app.bsky.video.getUploadLimits#GetUploadLimitsOutput")] [JsonDerivedType(typeof(Tools.Ozone.Set.GetValuesOutput), typeDiscriminator: "tools.ozone.set.getValues#GetValuesOutput")] [JsonDerivedType(typeof(App.Bsky.Actor.HiddenPostsPref), typeDiscriminator: "app.bsky.actor.defs#hiddenPostsPref")] + [JsonDerivedType(typeof(Buzz.Bookhive.HiveBook), typeDiscriminator: "buzz.bookhive.hiveBook")] [JsonDerivedType(typeof(Com.Shinolabs.Pinksea.HydratedOekaki), typeDiscriminator: "com.shinolabs.pinksea.appViewDefs#hydratedOekaki")] [JsonDerivedType(typeof(Com.Atproto.Sync.Identity), typeDiscriminator: "com.atproto.sync.subscribeRepos#identity")] [JsonDerivedType(typeof(Tools.Ozone.Moderation.IdentityEvent), typeDiscriminator: "tools.ozone.moderation.defs#identityEvent")] @@ -287,12 +290,14 @@ namespace FishyFlip.Lexicon [JsonDerivedType(typeof(Com.Whtwnd.Blog.Ogp), typeDiscriminator: "com.whtwnd.blog.defs#ogp")] [JsonDerivedType(typeof(Tools.Ozone.Setting.Option), typeDiscriminator: "tools.ozone.setting.defs#option")] [JsonDerivedType(typeof(App.Bsky.Actor.PersonalDetailsPref), typeDiscriminator: "app.bsky.actor.defs#personalDetailsPref")] + [JsonDerivedType(typeof(Fm.Teal.Alpha.Play), typeDiscriminator: "fm.teal.alpha.play")] [JsonDerivedType(typeof(App.Bsky.Feed.Post), typeDiscriminator: "app.bsky.feed.post")] [JsonDerivedType(typeof(Fyi.Unravel.Frontpage.Post), typeDiscriminator: "fyi.unravel.frontpage.post")] [JsonDerivedType(typeof(App.Bsky.Feed.Postgate), typeDiscriminator: "app.bsky.feed.postgate")] [JsonDerivedType(typeof(App.Bsky.Feed.PostView), typeDiscriminator: "app.bsky.feed.defs#postView")] [JsonDerivedType(typeof(App.Bsky.Actor.Profile), typeDiscriminator: "app.bsky.actor.profile")] [JsonDerivedType(typeof(Social.Psky.Actor.Profile), typeDiscriminator: "social.psky.actor.profile")] + [JsonDerivedType(typeof(Fm.Teal.Alpha.Actor.Profile), typeDiscriminator: "fm.teal.alpha.actor.profile")] [JsonDerivedType(typeof(App.Bsky.Actor.ProfileAssociated), typeDiscriminator: "app.bsky.actor.defs#profileAssociated")] [JsonDerivedType(typeof(App.Bsky.Actor.ProfileAssociatedChat), typeDiscriminator: "app.bsky.actor.defs#profileAssociatedChat")] [JsonDerivedType(typeof(App.Bsky.Actor.ProfileView), typeDiscriminator: "app.bsky.actor.defs#profileView")] @@ -355,6 +360,7 @@ namespace FishyFlip.Lexicon [JsonDerivedType(typeof(App.Bsky.Actor.SearchActorsOutput), typeDiscriminator: "app.bsky.actor.searchActors#SearchActorsOutput")] [JsonDerivedType(typeof(App.Bsky.Unspecced.SearchActorsSkeletonOutput), typeDiscriminator: "app.bsky.unspecced.searchActorsSkeleton#SearchActorsSkeletonOutput")] [JsonDerivedType(typeof(App.Bsky.Actor.SearchActorsTypeaheadOutput), typeDiscriminator: "app.bsky.actor.searchActorsTypeahead#SearchActorsTypeaheadOutput")] + [JsonDerivedType(typeof(Buzz.Bookhive.SearchBooksOutput), typeDiscriminator: "buzz.bookhive.searchBooks#SearchBooksOutput")] [JsonDerivedType(typeof(App.Bsky.Feed.SearchPostsOutput), typeDiscriminator: "app.bsky.feed.searchPosts#SearchPostsOutput")] [JsonDerivedType(typeof(App.Bsky.Unspecced.SearchPostsSkeletonOutput), typeDiscriminator: "app.bsky.unspecced.searchPostsSkeleton#SearchPostsSkeletonOutput")] [JsonDerivedType(typeof(Tools.Ozone.Moderation.SearchReposOutput), typeDiscriminator: "tools.ozone.moderation.searchRepos#SearchReposOutput")] @@ -387,6 +393,8 @@ namespace FishyFlip.Lexicon [JsonDerivedType(typeof(App.Bsky.Graph.StarterPackView), typeDiscriminator: "app.bsky.graph.defs#starterPackView")] [JsonDerivedType(typeof(App.Bsky.Graph.StarterPackViewBasic), typeDiscriminator: "app.bsky.graph.defs#starterPackViewBasic")] [JsonDerivedType(typeof(App.Netlify.Aniblue.Status), typeDiscriminator: "app.netlify.aniblue.status")] + [JsonDerivedType(typeof(Xyz.Statusphere.Status), typeDiscriminator: "xyz.statusphere.status")] + [JsonDerivedType(typeof(Fm.Teal.Alpha.Actor.Status), typeDiscriminator: "fm.teal.alpha.actor.status")] [JsonDerivedType(typeof(Com.Atproto.Admin.StatusAttr), typeDiscriminator: "com.atproto.admin.defs#statusAttr")] [JsonDerivedType(typeof(App.Netlify.Aniblue.StatusDef), typeDiscriminator: "app.netlify.aniblue.status#status")] [JsonDerivedType(typeof(Com.Atproto.Repo.StrongRef), typeDiscriminator: "com.atproto.repo.strongRef")] diff --git a/src/FishyFlip/Lexicon/ATProtocol.g.cs b/src/FishyFlip/Lexicon/ATProtocol.g.cs index 5b99c671..cd8bee06 100644 --- a/src/FishyFlip/Lexicon/ATProtocol.g.cs +++ b/src/FishyFlip/Lexicon/ATProtocol.g.cs @@ -48,6 +48,11 @@ public sealed partial class ATProtocol /// public FishyFlip.Lexicon.App.Bsky.Video.BlueskyVideo Video => new (this); + /// + /// buzz.bookhive Endpoint Group. + /// + public FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive BuzzBookhive => new (this); + /// /// chat.bsky.actor Endpoint Group. /// diff --git a/src/FishyFlip/Lexicon/Buzz/Bookhive/ATProtoBookhiveExtensions.g.cs b/src/FishyFlip/Lexicon/Buzz/Bookhive/ATProtoBookhiveExtensions.g.cs new file mode 100644 index 00000000..0cc2bd5a --- /dev/null +++ b/src/FishyFlip/Lexicon/Buzz/Bookhive/ATProtoBookhiveExtensions.g.cs @@ -0,0 +1,265 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +using FishyFlip.Lexicon.Com.Atproto.Repo; + +namespace FishyFlip.Lexicon.Buzz.Bookhive +{ + + /// + /// Extension methods for buzz.bookhive. + /// + public static class ATProtoBookhiveExtensions + { + + /// + /// Create a Book record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateBookAsync(this FishyFlip.ATProtocol atp, Buzz.Bookhive.Book record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a Book record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateBookAsync(this FishyFlip.ATProtocol atp, string? title, string? authors, string? hiveId, DateTime? createdAt = default, DateTime? startedAt = default, DateTime? finishedAt = default, Blob? cover = default, string? status = default, long? stars = default, string? review = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Buzz.Bookhive.Book(); + record.Title = title; + record.Authors = authors; + record.HiveId = hiveId; + record.CreatedAt = createdAt ?? DateTime.UtcNow; + record.StartedAt = startedAt; + record.FinishedAt = finishedAt; + record.Cover = cover; + record.Status = status; + record.Stars = stars; + record.Review = review; + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a Book record. + /// + /// + /// + /// + /// + /// + /// + public static Task> DeleteBookAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.DeleteRecordAsync(repo, "buzz.bookhive.book", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a Book record. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutBookAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Buzz.Bookhive.Book record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.PutRecordAsync(repo, "buzz.bookhive.book", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List Book records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListBookAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(repo, "buzz.bookhive.book", limit, cursor, reverse, cancellationToken); + } + + /// + /// List Book records. + /// + /// + /// + /// + /// + /// + public static Task> ListBookAsync(this FishyFlip.ATProtocol atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get Book records. + /// + /// + /// + /// + /// + /// + public static Task> GetBookAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(repo, "buzz.bookhive.book", rkey, cid, cancellationToken); + } + + /// + /// Get Book records. + /// + /// + /// + /// + /// + public static Task> GetBookAsync(this FishyFlip.ATProtocol atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", rkey, cid, cancellationToken); + } + /// + /// Create a HiveBook record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateHiveBookAsync(this FishyFlip.ATProtocol atp, Buzz.Bookhive.HiveBook record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a HiveBook record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateHiveBookAsync(this FishyFlip.ATProtocol atp, string? title, string? authors, string? id, string? thumbnail, DateTime? updatedAt, string? source = default, string? sourceUrl = default, string? sourceId = default, string? cover = default, string? description = default, long? rating = default, long? ratingsCount = default, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Buzz.Bookhive.HiveBook(); + record.Title = title; + record.Authors = authors; + record.Id = id; + record.Source = source; + record.SourceUrl = sourceUrl; + record.SourceId = sourceId; + record.Cover = cover; + record.Thumbnail = thumbnail; + record.Description = description; + record.Rating = rating; + record.RatingsCount = ratingsCount; + record.CreatedAt = createdAt ?? DateTime.UtcNow; + record.UpdatedAt = updatedAt; + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a HiveBook record. + /// + /// + /// + /// + /// + /// + /// + public static Task> DeleteHiveBookAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.DeleteRecordAsync(repo, "buzz.bookhive.hiveBook", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a HiveBook record. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutHiveBookAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Buzz.Bookhive.HiveBook record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.PutRecordAsync(repo, "buzz.bookhive.hiveBook", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List HiveBook records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListHiveBookAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(repo, "buzz.bookhive.hiveBook", limit, cursor, reverse, cancellationToken); + } + + /// + /// List HiveBook records. + /// + /// + /// + /// + /// + /// + public static Task> ListHiveBookAsync(this FishyFlip.ATProtocol atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get HiveBook records. + /// + /// + /// + /// + /// + /// + public static Task> GetHiveBookAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(repo, "buzz.bookhive.hiveBook", rkey, cid, cancellationToken); + } + + /// + /// Get HiveBook records. + /// + /// + /// + /// + /// + public static Task> GetHiveBookAsync(this FishyFlip.ATProtocol atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", rkey, cid, cancellationToken); + } + } +} + diff --git a/src/FishyFlip/Lexicon/Buzz/Bookhive/Book.g.cs b/src/FishyFlip/Lexicon/Buzz/Bookhive/Book.g.cs new file mode 100644 index 00000000..dc126ae0 --- /dev/null +++ b/src/FishyFlip/Lexicon/Buzz/Bookhive/Book.g.cs @@ -0,0 +1,168 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Buzz.Bookhive +{ + /// + /// A book in the user's library + /// + public partial class Book : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// The title of the book + /// The authors of the book (tab separated) + /// The book's hive id, used to correlate user's books with the hive + /// + /// The date the user started reading the book + /// The date the user finished reading the book + /// Cover image of the book + /// + ///
Known Values:
+ /// finished - User has finished reading the book
+ /// reading - User is currently reading the book
+ /// wantToRead - User wants to read the book
+ /// abandoned - User has abandoned the book
+ /// owned - User owns the book
+ /// + /// Number of stars given to the book (1-10) which will be mapped to 1-5 stars + /// The book's review + public Book(string? title, string? authors, string? hiveId, DateTime? createdAt = default, DateTime? startedAt = default, DateTime? finishedAt = default, Blob? cover = default, string? status = default, long? stars = default, string? review = default) + { + this.Title = title; + this.Authors = authors; + this.HiveId = hiveId; + this.CreatedAt = createdAt ?? DateTime.UtcNow; + this.StartedAt = startedAt; + this.FinishedAt = finishedAt; + this.Cover = cover; + this.Status = status; + this.Stars = stars; + this.Review = review; + } + + + /// + /// Initializes a new instance of the class. + /// + public Book() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public Book(CBORObject obj) + { + if (obj["title"] is not null) this.Title = obj["title"].AsString(); + if (obj["authors"] is not null) this.Authors = obj["authors"].AsString(); + if (obj["hiveId"] is not null) this.HiveId = obj["hiveId"].AsString(); + if (obj["createdAt"] is not null) this.CreatedAt = obj["createdAt"].ToDateTime(); + if (obj["startedAt"] is not null) this.StartedAt = obj["startedAt"].ToDateTime(); + if (obj["finishedAt"] is not null) this.FinishedAt = obj["finishedAt"].ToDateTime(); + if (obj["cover"] is not null) this.Cover = new FishyFlip.Models.Blob(obj["cover"]); + if (obj["status"] is not null) this.Status = obj["status"].AsString(); + if (obj["stars"] is not null) this.Stars = obj["stars"].AsInt64Value(); + if (obj["review"] is not null) this.Review = obj["review"].AsString(); + } + + /// + /// Gets or sets the title. + ///
The title of the book + ///
+ [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Gets or sets the authors. + ///
The authors of the book (tab separated) + ///
+ [JsonPropertyName("authors")] + public string? Authors { get; set; } + + /// + /// Gets or sets the hiveId. + ///
The book's hive id, used to correlate user's books with the hive + ///
+ [JsonPropertyName("hiveId")] + public string? HiveId { get; set; } + + /// + /// Gets or sets the createdAt. + /// + [JsonPropertyName("createdAt")] + public DateTime? CreatedAt { get; set; } = DateTime.UtcNow; + + /// + /// Gets or sets the startedAt. + ///
The date the user started reading the book + ///
+ [JsonPropertyName("startedAt")] + public DateTime? StartedAt { get; set; } + + /// + /// Gets or sets the finishedAt. + ///
The date the user finished reading the book + ///
+ [JsonPropertyName("finishedAt")] + public DateTime? FinishedAt { get; set; } + + /// + /// Gets or sets the cover. + ///
Cover image of the book + ///
+ [JsonPropertyName("cover")] + public Blob? Cover { get; set; } + + /// + /// Gets or sets the status. + ///
Known Values:
+ /// finished - User has finished reading the book
+ /// reading - User is currently reading the book
+ /// wantToRead - User wants to read the book
+ /// abandoned - User has abandoned the book
+ /// owned - User owns the book
+ ///
+ [JsonPropertyName("status")] + public string? Status { get; set; } + + /// + /// Gets or sets the stars. + ///
Number of stars given to the book (1-10) which will be mapped to 1-5 stars + ///
+ [JsonPropertyName("stars")] + public long? Stars { get; set; } + + /// + /// Gets or sets the review. + ///
The book's review + ///
+ [JsonPropertyName("review")] + public string? Review { get; set; } + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "buzz.bookhive.book"; + + public const string RecordType = "buzz.bookhive.book"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.BuzzBookhiveBook)!; + } + + public static Book FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.BuzzBookhiveBook)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/Buzz/Bookhive/BookhiveEndpoints.g.cs b/src/FishyFlip/Lexicon/Buzz/Bookhive/BookhiveEndpoints.g.cs new file mode 100644 index 00000000..f773d78f --- /dev/null +++ b/src/FishyFlip/Lexicon/Buzz/Bookhive/BookhiveEndpoints.g.cs @@ -0,0 +1,59 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Buzz.Bookhive +{ + + /// + /// buzz.bookhive Endpoint Group. + /// + public static class BookhiveEndpoints + { + + public const string SearchBooks = "/xrpc/buzz.bookhive.searchBooks"; + + + /// + /// Find books matching the search criteria. Requires authentication. + /// + /// + /// + /// + /// + /// + /// + /// Result of + public static Task> SearchBooksAsync (this FishyFlip.ATProtocol atp, string q, int? limit = 25, int? offset = 0, string? id = default, CancellationToken cancellationToken = default) + { + var endpointUrl = SearchBooks.ToString(); + endpointUrl += "?"; + List queryStrings = new(); + queryStrings.Add("q=" + q); + + if (limit != null) + { + queryStrings.Add("limit=" + limit); + } + + if (offset != null) + { + queryStrings.Add("offset=" + offset); + } + + if (id != null) + { + queryStrings.Add("id=" + id); + } + + var headers = new Dictionary(); + headers.Add(Constants.AtProtoAcceptLabelers, atp.Options.LabelDefinitionsHeader); + endpointUrl += string.Join("&", queryStrings); + return atp.Get(endpointUrl, atp.Options.SourceGenerationContext.BuzzBookhiveSearchBooksOutput!, cancellationToken, headers); + } + + } +} + diff --git a/src/FishyFlip/Lexicon/Buzz/Bookhive/BookhiveExtensions.g.cs b/src/FishyFlip/Lexicon/Buzz/Bookhive/BookhiveExtensions.g.cs new file mode 100644 index 00000000..efc9ffec --- /dev/null +++ b/src/FishyFlip/Lexicon/Buzz/Bookhive/BookhiveExtensions.g.cs @@ -0,0 +1,287 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +using FishyFlip.Lexicon.Com.Atproto.Repo; + +namespace FishyFlip.Lexicon +{ + + /// + /// Extension methods for buzz.bookhive. + /// + public static class BuzzBookhiveExtensions + { + + /// + /// Create a Book record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, FishyFlip.Lexicon.Buzz.Bookhive.Book record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.CreateRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a Book record. + /// + /// + /// The title of the book + /// The authors of the book (tab separated) + /// The book's hive id, used to correlate user's books with the hive + /// + /// The date the user started reading the book + /// The date the user finished reading the book + /// Cover image of the book + /// + ///
Known Values:
+ /// finished - A book in the user's library
+ /// reading - A book in the user's library
+ /// wantToRead - A book in the user's library
+ /// abandoned - A book in the user's library
+ /// owned - A book in the user's library
+ /// + /// Number of stars given to the book (1-10) which will be mapped to 1-5 stars + /// The book's review + /// + /// + /// + /// + public static Task> CreateBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, string? title, string? authors, string? hiveId, DateTime? createdAt = default, DateTime? startedAt = default, DateTime? finishedAt = default, Blob? cover = default, string? status = default, long? stars = default, string? review = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Buzz.Bookhive.Book(); + record.Title = title; + record.Authors = authors; + record.HiveId = hiveId; + record.CreatedAt = createdAt ?? DateTime.UtcNow; + record.StartedAt = startedAt; + record.FinishedAt = finishedAt; + record.Cover = cover; + record.Status = status; + record.Stars = stars; + record.Review = review; + return atp.ATProtocol.CreateRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a Book record. + /// + /// + /// + /// + /// + /// + public static Task> DeleteBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.DeleteRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a Book record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, string rkey, FishyFlip.Lexicon.Buzz.Bookhive.Book record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.PutRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List Book records. + /// + /// + /// + /// + /// + /// + public static Task> ListBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.ListRecordsAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", limit, cursor, reverse, cancellationToken); + } + + /// + /// List Book records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.ListRecordsAsync(repo, "buzz.bookhive.book", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get Book records. + /// + /// + /// + /// + /// + public static Task> GetBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.GetRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.book", rkey, cid, cancellationToken); + } + + /// + /// Get Book records. + /// + /// + /// + /// + /// + /// + public static Task> GetBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.GetRecordAsync(repo, "buzz.bookhive.book", rkey, cid, cancellationToken); + } + /// + /// Create a HiveBook record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateHiveBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, FishyFlip.Lexicon.Buzz.Bookhive.HiveBook record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.CreateRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a HiveBook record. + /// + /// + /// The title of the book + /// The authors of the book (tab separated) + /// The book's hive id, used to correlate user's books with the hive + /// URL to thumbnail image + /// + /// The source service name (e.g. Goodreads) + /// URL to the book on the source service + /// ID of the book in the source service + /// URL to full-size cover image + /// Book description/summary + /// Average rating (0-1000) + /// Number of ratings + /// + /// + /// + /// + /// + public static Task> CreateHiveBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, string? title, string? authors, string? id, string? thumbnail, DateTime? updatedAt, string? source = default, string? sourceUrl = default, string? sourceId = default, string? cover = default, string? description = default, long? rating = default, long? ratingsCount = default, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Buzz.Bookhive.HiveBook(); + record.Title = title; + record.Authors = authors; + record.Id = id; + record.Source = source; + record.SourceUrl = sourceUrl; + record.SourceId = sourceId; + record.Cover = cover; + record.Thumbnail = thumbnail; + record.Description = description; + record.Rating = rating; + record.RatingsCount = ratingsCount; + record.CreatedAt = createdAt ?? DateTime.UtcNow; + record.UpdatedAt = updatedAt; + return atp.ATProtocol.CreateRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a HiveBook record. + /// + /// + /// + /// + /// + /// + public static Task> DeleteHiveBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.DeleteRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a HiveBook record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutHiveBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, string rkey, FishyFlip.Lexicon.Buzz.Bookhive.HiveBook record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.PutRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List HiveBook records. + /// + /// + /// + /// + /// + /// + public static Task> ListHiveBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.ListRecordsAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", limit, cursor, reverse, cancellationToken); + } + + /// + /// List HiveBook records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListHiveBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.ListRecordsAsync(repo, "buzz.bookhive.hiveBook", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get HiveBook records. + /// + /// + /// + /// + /// + public static Task> GetHiveBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.GetRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "buzz.bookhive.hiveBook", rkey, cid, cancellationToken); + } + + /// + /// Get HiveBook records. + /// + /// + /// + /// + /// + /// + public static Task> GetHiveBookAsync(this FishyFlip.Lexicon.Buzz.Bookhive.BuzzBookhive atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.ATProtocol.GetRecordAsync(repo, "buzz.bookhive.hiveBook", rkey, cid, cancellationToken); + } + } +} + diff --git a/src/FishyFlip/Lexicon/Buzz/Bookhive/BuzzBookhive.g.cs b/src/FishyFlip/Lexicon/Buzz/Bookhive/BuzzBookhive.g.cs new file mode 100644 index 00000000..3dc2331a --- /dev/null +++ b/src/FishyFlip/Lexicon/Buzz/Bookhive/BuzzBookhive.g.cs @@ -0,0 +1,48 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Buzz.Bookhive +{ + + /// + /// buzz.bookhive Endpoint Class. + /// + public sealed class BuzzBookhive + { + + private ATProtocol atp; + + /// + /// Initializes a new instance of the class. + /// + /// . + internal BuzzBookhive(ATProtocol atp) + { + this.atp = atp; + } + + /// + /// Gets the ATProtocol. + /// + internal ATProtocol ATProtocol => this.atp; + + + /// + /// Find books matching the search criteria. Requires authentication. + /// + /// + /// + /// + /// + /// + public Task> SearchBooksAsync (string q, int? limit = 25, int? offset = 0, string? id = default, CancellationToken cancellationToken = default) + { + return atp.SearchBooksAsync(q, limit, offset, id, cancellationToken); + } + + } +} + diff --git a/src/FishyFlip/Lexicon/Buzz/Bookhive/HiveBook.g.cs b/src/FishyFlip/Lexicon/Buzz/Bookhive/HiveBook.g.cs new file mode 100644 index 00000000..3d3c1ee3 --- /dev/null +++ b/src/FishyFlip/Lexicon/Buzz/Bookhive/HiveBook.g.cs @@ -0,0 +1,185 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Buzz.Bookhive +{ + /// + /// A book within the hive + /// + public partial class HiveBook : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// The title of the book + /// The authors of the book (tab separated) + /// The book's hive id, used to correlate user's books with the hive + /// URL to thumbnail image + /// + /// The source service name (e.g. Goodreads) + /// URL to the book on the source service + /// ID of the book in the source service + /// URL to full-size cover image + /// Book description/summary + /// Average rating (0-1000) + /// Number of ratings + /// + public HiveBook(string? title, string? authors, string? id, string? thumbnail, DateTime? updatedAt, string? source = default, string? sourceUrl = default, string? sourceId = default, string? cover = default, string? description = default, long? rating = default, long? ratingsCount = default, DateTime? createdAt = default) + { + this.Title = title; + this.Authors = authors; + this.Id = id; + this.Source = source; + this.SourceUrl = sourceUrl; + this.SourceId = sourceId; + this.Cover = cover; + this.Thumbnail = thumbnail; + this.Description = description; + this.Rating = rating; + this.RatingsCount = ratingsCount; + this.CreatedAt = createdAt ?? DateTime.UtcNow; + this.UpdatedAt = updatedAt; + } + + + /// + /// Initializes a new instance of the class. + /// + public HiveBook() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public HiveBook(CBORObject obj) + { + if (obj["title"] is not null) this.Title = obj["title"].AsString(); + if (obj["authors"] is not null) this.Authors = obj["authors"].AsString(); + if (obj["id"] is not null) this.Id = obj["id"].AsString(); + if (obj["source"] is not null) this.Source = obj["source"].AsString(); + if (obj["sourceUrl"] is not null) this.SourceUrl = obj["sourceUrl"].AsString(); + if (obj["sourceId"] is not null) this.SourceId = obj["sourceId"].AsString(); + if (obj["cover"] is not null) this.Cover = obj["cover"].AsString(); + if (obj["thumbnail"] is not null) this.Thumbnail = obj["thumbnail"].AsString(); + if (obj["description"] is not null) this.Description = obj["description"].AsString(); + if (obj["rating"] is not null) this.Rating = obj["rating"].AsInt64Value(); + if (obj["ratingsCount"] is not null) this.RatingsCount = obj["ratingsCount"].AsInt64Value(); + if (obj["createdAt"] is not null) this.CreatedAt = obj["createdAt"].ToDateTime(); + if (obj["updatedAt"] is not null) this.UpdatedAt = obj["updatedAt"].ToDateTime(); + } + + /// + /// Gets or sets the title. + ///
The title of the book + ///
+ [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Gets or sets the authors. + ///
The authors of the book (tab separated) + ///
+ [JsonPropertyName("authors")] + public string? Authors { get; set; } + + /// + /// Gets or sets the id. + ///
The book's hive id, used to correlate user's books with the hive + ///
+ [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Gets or sets the source. + ///
The source service name (e.g. Goodreads) + ///
+ [JsonPropertyName("source")] + public string? Source { get; set; } + + /// + /// Gets or sets the sourceUrl. + ///
URL to the book on the source service + ///
+ [JsonPropertyName("sourceUrl")] + public string? SourceUrl { get; set; } + + /// + /// Gets or sets the sourceId. + ///
ID of the book in the source service + ///
+ [JsonPropertyName("sourceId")] + public string? SourceId { get; set; } + + /// + /// Gets or sets the cover. + ///
URL to full-size cover image + ///
+ [JsonPropertyName("cover")] + public string? Cover { get; set; } + + /// + /// Gets or sets the thumbnail. + ///
URL to thumbnail image + ///
+ [JsonPropertyName("thumbnail")] + public string? Thumbnail { get; set; } + + /// + /// Gets or sets the description. + ///
Book description/summary + ///
+ [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Gets or sets the rating. + ///
Average rating (0-1000) + ///
+ [JsonPropertyName("rating")] + public long? Rating { get; set; } + + /// + /// Gets or sets the ratingsCount. + ///
Number of ratings + ///
+ [JsonPropertyName("ratingsCount")] + public long? RatingsCount { get; set; } + + /// + /// Gets or sets the createdAt. + /// + [JsonPropertyName("createdAt")] + public DateTime? CreatedAt { get; set; } = DateTime.UtcNow; + + /// + /// Gets or sets the updatedAt. + /// + [JsonPropertyName("updatedAt")] + public DateTime? UpdatedAt { get; set; } + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "buzz.bookhive.hiveBook"; + + public const string RecordType = "buzz.bookhive.hiveBook"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.BuzzBookhiveHiveBook)!; + } + + public static HiveBook FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.BuzzBookhiveHiveBook)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/Buzz/Bookhive/SearchBooksOutput.g.cs b/src/FishyFlip/Lexicon/Buzz/Bookhive/SearchBooksOutput.g.cs new file mode 100644 index 00000000..f7cb8a50 --- /dev/null +++ b/src/FishyFlip/Lexicon/Buzz/Bookhive/SearchBooksOutput.g.cs @@ -0,0 +1,74 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Buzz.Bookhive +{ + public partial class SearchBooksOutput : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// The next offset to use for pagination (result of limit + offset) + /// + public SearchBooksOutput(long? offset = default, List? books = default) + { + this.Offset = offset; + this.Books = books; + } + + + /// + /// Initializes a new instance of the class. + /// + public SearchBooksOutput() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public SearchBooksOutput(CBORObject obj) + { + if (obj["offset"] is not null) this.Offset = obj["offset"].AsInt64Value(); + if (obj["books"] is not null) this.Books = obj["books"].Values.Select(n =>new Buzz.Bookhive.HiveBook(n)).ToList(); + } + + /// + /// Gets or sets the offset. + ///
The next offset to use for pagination (result of limit + offset) + ///
+ [JsonPropertyName("offset")] + public long? Offset { get; set; } + + /// + /// Gets or sets the books. + /// + [JsonPropertyName("books")] + [JsonRequired] + public List? Books { get; set; } + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "buzz.bookhive.searchBooks#SearchBooksOutput"; + + public const string RecordType = "buzz.bookhive.searchBooks#SearchBooksOutput"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.BuzzBookhiveSearchBooksOutput)!; + } + + public static SearchBooksOutput FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.BuzzBookhiveSearchBooksOutput)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/CborExtensions.g.cs b/src/FishyFlip/Lexicon/CborExtensions.g.cs index 782863c9..ead4edc6 100644 --- a/src/FishyFlip/Lexicon/CborExtensions.g.cs +++ b/src/FishyFlip/Lexicon/CborExtensions.g.cs @@ -75,6 +75,8 @@ public static ATObject ToATObject(this CBORObject obj) return new Com.Whtwnd.Blog.BlogEntry(obj); case "blue.linkat.board": return new Blue.Linkat.Board(obj); + case "buzz.bookhive.book": + return new Buzz.Bookhive.Book(obj); case "community.lexicon.bookmarks.bookmark": return new Community.Lexicon.Bookmarks.Bookmark(obj); case "blue.zio.atfile.finger#browser": @@ -207,6 +209,8 @@ public static ATObject ToATObject(this CBORObject obj) return new App.Bsky.Richtext.Facet(obj); case "social.psky.richtext.facet": return new Social.Psky.Richtext.Facet(obj); + case "fm.teal.alpha.actor.profile#featuredItem": + return new Fm.Teal.Alpha.Actor.FeaturedItem(obj); case "app.bsky.feed.describeFeedGenerator#feed": return new App.Bsky.Feed.Feed(obj); case "app.bsky.graph.starterpack#feedItem": @@ -377,6 +381,8 @@ public static ATObject ToATObject(this CBORObject obj) return new Tools.Ozone.Set.GetValuesOutput(obj); case "app.bsky.actor.defs#hiddenPostsPref": return new App.Bsky.Actor.HiddenPostsPref(obj); + case "buzz.bookhive.hiveBook": + return new Buzz.Bookhive.HiveBook(obj); case "com.shinolabs.pinksea.appViewDefs#hydratedOekaki": return new Com.Shinolabs.Pinksea.HydratedOekaki(obj); case "com.atproto.sync.subscribeRepos#identity": @@ -589,6 +595,8 @@ public static ATObject ToATObject(this CBORObject obj) return new Tools.Ozone.Setting.Option(obj); case "app.bsky.actor.defs#personalDetailsPref": return new App.Bsky.Actor.PersonalDetailsPref(obj); + case "fm.teal.alpha.play": + return new Fm.Teal.Alpha.Play(obj); case "app.bsky.feed.post": return new App.Bsky.Feed.Post(obj); case "fyi.unravel.frontpage.post": @@ -601,6 +609,8 @@ public static ATObject ToATObject(this CBORObject obj) return new App.Bsky.Actor.Profile(obj); case "social.psky.actor.profile": return new Social.Psky.Actor.Profile(obj); + case "fm.teal.alpha.actor.profile": + return new Fm.Teal.Alpha.Actor.Profile(obj); case "app.bsky.actor.defs#profileAssociated": return new App.Bsky.Actor.ProfileAssociated(obj); case "app.bsky.actor.defs#profileAssociatedChat": @@ -725,6 +735,8 @@ public static ATObject ToATObject(this CBORObject obj) return new App.Bsky.Unspecced.SearchActorsSkeletonOutput(obj); case "app.bsky.actor.searchActorsTypeahead#SearchActorsTypeaheadOutput": return new App.Bsky.Actor.SearchActorsTypeaheadOutput(obj); + case "buzz.bookhive.searchBooks#SearchBooksOutput": + return new Buzz.Bookhive.SearchBooksOutput(obj); case "app.bsky.feed.searchPosts#SearchPostsOutput": return new App.Bsky.Feed.SearchPostsOutput(obj); case "app.bsky.unspecced.searchPostsSkeleton#SearchPostsSkeletonOutput": @@ -789,6 +801,10 @@ public static ATObject ToATObject(this CBORObject obj) return new App.Bsky.Graph.StarterPackViewBasic(obj); case "app.netlify.aniblue.status": return new App.Netlify.Aniblue.Status(obj); + case "xyz.statusphere.status": + return new Xyz.Statusphere.Status(obj); + case "fm.teal.alpha.actor.status": + return new Fm.Teal.Alpha.Actor.Status(obj); case "com.atproto.admin.defs#statusAttr": return new Com.Atproto.Admin.StatusAttr(obj); case "app.netlify.aniblue.status#status": diff --git a/src/FishyFlip/Lexicon/Com/Atproto/Moderation/ATProtoModeration.g.cs b/src/FishyFlip/Lexicon/Com/Atproto/Moderation/ATProtoModeration.g.cs index 71457c18..02458efa 100644 --- a/src/FishyFlip/Lexicon/Com/Atproto/Moderation/ATProtoModeration.g.cs +++ b/src/FishyFlip/Lexicon/Com/Atproto/Moderation/ATProtoModeration.g.cs @@ -35,13 +35,13 @@ internal ATProtoModeration(ATProtocol atp) /// /// ///
Known Values:
- /// reasonSpam
- /// reasonViolation
- /// reasonMisleading
- /// reasonSexual
- /// reasonRude
- /// reasonOther
- /// reasonAppeal
+ /// reasonSpam - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonViolation - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonMisleading - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonSexual - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonRude - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonOther - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonAppeal - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
/// /// /// diff --git a/src/FishyFlip/Lexicon/Com/Atproto/Moderation/ModerationEndpoints.g.cs b/src/FishyFlip/Lexicon/Com/Atproto/Moderation/ModerationEndpoints.g.cs index ef4fea51..6780d031 100644 --- a/src/FishyFlip/Lexicon/Com/Atproto/Moderation/ModerationEndpoints.g.cs +++ b/src/FishyFlip/Lexicon/Com/Atproto/Moderation/ModerationEndpoints.g.cs @@ -22,13 +22,13 @@ public static class ModerationEndpoints /// /// ///
Known Values:
- /// reasonSpam
- /// reasonViolation
- /// reasonMisleading
- /// reasonSexual
- /// reasonRude
- /// reasonOther
- /// reasonAppeal
+ /// reasonSpam - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonViolation - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonMisleading - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonSexual - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonRude - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonOther - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
+ /// reasonAppeal - Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
/// /// /// diff --git a/src/FishyFlip/Lexicon/Fm/Teal/Alpha/ATProtoAlphaExtensions.g.cs b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/ATProtoAlphaExtensions.g.cs new file mode 100644 index 00000000..e588d0ee --- /dev/null +++ b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/ATProtoAlphaExtensions.g.cs @@ -0,0 +1,144 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +using FishyFlip.Lexicon.Com.Atproto.Repo; + +namespace FishyFlip.Lexicon.Fm.Teal.Alpha +{ + + /// + /// Extension methods for fm.teal.alpha. + /// + public static class ATProtoAlphaExtensions + { + + /// + /// Create a Play record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreatePlayAsync(this FishyFlip.ATProtocol atp, Fm.Teal.Alpha.Play record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.play", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a Play record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> CreatePlayAsync(this FishyFlip.ATProtocol atp, string? trackName, string? artistName, string? trackMbId = default, string? recordingMbId = default, long? duration = default, List? artistMbIds = default, string? releaseName = default, string? releaseMbId = default, string? isrc = default, string? originUrl = default, string? musicServiceBaseDomain = default, string? submissionClientAgent = default, DateTime? playedTime = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Fm.Teal.Alpha.Play(); + record.TrackName = trackName; + record.TrackMbId = trackMbId; + record.RecordingMbId = recordingMbId; + record.Duration = duration; + record.ArtistName = artistName; + record.ArtistMbIds = artistMbIds; + record.ReleaseName = releaseName; + record.ReleaseMbId = releaseMbId; + record.Isrc = isrc; + record.OriginUrl = originUrl; + record.MusicServiceBaseDomain = musicServiceBaseDomain; + record.SubmissionClientAgent = submissionClientAgent; + record.PlayedTime = playedTime; + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.play", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a Play record. + /// + /// + /// + /// + /// + /// + /// + public static Task> DeletePlayAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.DeleteRecordAsync(repo, "fm.teal.alpha.play", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a Play record. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutPlayAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Fm.Teal.Alpha.Play record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.PutRecordAsync(repo, "fm.teal.alpha.play", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List Play records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListPlayAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(repo, "fm.teal.alpha.play", limit, cursor, reverse, cancellationToken); + } + + /// + /// List Play records. + /// + /// + /// + /// + /// + /// + public static Task> ListPlayAsync(this FishyFlip.ATProtocol atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.play", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get Play records. + /// + /// + /// + /// + /// + /// + public static Task> GetPlayAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(repo, "fm.teal.alpha.play", rkey, cid, cancellationToken); + } + + /// + /// Get Play records. + /// + /// + /// + /// + /// + public static Task> GetPlayAsync(this FishyFlip.ATProtocol atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.play", rkey, cid, cancellationToken); + } + } +} + diff --git a/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/ATProtoActorExtensions.g.cs b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/ATProtoActorExtensions.g.cs new file mode 100644 index 00000000..d75f36bf --- /dev/null +++ b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/ATProtoActorExtensions.g.cs @@ -0,0 +1,251 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +using FishyFlip.Lexicon.Com.Atproto.Repo; + +namespace FishyFlip.Lexicon.Fm.Teal.Alpha.Actor +{ + + /// + /// Extension methods for fm.teal.alpha.actor. + /// + public static class ATProtoActorExtensions + { + + /// + /// Create a Profile record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateProfileAsync(this FishyFlip.ATProtocol atp, Fm.Teal.Alpha.Actor.Profile record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.actor.profile", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a Profile record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateProfileAsync(this FishyFlip.ATProtocol atp, string? displayName = default, string? description = default, List? descriptionFacets = default, Fm.Teal.Alpha.Actor.FeaturedItem? featuredItem = default, Blob? avatar = default, Blob? banner = default, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Fm.Teal.Alpha.Actor.Profile(); + record.DisplayName = displayName; + record.Description = description; + record.DescriptionFacets = descriptionFacets; + record.FeaturedItem = featuredItem; + record.Avatar = avatar; + record.Banner = banner; + record.CreatedAt = createdAt ?? DateTime.UtcNow; + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.actor.profile", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a Profile record. + /// + /// + /// + /// + /// + /// + /// + public static Task> DeleteProfileAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.DeleteRecordAsync(repo, "fm.teal.alpha.actor.profile", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a Profile record. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutProfileAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Fm.Teal.Alpha.Actor.Profile record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.PutRecordAsync(repo, "fm.teal.alpha.actor.profile", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List Profile records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListProfileAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(repo, "fm.teal.alpha.actor.profile", limit, cursor, reverse, cancellationToken); + } + + /// + /// List Profile records. + /// + /// + /// + /// + /// + /// + public static Task> ListProfileAsync(this FishyFlip.ATProtocol atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.actor.profile", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get Profile records. + /// + /// + /// + /// + /// + /// + public static Task> GetProfileAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(repo, "fm.teal.alpha.actor.profile", rkey, cid, cancellationToken); + } + + /// + /// Get Profile records. + /// + /// + /// + /// + /// + public static Task> GetProfileAsync(this FishyFlip.ATProtocol atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.actor.profile", rkey, cid, cancellationToken); + } + /// + /// Create a Status record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateStatusAsync(this FishyFlip.ATProtocol atp, Fm.Teal.Alpha.Actor.Status record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.actor.status", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a Status record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateStatusAsync(this FishyFlip.ATProtocol atp, DateTime? time, Fm.Teal.Alpha.Play? item, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Fm.Teal.Alpha.Actor.Status(); + record.Time = time; + record.Item = item; + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.actor.status", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a Status record. + /// + /// + /// + /// + /// + /// + /// + public static Task> DeleteStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.DeleteRecordAsync(repo, "fm.teal.alpha.actor.status", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a Status record. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Fm.Teal.Alpha.Actor.Status record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.PutRecordAsync(repo, "fm.teal.alpha.actor.status", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List Status records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(repo, "fm.teal.alpha.actor.status", limit, cursor, reverse, cancellationToken); + } + + /// + /// List Status records. + /// + /// + /// + /// + /// + /// + public static Task> ListStatusAsync(this FishyFlip.ATProtocol atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.actor.status", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get Status records. + /// + /// + /// + /// + /// + /// + public static Task> GetStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(repo, "fm.teal.alpha.actor.status", rkey, cid, cancellationToken); + } + + /// + /// Get Status records. + /// + /// + /// + /// + /// + public static Task> GetStatusAsync(this FishyFlip.ATProtocol atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "fm.teal.alpha.actor.status", rkey, cid, cancellationToken); + } + } +} + diff --git a/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/FeaturedItem.g.cs b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/FeaturedItem.g.cs new file mode 100644 index 00000000..c778551d --- /dev/null +++ b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/FeaturedItem.g.cs @@ -0,0 +1,76 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Fm.Teal.Alpha.Actor +{ + public partial class FeaturedItem : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// The Musicbrainz ID of the item + /// The type of the item. Must be a valid Musicbrainz type, e.g. album, track, recording, etc. + public FeaturedItem(string? mbid = default, string? type = default) + { + this.Mbid = mbid; + this.TypeValue = type; + } + + + /// + /// Initializes a new instance of the class. + /// + public FeaturedItem() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public FeaturedItem(CBORObject obj) + { + if (obj["mbid"] is not null) this.Mbid = obj["mbid"].AsString(); + if (obj["type"] is not null) this.TypeValue = obj["type"].AsString(); + } + + /// + /// Gets or sets the mbid. + ///
The Musicbrainz ID of the item + ///
+ [JsonPropertyName("mbid")] + [JsonRequired] + public string? Mbid { get; set; } + + /// + /// Gets or sets the type. + ///
The type of the item. Must be a valid Musicbrainz type, e.g. album, track, recording, etc. + ///
+ [JsonPropertyName("type")] + [JsonRequired] + public string? TypeValue { get; set; } + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "fm.teal.alpha.actor.profile#featuredItem"; + + public const string RecordType = "fm.teal.alpha.actor.profile#featuredItem"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.FmTealAlphaActorFeaturedItem)!; + } + + public static FeaturedItem FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.FmTealAlphaActorFeaturedItem)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/Profile.g.cs b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/Profile.g.cs new file mode 100644 index 00000000..6ff57599 --- /dev/null +++ b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/Profile.g.cs @@ -0,0 +1,128 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Fm.Teal.Alpha.Actor +{ + /// + /// This lexicon is in a not officially released state. It is subject to change. | A declaration of a teal.fm account profile. + /// + public partial class Profile : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// + /// Free-form profile description text. + /// Annotations of text in the profile description (mentions, URLs, hashtags, etc). + /// The user's most recent item featured on their profile. + /// fm.teal.alpha.actor.defs#featuredItem
+ /// + /// Small image to be displayed next to posts from account. AKA, 'profile picture' + /// Larger horizontal image to display behind profile view. + /// + public Profile(string? displayName = default, string? description = default, List? descriptionFacets = default, Fm.Teal.Alpha.Actor.FeaturedItem? featuredItem = default, Blob? avatar = default, Blob? banner = default, DateTime? createdAt = default) + { + this.DisplayName = displayName; + this.Description = description; + this.DescriptionFacets = descriptionFacets; + this.FeaturedItem = featuredItem; + this.Avatar = avatar; + this.Banner = banner; + this.CreatedAt = createdAt ?? DateTime.UtcNow; + } + + + /// + /// Initializes a new instance of the class. + /// + public Profile() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public Profile(CBORObject obj) + { + if (obj["displayName"] is not null) this.DisplayName = obj["displayName"].AsString(); + if (obj["description"] is not null) this.Description = obj["description"].AsString(); + if (obj["descriptionFacets"] is not null) this.DescriptionFacets = obj["descriptionFacets"].Values.Select(n =>new App.Bsky.Richtext.Facet(n)).ToList(); + if (obj["featuredItem"] is not null) this.FeaturedItem = new Fm.Teal.Alpha.Actor.FeaturedItem(obj["featuredItem"]); + if (obj["avatar"] is not null) this.Avatar = new FishyFlip.Models.Blob(obj["avatar"]); + if (obj["banner"] is not null) this.Banner = new FishyFlip.Models.Blob(obj["banner"]); + if (obj["createdAt"] is not null) this.CreatedAt = obj["createdAt"].ToDateTime(); + } + + /// + /// Gets or sets the displayName. + /// + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// + /// Gets or sets the description. + ///
Free-form profile description text. + ///
+ [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Gets or sets the descriptionFacets. + ///
Annotations of text in the profile description (mentions, URLs, hashtags, etc). + ///
+ [JsonPropertyName("descriptionFacets")] + public List? DescriptionFacets { get; set; } + + /// + /// Gets or sets the featuredItem. + ///
The user's most recent item featured on their profile. + /// fm.teal.alpha.actor.defs#featuredItem
+ ///
+ [JsonPropertyName("featuredItem")] + public Fm.Teal.Alpha.Actor.FeaturedItem? FeaturedItem { get; set; } + + /// + /// Gets or sets the avatar. + ///
Small image to be displayed next to posts from account. AKA, 'profile picture' + ///
+ [JsonPropertyName("avatar")] + public Blob? Avatar { get; set; } + + /// + /// Gets or sets the banner. + ///
Larger horizontal image to display behind profile view. + ///
+ [JsonPropertyName("banner")] + public Blob? Banner { get; set; } + + /// + /// Gets or sets the createdAt. + /// + [JsonPropertyName("createdAt")] + public DateTime? CreatedAt { get; set; } = DateTime.UtcNow; + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "fm.teal.alpha.actor.profile"; + + public const string RecordType = "fm.teal.alpha.actor.profile"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.FmTealAlphaActorProfile)!; + } + + public static Profile FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.FmTealAlphaActorProfile)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/Status.g.cs b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/Status.g.cs new file mode 100644 index 00000000..56d76624 --- /dev/null +++ b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Actor/Status.g.cs @@ -0,0 +1,81 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Fm.Teal.Alpha.Actor +{ + /// + /// This lexicon is in a not officially released state. It is subject to change. | A declaration of the status of the actor. Only one can be shown at a time. If there are multiple, the latest record should be picked and earlier records should be deleted or tombstoned. + /// + public partial class Status : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// The unix timestamp of when the item was recorded + /// + ///
Union Types:
+ /// (fm.teal.alpha.play#record)
+ /// + public Status(DateTime? time, Fm.Teal.Alpha.Play? item) + { + this.Time = time; + this.Item = item; + } + + + /// + /// Initializes a new instance of the class. + /// + public Status() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public Status(CBORObject obj) + { + if (obj["time"] is not null) this.Time = obj["time"].ToDateTime(); + if (obj["item"] is not null) this.Item = new Fm.Teal.Alpha.Play(obj["item"]); + } + + /// + /// Gets or sets the time. + ///
The unix timestamp of when the item was recorded + ///
+ [JsonPropertyName("time")] + public DateTime? Time { get; set; } + + /// + /// Gets or sets the item. + ///
Union Types:
+ /// (fm.teal.alpha.play#record)
+ ///
+ [JsonPropertyName("item")] + public Fm.Teal.Alpha.Play? Item { get; set; } + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "fm.teal.alpha.actor.status"; + + public const string RecordType = "fm.teal.alpha.actor.status"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.FmTealAlphaActorStatus)!; + } + + public static Status FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.FmTealAlphaActorStatus)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Play.g.cs b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Play.g.cs new file mode 100644 index 00000000..39145cb7 --- /dev/null +++ b/src/FishyFlip/Lexicon/Fm/Teal/Alpha/Play.g.cs @@ -0,0 +1,184 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Fm.Teal.Alpha +{ + public partial class Play : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// The name of the track + /// The name of the artist + /// The Musicbrainz ID of the track + /// The Musicbrainz recording ID of the track + /// The length of the track in seconds + /// Array of Musicbrainz artist IDs + /// The name of the release/album + /// The Musicbrainz release ID + /// The ISRC code associated with the recording + /// The URL associated with this track + /// The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if not provided. + /// A user-agent style string specifying the user agent. e.g. tealtracker/0.0.1b (Linux; Android 13; SM-A715F). Defaults to 'manual/unknown' if not provided. + /// The unix timestamp of when the track was played + public Play(string? trackName, string? artistName, string? trackMbId = default, string? recordingMbId = default, long? duration = default, List? artistMbIds = default, string? releaseName = default, string? releaseMbId = default, string? isrc = default, string? originUrl = default, string? musicServiceBaseDomain = default, string? submissionClientAgent = default, DateTime? playedTime = default) + { + this.TrackName = trackName; + this.TrackMbId = trackMbId; + this.RecordingMbId = recordingMbId; + this.Duration = duration; + this.ArtistName = artistName; + this.ArtistMbIds = artistMbIds; + this.ReleaseName = releaseName; + this.ReleaseMbId = releaseMbId; + this.Isrc = isrc; + this.OriginUrl = originUrl; + this.MusicServiceBaseDomain = musicServiceBaseDomain; + this.SubmissionClientAgent = submissionClientAgent; + this.PlayedTime = playedTime; + } + + + /// + /// Initializes a new instance of the class. + /// + public Play() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public Play(CBORObject obj) + { + if (obj["trackName"] is not null) this.TrackName = obj["trackName"].AsString(); + if (obj["trackMbId"] is not null) this.TrackMbId = obj["trackMbId"].AsString(); + if (obj["recordingMbId"] is not null) this.RecordingMbId = obj["recordingMbId"].AsString(); + if (obj["duration"] is not null) this.Duration = obj["duration"].AsInt64Value(); + if (obj["artistName"] is not null) this.ArtistName = obj["artistName"].AsString(); + if (obj["artistMbIds"] is not null) this.ArtistMbIds = obj["artistMbIds"].Values.Select(n =>n.AsString()).ToList(); + if (obj["releaseName"] is not null) this.ReleaseName = obj["releaseName"].AsString(); + if (obj["releaseMbId"] is not null) this.ReleaseMbId = obj["releaseMbId"].AsString(); + if (obj["isrc"] is not null) this.Isrc = obj["isrc"].AsString(); + if (obj["originUrl"] is not null) this.OriginUrl = obj["originUrl"].AsString(); + if (obj["musicServiceBaseDomain"] is not null) this.MusicServiceBaseDomain = obj["musicServiceBaseDomain"].AsString(); + if (obj["submissionClientAgent"] is not null) this.SubmissionClientAgent = obj["submissionClientAgent"].AsString(); + if (obj["playedTime"] is not null) this.PlayedTime = obj["playedTime"].ToDateTime(); + } + + /// + /// Gets or sets the trackName. + ///
The name of the track + ///
+ [JsonPropertyName("trackName")] + public string? TrackName { get; set; } + + /// + /// Gets or sets the trackMbId. + ///
The Musicbrainz ID of the track + ///
+ [JsonPropertyName("trackMbId")] + public string? TrackMbId { get; set; } + + /// + /// Gets or sets the recordingMbId. + ///
The Musicbrainz recording ID of the track + ///
+ [JsonPropertyName("recordingMbId")] + public string? RecordingMbId { get; set; } + + /// + /// Gets or sets the duration. + ///
The length of the track in seconds + ///
+ [JsonPropertyName("duration")] + public long? Duration { get; set; } + + /// + /// Gets or sets the artistName. + ///
The name of the artist + ///
+ [JsonPropertyName("artistName")] + public string? ArtistName { get; set; } + + /// + /// Gets or sets the artistMbIds. + ///
Array of Musicbrainz artist IDs + ///
+ [JsonPropertyName("artistMbIds")] + public List? ArtistMbIds { get; set; } + + /// + /// Gets or sets the releaseName. + ///
The name of the release/album + ///
+ [JsonPropertyName("releaseName")] + public string? ReleaseName { get; set; } + + /// + /// Gets or sets the releaseMbId. + ///
The Musicbrainz release ID + ///
+ [JsonPropertyName("releaseMbId")] + public string? ReleaseMbId { get; set; } + + /// + /// Gets or sets the isrc. + ///
The ISRC code associated with the recording + ///
+ [JsonPropertyName("isrc")] + public string? Isrc { get; set; } + + /// + /// Gets or sets the originUrl. + ///
The URL associated with this track + ///
+ [JsonPropertyName("originUrl")] + public string? OriginUrl { get; set; } + + /// + /// Gets or sets the musicServiceBaseDomain. + ///
The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if not provided. + ///
+ [JsonPropertyName("musicServiceBaseDomain")] + public string? MusicServiceBaseDomain { get; set; } + + /// + /// Gets or sets the submissionClientAgent. + ///
A user-agent style string specifying the user agent. e.g. tealtracker/0.0.1b (Linux; Android 13; SM-A715F). Defaults to 'manual/unknown' if not provided. + ///
+ [JsonPropertyName("submissionClientAgent")] + public string? SubmissionClientAgent { get; set; } + + /// + /// Gets or sets the playedTime. + ///
The unix timestamp of when the track was played + ///
+ [JsonPropertyName("playedTime")] + public DateTime? PlayedTime { get; set; } + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "fm.teal.alpha.play"; + + public const string RecordType = "fm.teal.alpha.play"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.FmTealAlphaPlay)!; + } + + public static Play FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.FmTealAlphaPlay)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/SourceGenerationContext.g.cs b/src/FishyFlip/Lexicon/SourceGenerationContext.g.cs index a36de2f1..fed5ed43 100644 --- a/src/FishyFlip/Lexicon/SourceGenerationContext.g.cs +++ b/src/FishyFlip/Lexicon/SourceGenerationContext.g.cs @@ -71,6 +71,8 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListComWhtwndBlogBlogEntry")] [JsonSerializable(typeof(FishyFlip.Lexicon.Blue.Linkat.Board), TypeInfoPropertyName = "BlueLinkatBoard")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListBlueLinkatBoard")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Buzz.Bookhive.Book), TypeInfoPropertyName = "BuzzBookhiveBook")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListBuzzBookhiveBook")] [JsonSerializable(typeof(FishyFlip.Lexicon.Community.Lexicon.Bookmarks.Bookmark), TypeInfoPropertyName = "CommunityLexiconBookmarksBookmark")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListCommunityLexiconBookmarksBookmark")] [JsonSerializable(typeof(FishyFlip.Lexicon.Blue.Zio.Atfile.Browser), TypeInfoPropertyName = "BlueZioAtfileBrowser")] @@ -203,6 +205,8 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyRichtextFacet")] [JsonSerializable(typeof(FishyFlip.Lexicon.Social.Psky.Richtext.Facet), TypeInfoPropertyName = "SocialPskyRichtextFacet")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListSocialPskyRichtextFacet")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Fm.Teal.Alpha.Actor.FeaturedItem), TypeInfoPropertyName = "FmTealAlphaActorFeaturedItem")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListFmTealAlphaActorFeaturedItem")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Feed.Feed), TypeInfoPropertyName = "AppBskyFeedFeed")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyFeedFeed")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Graph.FeedItem), TypeInfoPropertyName = "AppBskyGraphFeedItem")] @@ -373,6 +377,8 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListToolsOzoneSetGetValuesOutput")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Actor.HiddenPostsPref), TypeInfoPropertyName = "AppBskyActorHiddenPostsPref")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyActorHiddenPostsPref")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Buzz.Bookhive.HiveBook), TypeInfoPropertyName = "BuzzBookhiveHiveBook")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListBuzzBookhiveHiveBook")] [JsonSerializable(typeof(FishyFlip.Lexicon.Com.Shinolabs.Pinksea.HydratedOekaki), TypeInfoPropertyName = "ComShinolabsPinkseaHydratedOekaki")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListComShinolabsPinkseaHydratedOekaki")] [JsonSerializable(typeof(FishyFlip.Lexicon.Com.Atproto.Sync.Identity), TypeInfoPropertyName = "ComAtprotoSyncIdentity")] @@ -585,6 +591,8 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListToolsOzoneSettingOption")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Actor.PersonalDetailsPref), TypeInfoPropertyName = "AppBskyActorPersonalDetailsPref")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyActorPersonalDetailsPref")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Fm.Teal.Alpha.Play), TypeInfoPropertyName = "FmTealAlphaPlay")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListFmTealAlphaPlay")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Feed.Post), TypeInfoPropertyName = "AppBskyFeedPost")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyFeedPost")] [JsonSerializable(typeof(FishyFlip.Lexicon.Fyi.Unravel.Frontpage.Post), TypeInfoPropertyName = "FyiUnravelFrontpagePost")] @@ -597,6 +605,8 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyActorProfile")] [JsonSerializable(typeof(FishyFlip.Lexicon.Social.Psky.Actor.Profile), TypeInfoPropertyName = "SocialPskyActorProfile")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListSocialPskyActorProfile")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Fm.Teal.Alpha.Actor.Profile), TypeInfoPropertyName = "FmTealAlphaActorProfile")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListFmTealAlphaActorProfile")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Actor.ProfileAssociated), TypeInfoPropertyName = "AppBskyActorProfileAssociated")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyActorProfileAssociated")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Actor.ProfileAssociatedChat), TypeInfoPropertyName = "AppBskyActorProfileAssociatedChat")] @@ -721,6 +731,8 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyUnspeccedSearchActorsSkeletonOutput")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Actor.SearchActorsTypeaheadOutput), TypeInfoPropertyName = "AppBskyActorSearchActorsTypeaheadOutput")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyActorSearchActorsTypeaheadOutput")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Buzz.Bookhive.SearchBooksOutput), TypeInfoPropertyName = "BuzzBookhiveSearchBooksOutput")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListBuzzBookhiveSearchBooksOutput")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Feed.SearchPostsOutput), TypeInfoPropertyName = "AppBskyFeedSearchPostsOutput")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyFeedSearchPostsOutput")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Unspecced.SearchPostsSkeletonOutput), TypeInfoPropertyName = "AppBskyUnspeccedSearchPostsSkeletonOutput")] @@ -785,6 +797,10 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyGraphStarterPackViewBasic")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Netlify.Aniblue.Status), TypeInfoPropertyName = "AppNetlifyAniblueStatus")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppNetlifyAniblueStatus")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Xyz.Statusphere.Status), TypeInfoPropertyName = "XyzStatusphereStatus")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListXyzStatusphereStatus")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Fm.Teal.Alpha.Actor.Status), TypeInfoPropertyName = "FmTealAlphaActorStatus")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListFmTealAlphaActorStatus")] [JsonSerializable(typeof(FishyFlip.Lexicon.Com.Atproto.Admin.StatusAttr), TypeInfoPropertyName = "ComAtprotoAdminStatusAttr")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListComAtprotoAdminStatusAttr")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Netlify.Aniblue.StatusDef), TypeInfoPropertyName = "AppNetlifyAniblueStatusDef")] diff --git a/src/FishyFlip/Lexicon/Xyz/Statusphere/ATProtoStatusphereExtensions.g.cs b/src/FishyFlip/Lexicon/Xyz/Statusphere/ATProtoStatusphereExtensions.g.cs new file mode 100644 index 00000000..e0884123 --- /dev/null +++ b/src/FishyFlip/Lexicon/Xyz/Statusphere/ATProtoStatusphereExtensions.g.cs @@ -0,0 +1,133 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +using FishyFlip.Lexicon.Com.Atproto.Repo; + +namespace FishyFlip.Lexicon.Xyz.Statusphere +{ + + /// + /// Extension methods for xyz.statusphere. + /// + public static class ATProtoStatusphereExtensions + { + + /// + /// Create a Status record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateStatusAsync(this FishyFlip.ATProtocol atp, Xyz.Statusphere.Status record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "xyz.statusphere.status", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a Status record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateStatusAsync(this FishyFlip.ATProtocol atp, string? status, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Xyz.Statusphere.Status(); + record.StatusValue = status; + record.CreatedAt = createdAt ?? DateTime.UtcNow; + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "xyz.statusphere.status", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a Status record. + /// + /// + /// + /// + /// + /// + /// + public static Task> DeleteStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.DeleteRecordAsync(repo, "xyz.statusphere.status", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a Status record. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Xyz.Statusphere.Status record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.PutRecordAsync(repo, "xyz.statusphere.status", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List Status records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(repo, "xyz.statusphere.status", limit, cursor, reverse, cancellationToken); + } + + /// + /// List Status records. + /// + /// + /// + /// + /// + /// + public static Task> ListStatusAsync(this FishyFlip.ATProtocol atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "xyz.statusphere.status", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get Status records. + /// + /// + /// + /// + /// + /// + public static Task> GetStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(repo, "xyz.statusphere.status", rkey, cid, cancellationToken); + } + + /// + /// Get Status records. + /// + /// + /// + /// + /// + public static Task> GetStatusAsync(this FishyFlip.ATProtocol atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "xyz.statusphere.status", rkey, cid, cancellationToken); + } + } +} + diff --git a/src/FishyFlip/Lexicon/Xyz/Statusphere/Status.g.cs b/src/FishyFlip/Lexicon/Xyz/Statusphere/Status.g.cs new file mode 100644 index 00000000..b41a07ba --- /dev/null +++ b/src/FishyFlip/Lexicon/Xyz/Statusphere/Status.g.cs @@ -0,0 +1,72 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Xyz.Statusphere +{ + public partial class Status : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// + /// + public Status(string? status, DateTime? createdAt = default) + { + this.StatusValue = status; + this.CreatedAt = createdAt ?? DateTime.UtcNow; + } + + + /// + /// Initializes a new instance of the class. + /// + public Status() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public Status(CBORObject obj) + { + if (obj["status"] is not null) this.StatusValue = obj["status"].AsString(); + if (obj["createdAt"] is not null) this.CreatedAt = obj["createdAt"].ToDateTime(); + } + + /// + /// Gets or sets the status. + /// + [JsonPropertyName("status")] + public string? StatusValue { get; set; } + + /// + /// Gets or sets the createdAt. + /// + [JsonPropertyName("createdAt")] + public DateTime? CreatedAt { get; set; } = DateTime.UtcNow; + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "xyz.statusphere.status"; + + public const string RecordType = "xyz.statusphere.status"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.XyzStatusphereStatus)!; + } + + public static Status FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.XyzStatusphereStatus)!; + } + } +} + diff --git a/tools/FFSourceGen/Program.cs b/tools/FFSourceGen/Program.cs index aa2fb660..a4a859ef 100644 --- a/tools/FFSourceGen/Program.cs +++ b/tools/FFSourceGen/Program.cs @@ -1546,7 +1546,14 @@ public static bool DoesRefStringHaveNoNamespace(string refString) public static ClassGeneration? FindClassFromRef(string refString) { - return AllClasses.FirstOrDefault(n => n.Id == refString); + var record = AllClasses.FirstOrDefault(n => n.Id == refString); + if (record is null) + { + refString = refString.Contains("#") ? refString.Split("#")[0] : refString; + record = AllClasses.FirstOrDefault(n => n.Id == refString); + } + + return record; } private async Task ProcessFile(string defJsonPath)