Skip to content

Commit

Permalink
Add AniBlue support
Browse files Browse the repository at this point in the history
  • Loading branch information
drasticactions committed Dec 19, 2024
1 parent 5ec6fb0 commit cd18d25
Show file tree
Hide file tree
Showing 7 changed files with 327 additions and 0 deletions.
1 change: 1 addition & 0 deletions build_bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ REPOS=(
"https://github.com/psky-atp/client.git"
"https://github.com/Gregoor/skylights.git"
"https://github.com/echo8/pastesphere.git"
"https://github.com/marukun712/AniBlue.git"
)

PWD=$(pwd)
Expand Down
2 changes: 2 additions & 0 deletions src/FishyFlip/Lexicon/ATObject.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ namespace FishyFlip.Lexicon
[JsonDerivedType(typeof(App.Bsky.Graph.Starterpack), typeDiscriminator: "app.bsky.graph.starterpack")]
[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(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")]
[JsonDerivedType(typeof(Tools.Ozone.Moderation.SubjectStatusView), typeDiscriminator: "tools.ozone.moderation.defs#subjectStatusView")]
[JsonDerivedType(typeof(Com.Atproto.Identity.SubmitPlcOperationInput), typeDiscriminator: "com.atproto.identity.submitPlcOperation#SubmitPlcOperationInput")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
// <auto-generated />
// This file was generated by FFSourceGen.
// Do not modify this file.

#nullable enable

using FishyFlip.Lexicon.Com.Atproto.Repo;

namespace FishyFlip.Lexicon.App.Netlify.Aniblue
{

/// <summary>
/// Extension methods for app.netlify.aniblue.
/// </summary>
public static class ATProtoAniblueExtensions
{

/// <summary>
/// Create a Status record.
/// </summary>
/// <param name="atp"></param>
/// <param name="record"></param>
/// <param name="rkey"></param>
/// <param name="validate"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<CreateRecordOutput?>> CreateStatusAsync(this FishyFlip.ATProtocol atp, App.Netlify.Aniblue.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."), "app.netlify.aniblue.status", record, rkey, validate, swapCommit, cancellationToken);
}

/// <summary>
/// Create a Status record.
/// </summary>
/// <param name="repo"></param>
/// <param name="collection"></param>
/// <param name="record"></param>
/// <param name="rkey"></param>
/// <param name="validate"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<CreateRecordOutput?>> CreateStatusAsync(this FishyFlip.ATProtocol atp, List<App.Netlify.Aniblue.StatusDef>? status, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
{
var record = new FishyFlip.Lexicon.App.Netlify.Aniblue.Status();
record.StatusValue = status;
return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "app.netlify.aniblue.status", record, rkey, validate, swapCommit, cancellationToken);
}

/// <summary>
/// Delete a Status record.
/// </summary>
/// <param name="atp"></param>
/// <param name="repo"></param>
/// <param name="rkey"></param>
/// <param name="swapRecord"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<DeleteRecordOutput?>> DeleteStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default)
{
return atp.DeleteRecordAsync(repo, "app.netlify.aniblue.status", rkey, swapRecord, swapCommit, cancellationToken);
}

/// <summary>
/// Put a Status record.
/// </summary>
/// <param name="atp"></param>
/// <param name="repo"></param>
/// <param name="rkey"></param>
/// <param name="record"></param>
/// <param name="validate"></param>
/// <param name="swapRecord"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<PutRecordOutput?>> PutStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, App.Netlify.Aniblue.Status record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default)
{
return atp.PutRecordAsync(repo, "app.netlify.aniblue.status", rkey, record, validate, swapRecord, swapCommit, cancellationToken);
}

/// <summary>
/// List Status records.
/// </summary>
/// <param name="atp"></param>
/// <param name="repo"></param>
/// <param name="limit"></param>
/// <param name="cursor"></param>
/// <param name="reverse"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<ListRecordsOutput?>> 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, "app.netlify.aniblue.status", limit, cursor, reverse, cancellationToken);
}

/// <summary>
/// List Status records.
/// </summary>
/// <param name="atp"></param>
/// <param name="limit"></param>
/// <param name="cursor"></param>
/// <param name="reverse"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<ListRecordsOutput?>> 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."), "app.netlify.aniblue.status", limit, cursor, reverse, cancellationToken);
}

/// <summary>
/// Get Status records.
/// </summary>
/// <param name="atp"></param>
/// <param name="repo"></param>
/// <param name="rkey"></param>
/// <param name="cid"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<GetRecordOutput?>> GetStatusAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default)
{
return atp.GetRecordAsync(repo, "app.netlify.aniblue.status", rkey, cid, cancellationToken);
}

/// <summary>
/// Get Status records.
/// </summary>
/// <param name="atp"></param>
/// <param name="rkey"></param>
/// <param name="cid"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<GetRecordOutput?>> 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."), "app.netlify.aniblue.status", rkey, cid, cancellationToken);
}
}
}

