Just json to c#
This commit is contained in:
@ -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 {
|
||||
}
|
19
src/ImmichToSlideshow/Models/Open/Api/Band/Comments/Item.cs
Normal file
19
src/ImmichToSlideshow/Models/Open/Api/Band/Comments/Item.cs
Normal 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 {
|
||||
}
|
@ -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 {
|
||||
}
|
@ -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 {
|
||||
}
|
14
src/ImmichToSlideshow/Models/Open/Api/Band/Comments/Photo.cs
Normal file
14
src/ImmichToSlideshow/Models/Open/Api/Band/Comments/Photo.cs
Normal 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 {
|
||||
}
|
@ -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 {
|
||||
}
|
13
src/ImmichToSlideshow/Models/Open/Api/Band/Comments/Root.cs
Normal file
13
src/ImmichToSlideshow/Models/Open/Api/Band/Comments/Root.cs
Normal 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 {
|
||||
}
|
@ -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 {
|
||||
}
|
Reference in New Issue
Block a user