-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1fd358
commit 14539fd
Showing
8 changed files
with
441 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
249 changes: 249 additions & 0 deletions
249
src/FishyFlip/Lexicon/Ma/Tokono/Byov/ATProtoByovExtensions.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
// <auto-generated /> | ||
// This file was generated by FFSourceGen. | ||
// Do not modify this file. | ||
|
||
#nullable enable | ||
|
||
using FishyFlip.Lexicon.Com.Atproto.Repo; | ||
|
||
namespace FishyFlip.Lexicon.Ma.Tokono.Byov | ||
{ | ||
|
||
/// <summary> | ||
/// Extension methods for ma.tokono.byov. | ||
/// </summary> | ||
public static class ATProtoByovExtensions | ||
{ | ||
|
||
/// <summary> | ||
/// Create a Subscription 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?>> CreateSubscriptionAsync(this FishyFlip.ATProtocol atp, Ma.Tokono.Byov.Subscription 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."), "ma.tokono.byov.subscription", record, rkey, validate, swapCommit, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Create a Subscription 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?>> CreateSubscriptionAsync(this FishyFlip.ATProtocol atp, string? subject, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) | ||
{ | ||
var record = new FishyFlip.Lexicon.Ma.Tokono.Byov.Subscription(); | ||
record.CreatedAt = createdAt ?? DateTime.UtcNow; | ||
record.Subject = subject; | ||
return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.subscription", record, rkey, validate, swapCommit, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Delete a Subscription 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?>> DeleteSubscriptionAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) | ||
{ | ||
return atp.DeleteRecordAsync(repo, "ma.tokono.byov.subscription", rkey, swapRecord, swapCommit, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Put a Subscription 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?>> PutSubscriptionAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Ma.Tokono.Byov.Subscription record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) | ||
{ | ||
return atp.PutRecordAsync(repo, "ma.tokono.byov.subscription", rkey, record, validate, swapRecord, swapCommit, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// List Subscription 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?>> ListSubscriptionAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) | ||
{ | ||
return atp.ListRecordsAsync(repo, "ma.tokono.byov.subscription", limit, cursor, reverse, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// List Subscription 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?>> ListSubscriptionAsync(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."), "ma.tokono.byov.subscription", limit, cursor, reverse, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Get Subscription 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?>> GetSubscriptionAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) | ||
{ | ||
return atp.GetRecordAsync(repo, "ma.tokono.byov.subscription", rkey, cid, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Get Subscription records. | ||
/// </summary> | ||
/// <param name="atp"></param> | ||
/// <param name="rkey"></param> | ||
/// <param name="cid"></param> | ||
/// <param name="cancellationToken"></param> | ||
public static Task<Result<GetRecordOutput?>> GetSubscriptionAsync(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."), "ma.tokono.byov.subscription", rkey, cid, cancellationToken); | ||
} | ||
/// <summary> | ||
/// Create a Video 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?>> CreateVideoAsync(this FishyFlip.ATProtocol atp, Ma.Tokono.Byov.Video 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."), "ma.tokono.byov.video", record, rkey, validate, swapCommit, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Create a Video 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?>> CreateVideoAsync(this FishyFlip.ATProtocol atp, string? cid, string? id, string? serviceProvider, string? title, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) | ||
{ | ||
var record = new FishyFlip.Lexicon.Ma.Tokono.Byov.Video(); | ||
record.Cid = cid; | ||
record.CreatedAt = createdAt ?? DateTime.UtcNow; | ||
record.Id = id; | ||
record.ServiceProvider = serviceProvider; | ||
record.Title = title; | ||
return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.video", record, rkey, validate, swapCommit, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Delete a Video 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?>> DeleteVideoAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) | ||
{ | ||
return atp.DeleteRecordAsync(repo, "ma.tokono.byov.video", rkey, swapRecord, swapCommit, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Put a Video 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?>> PutVideoAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Ma.Tokono.Byov.Video record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) | ||
{ | ||
return atp.PutRecordAsync(repo, "ma.tokono.byov.video", rkey, record, validate, swapRecord, swapCommit, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// List Video 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?>> ListVideoAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) | ||
{ | ||
return atp.ListRecordsAsync(repo, "ma.tokono.byov.video", limit, cursor, reverse, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// List Video 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?>> ListVideoAsync(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."), "ma.tokono.byov.video", limit, cursor, reverse, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Get Video 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?>> GetVideoAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) | ||
{ | ||
return atp.GetRecordAsync(repo, "ma.tokono.byov.video", rkey, cid, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Get Video records. | ||
/// </summary> | ||
/// <param name="atp"></param> | ||
/// <param name="rkey"></param> | ||
/// <param name="cid"></param> | ||
/// <param name="cancellationToken"></param> | ||
public static Task<Result<GetRecordOutput?>> GetVideoAsync(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."), "ma.tokono.byov.video", rkey, cid, cancellationToken); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// <auto-generated /> | ||
// This file was generated by FFSourceGen. | ||
// Do not modify this file. | ||
|
||
#nullable enable | ||
|
||
namespace FishyFlip.Lexicon.Ma.Tokono.Byov | ||
{ | ||
/// <summary> | ||
/// A channel subscription. | ||
/// </summary> | ||
public partial class Subscription : ATObject | ||
{ | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Subscription"/> class. | ||
/// </summary> | ||
/// <param name="subject"></param> | ||
/// <param name="createdAt"></param> | ||
public Subscription(string? subject, DateTime? createdAt = default) | ||
{ | ||
this.CreatedAt = createdAt ?? DateTime.UtcNow; | ||
this.Subject = subject; | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Subscription"/> class. | ||
/// </summary> | ||
public Subscription() | ||
{ | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Subscription"/> class. | ||
/// </summary> | ||
public Subscription(CBORObject obj) | ||
{ | ||
if (obj["createdAt"] is not null) this.CreatedAt = obj["createdAt"].ToDateTime(); | ||
if (obj["subject"] is not null) this.Subject = obj["subject"].AsString(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the createdAt. | ||
/// </summary> | ||
[JsonPropertyName("createdAt")] | ||
public DateTime? CreatedAt { get; set; } = default; | ||
|
||
/// <summary> | ||
/// Gets or sets the subject. | ||
/// </summary> | ||
[JsonPropertyName("subject")] | ||
public string? Subject { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the ATRecord Type. | ||
/// </summary> | ||
[JsonPropertyName("$type")] | ||
public override string Type => "ma.tokono.byov.subscription"; | ||
|
||
public const string RecordType = "ma.tokono.byov.subscription"; | ||
|
||
public override string ToJson() | ||
{ | ||
return JsonSerializer.Serialize<Ma.Tokono.Byov.Subscription>(this, (JsonTypeInfo<Ma.Tokono.Byov.Subscription>)SourceGenerationContext.Default.MaTokonoByovSubscription)!; | ||
} | ||
|
||
public static Subscription FromJson(string json) | ||
{ | ||
return JsonSerializer.Deserialize<Ma.Tokono.Byov.Subscription>(json, (JsonTypeInfo<Ma.Tokono.Byov.Subscription>)SourceGenerationContext.Default.MaTokonoByovSubscription)!; | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.