Just json to c#

This commit is contained in:
2025-08-22 13:00:01 -07:00
parent 895dab9413
commit 47fc079e0a
66 changed files with 2246 additions and 17 deletions

View File

@ -0,0 +1,14 @@
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.Open.Api.Band.Comments;
public record Author(
[property: JsonPropertyName("description")] string Description,
[property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("profile_image_url")] string ProfileImageUrl
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Author))]
public partial class CommentsAuthorSourceGenerationContext : JsonSerializerContext {
}

View File

@ -0,0 +1,19 @@
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.Open.Api.Band.Comments;
public record Item(
[property: JsonPropertyName("author")] Author Author,
[property: JsonPropertyName("comments_key")] string CommentsKey,
[property: JsonPropertyName("content")] string Content,
[property: JsonPropertyName("created_at")] object CreatedAt,
[property: JsonPropertyName("emotion_count")] int EmotionCount,
[property: JsonPropertyName("is_audio_comments")] bool IsAudioComments,
[property: JsonPropertyName("photo")] Photo Photo,
[property: JsonPropertyName("sticker")] object Sticker
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Item))]
public partial class CommentsItemSourceGenerationContext : JsonSerializerContext {
}

View File

@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.Open.Api.Band.Comments;
public record NextParams(
[property: JsonPropertyName("access_token")] string AccessToken,
[property: JsonPropertyName("after")] string After,
[property: JsonPropertyName("band_key")] string BandKey,
[property: JsonPropertyName("post_key")] string PostKey
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(NextParams))]
public partial class CommentsNextParamsSourceGenerationContext : JsonSerializerContext {
}

View File

@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.Open.Api.Band.Comments;
public record Paging(
[property: JsonPropertyName("next_params")] NextParams NextParams,
[property: JsonPropertyName("previous_params")] object PreviousParams
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Paging))]
public partial class CommentsPagingSourceGenerationContext : JsonSerializerContext {
}

View File

@ -0,0 +1,14 @@
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.Open.Api.Band.Comments;
public record Photo(
[property: JsonPropertyName("height")] int Height,
[property: JsonPropertyName("url")] string Url,
[property: JsonPropertyName("width")] int Width
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Photo))]
public partial class CommentsPhotoSourceGenerationContext : JsonSerializerContext {
}

View File

@ -0,0 +1,14 @@
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.Open.Api.Band.Comments;
public record ResultData(
[property: JsonPropertyName("items")] IReadOnlyList<Item> Items,
[property: JsonPropertyName("paging")] Paging Paging,
[property: JsonPropertyName("update_param")] UpdateParam UpdateParam
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ResultData))]
public partial class CommentsResultDataSourceGenerationContext : JsonSerializerContext {
}

View File

@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.Open.Api.Band.Comments;
public record Root(
[property: JsonPropertyName("result_code")] int ResultCode,
[property: JsonPropertyName("result_data")] ResultData ResultData
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Root))]
public partial class CommentsRootSourceGenerationContext : JsonSerializerContext {
}

View File

@ -0,0 +1,11 @@
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.Open.Api.Band.Comments;
public record UpdateParam(
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(UpdateParam))]
public partial class CommentsUpdateParamSourceGenerationContext : JsonSerializerContext {
}