Iceshrimp.NET/Iceshrimp.Shared/Schemas/UserProfileResponse.cs
Laura Hausmann 663903c992
[backend/api] Change RelationData object into a [Flags] enum (ISH-368)
This maintains the efficiency of JsonIgnoreCondition.WhenWritingDefault while generating a valid OpenAPI schema.
2024-06-17 17:54:28 +02:00

33 lines
No EOL
950 B
C#

namespace Iceshrimp.Shared.Schemas;
public class UserProfileResponse
{
public required string Id { get; set; }
public required string? Birthday { get; set; }
public required string? Location { get; set; }
public required List<UserProfileField>? Fields { get; set; }
public required string? Bio { get; set; }
public required int? Followers { get; set; }
public required int? Following { get; set; }
public required Relations Relations { get; set; }
}
[Flags]
public enum Relations
{
None = 0,
Self = 1,
Following = 2,
FollowedBy = 4,
Requested = 8,
RequestedBy = 16,
Blocking = 32,
Muting = 64
}
public class UserProfileField
{
public required string Name { get; set; }
public required string Value { get; set; }
public bool? Verified { get; set; }
}