Skip to content

Commit

Permalink
Use full namespace path for Lexicon values (#161)
Browse files Browse the repository at this point in the history
* Use full namespace path for Lexicon values

* Add it for JsonDerivedType too
  • Loading branch information
drasticactions authored Jan 15, 2025
1 parent 822196d commit 45e1c99
Show file tree
Hide file tree
Showing 485 changed files with 2,765 additions and 2,192 deletions.
902 changes: 452 additions & 450 deletions src/FishyFlip/Lexicon/ATObject.g.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static class ATProtoActorExtensions
/// <param name="validate"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<CreateRecordOutput?>> CreateProfileAsync(this FishyFlip.ATProtocol atp, App.Bsky.Actor.Profile record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
public static Task<Result<CreateRecordOutput?>> CreateProfileAsync(this FishyFlip.ATProtocol atp, FishyFlip.Lexicon.App.Bsky.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."), "app.bsky.actor.profile", record, rkey, validate, swapCommit, cancellationToken);
}
Expand All @@ -39,7 +39,7 @@ public static class ATProtoActorExtensions
/// <param name="validate"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<CreateRecordOutput?>> CreateProfileAsync(this FishyFlip.ATProtocol atp, string? displayName = default, string? description = default, Blob? avatar = default, Blob? banner = default, Com.Atproto.Label.SelfLabels? labels = default, Com.Atproto.Repo.StrongRef? joinedViaStarterPack = default, Com.Atproto.Repo.StrongRef? pinnedPost = default, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
public static Task<Result<CreateRecordOutput?>> CreateProfileAsync(this FishyFlip.ATProtocol atp, string? displayName = default, string? description = default, Blob? avatar = default, Blob? banner = default, FishyFlip.Lexicon.Com.Atproto.Label.SelfLabels? labels = default, Com.Atproto.Repo.StrongRef? joinedViaStarterPack = default, Com.Atproto.Repo.StrongRef? pinnedPost = default, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
{
var record = new FishyFlip.Lexicon.App.Bsky.Actor.Profile();
record.DisplayName = displayName;
Expand Down Expand Up @@ -78,7 +78,7 @@ public static class ATProtoActorExtensions
/// <param name="swapRecord"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<PutRecordOutput?>> PutProfileAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, App.Bsky.Actor.Profile record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default)
public static Task<Result<PutRecordOutput?>> PutProfileAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, FishyFlip.Lexicon.App.Bsky.Actor.Profile record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default)
{
return atp.PutRecordAsync(repo, "app.bsky.actor.profile", rkey, record, validate, swapRecord, swapCommit, cancellationToken);
}
Expand Down
2 changes: 1 addition & 1 deletion src/FishyFlip/Lexicon/App/Bsky/Actor/ActorExtensions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static class BlueskyActorExtensions
/// <param name="validate"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<CreateRecordOutput?>> CreateProfileAsync(this FishyFlip.Lexicon.App.Bsky.Actor.BlueskyActor atp, string? displayName = default, string? description = default, Blob? avatar = default, Blob? banner = default, Com.Atproto.Label.SelfLabels? labels = default, Com.Atproto.Repo.StrongRef? joinedViaStarterPack = default, Com.Atproto.Repo.StrongRef? pinnedPost = default, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
public static Task<Result<CreateRecordOutput?>> CreateProfileAsync(this FishyFlip.Lexicon.App.Bsky.Actor.BlueskyActor atp, string? displayName = default, string? description = default, Blob? avatar = default, Blob? banner = default, FishyFlip.Lexicon.Com.Atproto.Label.SelfLabels? labels = default, Com.Atproto.Repo.StrongRef? joinedViaStarterPack = default, Com.Atproto.Repo.StrongRef? pinnedPost = default, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
{
var record = new FishyFlip.Lexicon.App.Bsky.Actor.Profile();
record.DisplayName = displayName;
Expand Down
4 changes: 2 additions & 2 deletions src/FishyFlip/Lexicon/App/Bsky/Actor/AdultContentPref.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public AdultContentPref(CBORObject obj)

public override string ToJson()
{
return JsonSerializer.Serialize<App.Bsky.Actor.AdultContentPref>(this, (JsonTypeInfo<App.Bsky.Actor.AdultContentPref>)SourceGenerationContext.Default.AppBskyActorAdultContentPref)!;
return JsonSerializer.Serialize<FishyFlip.Lexicon.App.Bsky.Actor.AdultContentPref>(this, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.AdultContentPref>)SourceGenerationContext.Default.AppBskyActorAdultContentPref)!;
}

public static AdultContentPref FromJson(string json)
{
return JsonSerializer.Deserialize<App.Bsky.Actor.AdultContentPref>(json, (JsonTypeInfo<App.Bsky.Actor.AdultContentPref>)SourceGenerationContext.Default.AppBskyActorAdultContentPref)!;
return JsonSerializer.Deserialize<FishyFlip.Lexicon.App.Bsky.Actor.AdultContentPref>(json, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.AdultContentPref>)SourceGenerationContext.Default.AppBskyActorAdultContentPref)!;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public BskyAppProgressGuide(CBORObject obj)

public override string ToJson()
{
return JsonSerializer.Serialize<App.Bsky.Actor.BskyAppProgressGuide>(this, (JsonTypeInfo<App.Bsky.Actor.BskyAppProgressGuide>)SourceGenerationContext.Default.AppBskyActorBskyAppProgressGuide)!;
return JsonSerializer.Serialize<FishyFlip.Lexicon.App.Bsky.Actor.BskyAppProgressGuide>(this, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.BskyAppProgressGuide>)SourceGenerationContext.Default.AppBskyActorBskyAppProgressGuide)!;
}

public static BskyAppProgressGuide FromJson(string json)
{
return JsonSerializer.Deserialize<App.Bsky.Actor.BskyAppProgressGuide>(json, (JsonTypeInfo<App.Bsky.Actor.BskyAppProgressGuide>)SourceGenerationContext.Default.AppBskyActorBskyAppProgressGuide)!;
return JsonSerializer.Deserialize<FishyFlip.Lexicon.App.Bsky.Actor.BskyAppProgressGuide>(json, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.BskyAppProgressGuide>)SourceGenerationContext.Default.AppBskyActorBskyAppProgressGuide)!;
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/FishyFlip/Lexicon/App/Bsky/Actor/BskyAppStatePref.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class BskyAppStatePref : ATObject
/// </param>
/// <param name="queuedNudges">An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.</param>
/// <param name="nuxs">Storage for NUXs the user has encountered.</param>
public BskyAppStatePref(App.Bsky.Actor.BskyAppProgressGuide? activeProgressGuide = default, List<string>? queuedNudges = default, List<App.Bsky.Actor.Nux>? nuxs = default)
public BskyAppStatePref(FishyFlip.Lexicon.App.Bsky.Actor.BskyAppProgressGuide? activeProgressGuide = default, List<string>? queuedNudges = default, List<FishyFlip.Lexicon.App.Bsky.Actor.Nux>? nuxs = default)
{
this.ActiveProgressGuide = activeProgressGuide;
this.QueuedNudges = queuedNudges;
Expand All @@ -41,17 +41,17 @@ public BskyAppStatePref()
/// </summary>
public BskyAppStatePref(CBORObject obj)
{
if (obj["activeProgressGuide"] is not null) this.ActiveProgressGuide = new App.Bsky.Actor.BskyAppProgressGuide(obj["activeProgressGuide"]);
if (obj["activeProgressGuide"] is not null) this.ActiveProgressGuide = new FishyFlip.Lexicon.App.Bsky.Actor.BskyAppProgressGuide(obj["activeProgressGuide"]);
if (obj["queuedNudges"] is not null) this.QueuedNudges = obj["queuedNudges"].Values.Select(n =>n.AsString()).ToList();
if (obj["nuxs"] is not null) this.Nuxs = obj["nuxs"].Values.Select(n =>new App.Bsky.Actor.Nux(n)).ToList();
if (obj["nuxs"] is not null) this.Nuxs = obj["nuxs"].Values.Select(n =>new FishyFlip.Lexicon.App.Bsky.Actor.Nux(n)).ToList();
}

/// <summary>
/// Gets or sets the activeProgressGuide.
/// <br/> <see cref="FishyFlip.Lexicon.App.Bsky.Actor.BskyAppProgressGuide"/> (app.bsky.actor.defs#bskyAppProgressGuide)
/// </summary>
[JsonPropertyName("activeProgressGuide")]
public App.Bsky.Actor.BskyAppProgressGuide? ActiveProgressGuide { get; set; }
public FishyFlip.Lexicon.App.Bsky.Actor.BskyAppProgressGuide? ActiveProgressGuide { get; set; }

/// <summary>
/// Gets or sets the queuedNudges.
Expand All @@ -65,7 +65,7 @@ public BskyAppStatePref(CBORObject obj)
/// <br/> Storage for NUXs the user has encountered.
/// </summary>
[JsonPropertyName("nuxs")]
public List<App.Bsky.Actor.Nux>? Nuxs { get; set; }
public List<FishyFlip.Lexicon.App.Bsky.Actor.Nux>? Nuxs { get; set; }

/// <summary>
/// Gets the ATRecord Type.
Expand All @@ -77,12 +77,12 @@ public BskyAppStatePref(CBORObject obj)

public override string ToJson()
{
return JsonSerializer.Serialize<App.Bsky.Actor.BskyAppStatePref>(this, (JsonTypeInfo<App.Bsky.Actor.BskyAppStatePref>)SourceGenerationContext.Default.AppBskyActorBskyAppStatePref)!;
return JsonSerializer.Serialize<FishyFlip.Lexicon.App.Bsky.Actor.BskyAppStatePref>(this, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.BskyAppStatePref>)SourceGenerationContext.Default.AppBskyActorBskyAppStatePref)!;
}

public static BskyAppStatePref FromJson(string json)
{
return JsonSerializer.Deserialize<App.Bsky.Actor.BskyAppStatePref>(json, (JsonTypeInfo<App.Bsky.Actor.BskyAppStatePref>)SourceGenerationContext.Default.AppBskyActorBskyAppStatePref)!;
return JsonSerializer.Deserialize<FishyFlip.Lexicon.App.Bsky.Actor.BskyAppStatePref>(json, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.BskyAppStatePref>)SourceGenerationContext.Default.AppBskyActorBskyAppStatePref)!;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/FishyFlip/Lexicon/App/Bsky/Actor/ContentLabelPref.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public ContentLabelPref(CBORObject obj)

public override string ToJson()
{
return JsonSerializer.Serialize<App.Bsky.Actor.ContentLabelPref>(this, (JsonTypeInfo<App.Bsky.Actor.ContentLabelPref>)SourceGenerationContext.Default.AppBskyActorContentLabelPref)!;
return JsonSerializer.Serialize<FishyFlip.Lexicon.App.Bsky.Actor.ContentLabelPref>(this, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.ContentLabelPref>)SourceGenerationContext.Default.AppBskyActorContentLabelPref)!;
}

public static ContentLabelPref FromJson(string json)
{
return JsonSerializer.Deserialize<App.Bsky.Actor.ContentLabelPref>(json, (JsonTypeInfo<App.Bsky.Actor.ContentLabelPref>)SourceGenerationContext.Default.AppBskyActorContentLabelPref)!;
return JsonSerializer.Deserialize<FishyFlip.Lexicon.App.Bsky.Actor.ContentLabelPref>(json, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.ContentLabelPref>)SourceGenerationContext.Default.AppBskyActorContentLabelPref)!;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/FishyFlip/Lexicon/App/Bsky/Actor/FeedViewPref.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ public FeedViewPref(CBORObject obj)

public override string ToJson()
{
return JsonSerializer.Serialize<App.Bsky.Actor.FeedViewPref>(this, (JsonTypeInfo<App.Bsky.Actor.FeedViewPref>)SourceGenerationContext.Default.AppBskyActorFeedViewPref)!;
return JsonSerializer.Serialize<FishyFlip.Lexicon.App.Bsky.Actor.FeedViewPref>(this, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.FeedViewPref>)SourceGenerationContext.Default.AppBskyActorFeedViewPref)!;
}

