mirror of
https://github.com/ckaczor/ChrisKaczor.MinifluxClient.git
synced 2026-02-16 10:58:35 -05:00
Initial commit
This commit is contained in:
30
Library/SortField.cs
Normal file
30
Library/SortField.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace ChrisKaczor.MinifluxClient;
|
||||
|
||||
[QueryParameterName("order")]
|
||||
public enum SortField
|
||||
{
|
||||
[QueryParameterName("id")]
|
||||
Id,
|
||||
|
||||
[QueryParameterName("status")]
|
||||
Status,
|
||||
|
||||
[QueryParameterName("published_at")]
|
||||
PublishedAt,
|
||||
|
||||
[QueryParameterName("category_title")]
|
||||
CategoryTitle,
|
||||
|
||||
[QueryParameterName("category_id")]
|
||||
CategoryId
|
||||
}
|
||||
|
||||
internal static class SortFieldExtensions
|
||||
{
|
||||
extension(SortField)
|
||||
{
|
||||
internal static string QueryParameterName => typeof(SortField).GetCustomAttribute<QueryParameterNameAttribute>()?.Name ?? throw new InvalidOperationException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user