forked from JohnnyCrazy/SpotifyAPI-NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPaging.cs
More file actions
40 lines (31 loc) · 818 Bytes
/
Paging.cs
File metadata and controls
40 lines (31 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SpotifyAPI.Web.Models
{
public class Paging<T> : BasicModel
{
[JsonPropertyName("href")]
public string Href { get; set; }
[JsonPropertyName("items")]
public List<T> Items { get; set; }
[JsonPropertyName("limit")]
public int Limit { get; set; }
[JsonPropertyName("next")]
public string Next { get; set; }
[JsonPropertyName("offset")]
public int Offset { get; set; }
[JsonPropertyName("previous")]
public string Previous { get; set; }
[JsonPropertyName("total")]
public int Total { get; set; }
public bool HasNextPage()
{
return Next != null;
}
public bool HasPreviousPage()
{
return Previous != null;
}
}
}