public static FeedViewPref FromJson(string json)
{
return JsonSerializer.Deserialize<App.Bsky.Actor.FeedViewPref>(json, (JsonTypeInfo<App.Bsky.Actor.FeedViewPref>)SourceGenerationContext.Default.AppBskyActorFeedViewPref)!;
return JsonSerializer.Deserialize<FishyFlip.Lexicon.App.Bsky.Actor.FeedViewPref>(json, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.FeedViewPref>)SourceGenerationContext.Default.AppBskyActorFeedViewPref)!;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public GetPreferencesOutput(CBORObject obj)

public override string ToJson()
{
return JsonSerializer.Serialize<App.Bsky.Actor.GetPreferencesOutput>(this, (JsonTypeInfo<App.Bsky.Actor.GetPreferencesOutput>)SourceGenerationContext.Default.AppBskyActorGetPreferencesOutput)!;
return JsonSerializer.Serialize<FishyFlip.Lexicon.App.Bsky.Actor.GetPreferencesOutput>(this, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.GetPreferencesOutput>)SourceGenerationContext.Default.AppBskyActorGetPreferencesOutput)!;
}

public static GetPreferencesOutput FromJson(string json)
{
return JsonSerializer.Deserialize<App.Bsky.Actor.GetPreferencesOutput>(json, (JsonTypeInfo<App.Bsky.Actor.GetPreferencesOutput>)SourceGenerationContext.Default.AppBskyActorGetPreferencesOutput)!;
return JsonSerializer.Deserialize<FishyFlip.Lexicon.App.Bsky.Actor.GetPreferencesOutput>(json, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.GetPreferencesOutput>)SourceGenerationContext.Default.AppBskyActorGetPreferencesOutput)!;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/FishyFlip/Lexicon/App/Bsky/Actor/GetProfilesOutput.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial class GetProfilesOutput : ATObject
/// Initializes a new instance of the <see cref="GetProfilesOutput"/> class.
/// </summary>
/// <param name="profiles"></param>
public GetProfilesOutput(List<App.Bsky.Actor.ProfileViewDetailed>? profiles = default)
public GetProfilesOutput(List<FishyFlip.Lexicon.App.Bsky.Actor.ProfileViewDetailed>? profiles = default)
{
this.Profiles = profiles;
}
Expand All @@ -32,15 +32,15 @@ public GetProfilesOutput()
/// </summary>
public GetProfilesOutput(CBORObject obj)
{
if (obj["profiles"] is not null) this.Profiles = obj["profiles"].Values.Select(n =>new App.Bsky.Actor.ProfileViewDetailed(n)).ToList();
if (obj["profiles"] is not null) this.Profiles = obj["profiles"].Values.Select(n =>new FishyFlip.Lexicon.App.Bsky.Actor.ProfileViewDetailed(n)).ToList();
}

