Spotify.NET/SpotifyAPI.Web/Models/Request/UsersTopItemsRequest.cs
Noel Griffin a27c3729c8
Add Users Top Tracks / Users Top Artists to UserClient (#938)
* add top tracks & artists endpoints

* fix file extenstion

* added TODO

* Add Methods to interface

* Add Top items query class

* implement query into UserProfileClient.cs - Top Requests

* Tidy Up Naming

* Removed random json file change

* Added Tests.

* run formatter

* remove additional namespace

---------

Co-authored-by: Jonas Dellinger <jonas@dellinger.dev>
2024-01-19 19:56:07 +01:00

48 lines
1.1 KiB
C#

using System;
namespace SpotifyAPI.Web
{
public class UsersTopItemsRequest : RequestParams
{
public UsersTopItemsRequest(TimeRange timeRange)
{
Ensure.ArgumentNotNull(timeRange, nameof(TimeRange));
TimeRangeParam = timeRange;
}
/// <summary>
/// The TimeRange Param : How far to look back for the top items.
/// </summary>
/// <value></value>
[QueryParam("time_range")]
public TimeRange TimeRangeParam { get; } = TimeRange.MediumTerm;
/// <summary>
/// The maximum number of objects to return. Default: 20. Minimum: 1. Maximum: 50.
/// </summary>
/// <value></value>
[QueryParam("limit")]
public int? Limit { get; set; }
/// <summary>
/// The index of the first object to return. Default: 0 (i.e., the first object).
/// Use with limit to get the next set of objects.
/// </summary>
/// <value></value>
[QueryParam("offset")]
public int? Offset { get; set; }
}
public enum TimeRange
{
[String("short_term")]
ShortTerm,
[String("medium_term")]
MediumTerm,
[String("long_term")]
LongTerm
}
}