66 changes: 66 additions & 0 deletions src/FishyFlip/Lexicon/App/Netlify/Aniblue/Status.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// <auto-generated />
// This file was generated by FFSourceGen.
// Do not modify this file.

#nullable enable

namespace FishyFlip.Lexicon.App.Netlify.Aniblue
{
/// <summary>
/// A record that stores the status of the anime.
/// </summary>
public partial class Status : ATObject
{

/// <summary>
/// Initializes a new instance of the <see cref="Status"/> class.
/// </summary>
/// <param name="status"></param>
public Status(List<App.Netlify.Aniblue.StatusDef>? status)
{
this.StatusValue = status;
}


/// <summary>
/// Initializes a new instance of the <see cref="Status"/> class.
/// </summary>
public Status()
{
}


/// <summary>
/// Initializes a new instance of the <see cref="Status"/> class.
/// </summary>
public Status(CBORObject obj)
{
if (obj["status"] is not null) this.StatusValue = obj["status"].Values.Select(n =>new App.Netlify.Aniblue.StatusDef(n)).ToList();
}

/// <summary>
/// Gets or sets the status.
/// </summary>
[JsonPropertyName("status")]
public List<App.Netlify.Aniblue.StatusDef>? StatusValue { get; set; }

/// <summary>
/// Gets the ATRecord Type.
/// </summary>
[JsonPropertyName("$type")]
public override string Type => "app.netlify.aniblue.status";

public const string RecordType = "app.netlify.aniblue.status";

public override string ToJson()
{
return JsonSerializer.Serialize<App.Netlify.Aniblue.Status>(this, (JsonTypeInfo<App.Netlify.Aniblue.Status>)SourceGenerationContext.Default.AppNetlifyAniblueStatus)!;
}

public static Status FromJson(string json)
{
return JsonSerializer.Deserialize<App.Netlify.Aniblue.Status>(json, (JsonTypeInfo<App.Netlify.Aniblue.Status>)SourceGenerationContext.Default.AppNetlifyAniblueStatus)!;
}
}
}

118 changes: 118 additions & 0 deletions src/FishyFlip/Lexicon/App/Netlify/Aniblue/StatusDef.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// <auto-generated />
// This file was generated by FFSourceGen.
// Do not modify this file.

#nullable enable

namespace FishyFlip.Lexicon.App.Netlify.Aniblue
{
public partial class StatusDef : ATObject
{

/// <summary>
/// Initializes a new instance of the <see cref="StatusDef"/> class.
/// </summary>
/// <param name="id">Annict API ID for the anime</param>
/// <param name="title">Title of the anime</param>
/// <param name="thumbnail">URL of the anime thumbnail image</param>
/// <param name="status">Current watching status of the anime</param>
/// <param name="episode_text">Current number text of episode</param>
/// <param name="favorite">Favorite flag of the anime</param>
public StatusDef(long? id = default, string? title = default, string? thumbnail = default, string? status = default, string? episode_text = default, bool? favorite = default)
{
this.Id = id;
this.Title = title;
this.Thumbnail = thumbnail;
this.Status = status;
this.EpisodeText = episode_text;
this.Favorite = favorite;
}


/// <summary>
/// Initializes a new instance of the <see cref="StatusDef"/> class.
/// </summary>
public StatusDef()
{
}


/// <summary>
/// Initializes a new instance of the <see cref="StatusDef"/> class.
/// </summary>
public StatusDef(CBORObject obj)
{
if (obj["id"] is not null) this.Id = obj["id"].AsInt64Value();
if (obj["title"] is not null) this.Title = obj["title"].AsString();
if (obj["thumbnail"] is not null) this.Thumbnail = obj["thumbnail"].AsString();
if (obj["status"] is not null) this.Status = obj["status"].AsString();
if (obj["episode_text"] is not null) this.EpisodeText = obj["episode_text"].AsString();
if (obj["favorite"] is not null) this.Favorite = obj["favorite"].AsBoolean();
}

/// <summary>
/// Gets or sets the id.
/// <br/> Annict API ID for the anime
/// </summary>
[JsonPropertyName("id")]
[JsonRequired]
public long? Id { get; set; }

/// <summary>
/// Gets or sets the title.
/// <br/> Title of the anime
/// </summary>
[JsonPropertyName("title")]
[JsonRequired]
public string? Title { get; set; }

/// <summary>
/// Gets or sets the thumbnail.
/// <br/> URL of the anime thumbnail image
/// </summary>
[JsonPropertyName("thumbnail")]
public string? Thumbnail { get; set; }

/// <summary>
/// Gets or sets the status.
/// <br/> Current watching status of the anime
/// </summary>
[JsonPropertyName("status")]
[JsonRequired]
public string? Status { get; set; }

/// <summary>
/// Gets or sets the episode_text.
/// <br/> Current number text of episode
/// </summary>
[JsonPropertyName("episode_text")]
[JsonRequired]
public string? EpisodeText { get; set; }

/// <summary>
/// Gets or sets the favorite.
/// <br/> Favorite flag of the anime
/// </summary>
[JsonPropertyName("favorite")]
public bool? Favorite { get; set; }

/// <summary>
/// Gets the ATRecord Type.
/// </summary>
[JsonPropertyName("$type")]
public override string Type => "app.netlify.aniblue.status#status";

public const string RecordType = "app.netlify.aniblue.status#status";

public override string ToJson()
{
return JsonSerializer.Serialize<App.Netlify.Aniblue.StatusDef>(this, (JsonTypeInfo<App.Netlify.Aniblue.StatusDef>)SourceGenerationContext.Default.AppNetlifyAniblueStatusDef)!;
}

public static StatusDef FromJson(string json)
{
return JsonSerializer.Deserialize<App.Netlify.Aniblue.StatusDef>(json, (JsonTypeInfo<App.Netlify.Aniblue.StatusDef>)SourceGenerationContext.Default.AppNetlifyAniblueStatusDef)!;
}
}
}