/// <summary>
/// Gets or sets the profiles.
/// </summary>
[JsonPropertyName("profiles")]
[JsonRequired]
public List<App.Bsky.Actor.ProfileViewDetailed>? Profiles { get; set; }
public List<FishyFlip.Lexicon.App.Bsky.Actor.ProfileViewDetailed>? Profiles { get; set; }

/// <summary>
/// Gets the ATRecord Type.
Expand All @@ -52,12 +52,12 @@ public GetProfilesOutput(CBORObject obj)

public override string ToJson()
{
return JsonSerializer.Serialize<App.Bsky.Actor.GetProfilesOutput>(this, (JsonTypeInfo<App.Bsky.Actor.GetProfilesOutput>)SourceGenerationContext.Default.AppBskyActorGetProfilesOutput)!;
return JsonSerializer.Serialize<FishyFlip.Lexicon.App.Bsky.Actor.GetProfilesOutput>(this, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.GetProfilesOutput>)SourceGenerationContext.Default.AppBskyActorGetProfilesOutput)!;
}

public static GetProfilesOutput FromJson(string json)
{
return JsonSerializer.Deserialize<App.Bsky.Actor.GetProfilesOutput>(json, (JsonTypeInfo<App.Bsky.Actor.GetProfilesOutput>)SourceGenerationContext.Default.AppBskyActorGetProfilesOutput)!;
return JsonSerializer.Deserialize<FishyFlip.Lexicon.App.Bsky.Actor.GetProfilesOutput>(json, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.GetProfilesOutput>)SourceGenerationContext.Default.AppBskyActorGetProfilesOutput)!;
}
}
}
Expand Down
20 changes: 15 additions & 5 deletions src/FishyFlip/Lexicon/App/Bsky/Actor/GetSuggestionsOutput.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ public partial class GetSuggestionsOutput : ATObject
/// </summary>
/// <param name="cursor"></param>
/// <param name="actors"></param>
public GetSuggestionsOutput(string? cursor = default, List<App.Bsky.Actor.ProfileView>? actors = default)
/// <param name="recId">Snowflake for this recommendation, use when submitting recommendation events.</param>
public GetSuggestionsOutput(string? cursor = default, List<FishyFlip.Lexicon.App.Bsky.Actor.ProfileView>? actors = default, long? recId = default)
{
this.Cursor = cursor;
this.Actors = actors;
this.RecId = recId;
}


Expand All @@ -35,7 +37,8 @@ public GetSuggestionsOutput()
public GetSuggestionsOutput(CBORObject obj)
{
if (obj["cursor"] is not null) this.Cursor = obj["cursor"].AsString();
if (obj["actors"] is not null) this.Actors = obj["actors"].Values.Select(n =>new App.Bsky.Actor.ProfileView(n)).ToList();
if (obj["actors"] is not null) this.Actors = obj["actors"].Values.Select(n =>new FishyFlip.Lexicon.App.Bsky.Actor.ProfileView(n)).ToList();
if (obj["recId"] is not null) this.RecId = obj["recId"].AsInt64Value();
}

/// <summary>
Expand All @@ -49,7 +52,14 @@ public GetSuggestionsOutput(CBORObject obj)
/// </summary>
[JsonPropertyName("actors")]
[JsonRequired]
public List<App.Bsky.Actor.ProfileView>? Actors { get; set; }
public List<FishyFlip.Lexicon.App.Bsky.Actor.ProfileView>? Actors { get; set; }

/// <summary>
/// Gets or sets the recId.
/// <br/> Snowflake for this recommendation, use when submitting recommendation events.
/// </summary>
[JsonPropertyName("recId")]
public long? RecId { get; set; }

/// <summary>
/// Gets the ATRecord Type.
Expand All @@ -61,12 +71,12 @@ public GetSuggestionsOutput(CBORObject obj)