4 changes: 4 additions & 0 deletions src/FishyFlip/Lexicon/CborExtensions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,12 @@ public static ATObject ToATObject(this CBORObject obj)
return new App.Bsky.Graph.StarterPackView(obj);
case "app.bsky.graph.defs#starterPackViewBasic":
return new App.Bsky.Graph.StarterPackViewBasic(obj);
case "app.netlify.aniblue.status":
return new App.Netlify.Aniblue.Status(obj);
case "com.atproto.admin.defs#statusAttr":
return new Com.Atproto.Admin.StatusAttr(obj);
case "app.netlify.aniblue.status#status":
return new App.Netlify.Aniblue.StatusDef(obj);
case "com.atproto.repo.strongRef":
return new Com.Atproto.Repo.StrongRef(obj);
case "tools.ozone.moderation.defs#subjectStatusView":
Expand Down
4 changes: 4 additions & 0 deletions src/FishyFlip/Lexicon/SourceGenerationContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,12 @@ namespace FishyFlip.Lexicon
[JsonSerializable(typeof(List<FishyFlip.Lexicon.App.Bsky.Graph.StarterPackView>), TypeInfoPropertyName = "ListAppBskyGraphStarterPackView")]
[JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Graph.StarterPackViewBasic), TypeInfoPropertyName = "AppBskyGraphStarterPackViewBasic")]
[JsonSerializable(typeof(List<FishyFlip.Lexicon.App.Bsky.Graph.StarterPackViewBasic>), TypeInfoPropertyName = "ListAppBskyGraphStarterPackViewBasic")]
[JsonSerializable(typeof(FishyFlip.Lexicon.App.Netlify.Aniblue.Status), TypeInfoPropertyName = "AppNetlifyAniblueStatus")]
[JsonSerializable(typeof(List<FishyFlip.Lexicon.App.Netlify.Aniblue.Status>), TypeInfoPropertyName = "ListAppNetlifyAniblueStatus")]
[JsonSerializable(typeof(FishyFlip.Lexicon.Com.Atproto.Admin.StatusAttr), TypeInfoPropertyName = "ComAtprotoAdminStatusAttr")]
[JsonSerializable(typeof(List<FishyFlip.Lexicon.Com.Atproto.Admin.StatusAttr>), TypeInfoPropertyName = "ListComAtprotoAdminStatusAttr")]
[JsonSerializable(typeof(FishyFlip.Lexicon.App.Netlify.Aniblue.StatusDef), TypeInfoPropertyName = "AppNetlifyAniblueStatusDef")]
[JsonSerializable(typeof(List<FishyFlip.Lexicon.App.Netlify.Aniblue.StatusDef>), TypeInfoPropertyName = "ListAppNetlifyAniblueStatusDef")]
[JsonSerializable(typeof(FishyFlip.Lexicon.Com.Atproto.Repo.StrongRef), TypeInfoPropertyName = "ComAtprotoRepoStrongRef")]
[JsonSerializable(typeof(List<FishyFlip.Lexicon.Com.Atproto.Repo.StrongRef>), TypeInfoPropertyName = "ListComAtprotoRepoStrongRef")]
[JsonSerializable(typeof(FishyFlip.Lexicon.Tools.Ozone.Moderation.SubjectStatusView), TypeInfoPropertyName = "ToolsOzoneModerationSubjectStatusView")]
Expand Down

0 comments on commit cd18d25

Please sign in to comment.