public override string ToJson()
{
return JsonSerializer.Serialize<App.Bsky.Actor.GetSuggestionsOutput>(this, (JsonTypeInfo<App.Bsky.Actor.GetSuggestionsOutput>)SourceGenerationContext.Default.AppBskyActorGetSuggestionsOutput)!;
return JsonSerializer.Serialize<FishyFlip.Lexicon.App.Bsky.Actor.GetSuggestionsOutput>(this, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.GetSuggestionsOutput>)SourceGenerationContext.Default.AppBskyActorGetSuggestionsOutput)!;
}

public static GetSuggestionsOutput FromJson(string json)
{
return JsonSerializer.Deserialize<App.Bsky.Actor.GetSuggestionsOutput>(json, (JsonTypeInfo<App.Bsky.Actor.GetSuggestionsOutput>)SourceGenerationContext.Default.AppBskyActorGetSuggestionsOutput)!;
return JsonSerializer.Deserialize<FishyFlip.Lexicon.App.Bsky.Actor.GetSuggestionsOutput>(json, (JsonTypeInfo<FishyFlip.Lexicon.App.Bsky.Actor.GetSuggestionsOutput>)SourceGenerationContext.Default.AppBskyActorGetSuggestionsOutput)!;
}
}
}
Expand Down
Loading

0 comments on commit 45e1c99

Please sign in to comment.