Skip to content

Commit c34167e

Browse files
committed
More Docs JohnnyCrazy#451
1 parent 5da15c1 commit c34167e

9 files changed

Lines changed: 210 additions & 0 deletions

‎SpotifyAPI.Web/Clients/Interfaces/IPlayerClient.cs‎

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,129 @@ public interface IPlayerClient
7373
/// <returns></returns>
7474
Task<CurrentlyPlayingContext> GetCurrentPlayback(PlayerCurrentPlaybackRequest request);
7575

76+
/// <summary>
77+
/// Seeks to the given position in the user’s currently playing track.
78+
/// </summary>
79+
/// <param name="request">The request-model which contains required and optional parameters.</param>
80+
/// <remarks>
81+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-seek-to-position-in-currently-playing-track
82+
/// </remarks>
83+
/// <returns></returns>
7684
Task<bool> SeekTo(PlayerSeekToRequest request);
7785

86+
/// <summary>
87+
/// Skips to previous track in the user’s queue.
88+
/// </summary>
89+
/// <remarks>
90+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-skip-users-playback-to-previous-track
91+
/// </remarks>
92+
/// <returns></returns>
7893
Task<bool> SkipPrevious();
94+
95+
/// <summary>
96+
/// Skips to previous track in the user’s queue.
97+
/// </summary>
98+
/// <param name="request">The request-model which contains required and optional parameters.</param>
99+
/// <remarks>
100+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-skip-users-playback-to-previous-track
101+
/// </remarks>
102+
/// <returns></returns>
79103
Task<bool> SkipPrevious(PlayerSkipPreviousRequest request);
80104

105+
/// <summary>
106+
/// Start a new context or resume current playback on the user’s active device.
107+
/// </summary>
108+
/// <remarks>
109+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-start-a-users-playback
110+
/// </remarks>
111+
/// <returns></returns>
81112
Task<bool> ResumePlayback();
113+
114+
/// <summary>
115+
/// Start a new context or resume current playback on the user’s active device.
116+
/// </summary>
117+
/// <param name="request">The request-model which contains required and optional parameters.</param>
118+
/// <remarks>
119+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-start-a-users-playback
120+
/// </remarks>
121+
/// <returns></returns>
82122
Task<bool> ResumePlayback(PlayerResumePlaybackRequest request);
83123

124+
/// <summary>
125+
/// Pause playback on the user’s account.
126+
/// </summary>
127+
/// <remarks>
128+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-pause-a-users-playback
129+
/// </remarks>
130+
/// <returns></returns>
84131
Task<bool> PausePlayback();
132+
133+
/// <summary>
134+
/// Pause playback on the user’s account.
135+
/// </summary>
136+
/// <param name="request">The request-model which contains required and optional parameters.</param>
137+
/// <remarks>
138+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-pause-a-users-playback
139+
/// </remarks>
140+
/// <returns></returns>
85141
Task<bool> PausePlayback(PlayerPausePlaybackRequest request);
86142

143+
/// <summary>
144+
/// Set the volume for the user’s current playback device.
145+
/// </summary>
146+
/// <param name="request">The request-model which contains required and optional parameters.</param>
147+
/// <remarks>
148+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-set-volume-for-users-playback
149+
/// </remarks>
150+
/// <returns></returns>
87151
Task<bool> SetVolume(PlayerVolumeRequest request);
88152

153+
/// <summary>
154+
/// Get tracks from the current user’s recently played tracks. Note: Currently doesn’t support podcast episodes.
155+
/// </summary>
156+
/// <remarks>
157+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-recently-played
158+
/// </remarks>
159+
/// <returns></returns>
89160
Task<CursorPaging<PlayHistoryItem>> GetRecentlyPlayed();
161+
162+
/// <summary>
163+
/// Get tracks from the current user’s recently played tracks. Note: Currently doesn’t support podcast episodes.
164+
/// </summary>
165+
/// <param name="request">The request-model which contains required and optional parameters.</param>
166+
/// <remarks>
167+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-recently-played
168+
/// </remarks>
169+
/// <returns></returns>
90170
Task<CursorPaging<PlayHistoryItem>> GetRecentlyPlayed(PlayerRecentlyPlayedRequest request);
91171

172+
/// <summary>
173+
/// Get information about a user’s available devices.
174+
/// </summary>
175+
/// <remarks>
176+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-get-a-users-available-devices
177+
/// </remarks>
178+
/// <returns></returns>
92179
Task<DeviceResponse> GetAvailableDevices();
93180

181+
/// <summary>
182+
/// Toggle shuffle on or off for user’s playback.
183+
/// </summary>
184+
/// <param name="request">The request-model which contains required and optional parameters.</param>
185+
/// <remarks>
186+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-toggle-shuffle-for-users-playback
187+
/// </remarks>
188+
/// <returns></returns>
94189
Task<bool> SetShuffle(PlayerShuffleRequest request);
95190

191+
/// <summary>
192+
/// Add an item to the end of the user’s current playback queue.
193+
/// </summary>
194+
/// <param name="request">The request-model which contains required and optional parameters.</param>
195+
/// <remarks>
196+
/// https://developer.spotify.com/documentation/web-api/reference-beta/#endpoint-add-to-queue
197+
/// </remarks>
198+
/// <returns></returns>
96199
Task<bool> AddToQueue(PlayerAddToQueueRequest request);
97200
}
98201
}

‎SpotifyAPI.Web/Models/Request/PlayerAddToQueueRequest.cs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,29 @@ namespace SpotifyAPI.Web
22
{
33
public class PlayerAddToQueueRequest : RequestParams
44
{
5+
/// <summary>
6+
///
7+
/// </summary>
8+
/// <param name="uri">The uri of the item to add to the queue. Must be a track or an episode uri.</param>
59
public PlayerAddToQueueRequest(string uri)
610
{
711
Ensure.ArgumentNotNullOrEmptyString(uri, nameof(uri));
812

913
Uri = uri;
1014
}
1115

16+
/// <summary>
17+
/// The uri of the item to add to the queue. Must be a track or an episode uri.
18+
/// </summary>
19+
/// <value></value>
1220
[QueryParam("uri")]
1321
public string Uri { get; }
1422

23+
/// <summary>
24+
/// The id of the device this command is targeting.
25+
/// If not supplied, the user’s currently active device is the target.
26+
/// </summary>
27+
/// <value></value>
1528
[QueryParam("device_id")]
1629
public string? DeviceId { get; set; }
1730
}

‎SpotifyAPI.Web/Models/Request/PlayerPausePlaybackRequest.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ namespace SpotifyAPI.Web
22
{
33
public class PlayerPausePlaybackRequest : RequestParams
44
{
5+
/// <summary>
6+
/// The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
7+
/// </summary>
8+
/// <value></value>
59
[QueryParam("device_id")]
610
public string? DeviceId { get; set; }
711
}

‎SpotifyAPI.Web/Models/Request/PlayerRecentlyPlayedRequest.cs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,26 @@ namespace SpotifyAPI.Web
22
{
33
public class PlayerRecentlyPlayedRequest : RequestParams
44
{
5+
/// <summary>
6+
/// The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
7+
/// </summary>
8+
/// <value></value>
59
[QueryParam("limit")]
610
public int? Limit { get; set; }
711

12+
/// <summary>
13+
/// A Unix timestamp in milliseconds. Returns all items after (but not including) this cursor position.
14+
/// If after is specified, before must not be specified.
15+
/// </summary>
16+
/// <value></value>
817
[QueryParam("after")]
918
public long? After { get; set; }
1019

20+
/// <summary>
21+
/// A Unix timestamp in milliseconds. Returns all items before (but not including) this cursor position.
22+
/// If before is specified, after must not be specified.
23+
/// </summary>
24+
/// <value></value>
1125
[QueryParam("before")]
1226
public long? Before { get; set; }
1327
}

‎SpotifyAPI.Web/Models/Request/PlayerResumePlaybackRequest.cs‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,55 @@ namespace SpotifyAPI.Web
55
{
66
public class PlayerResumePlaybackRequest : RequestParams
77
{
8+
/// <summary>
9+
/// The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
10+
/// </summary>
11+
/// <value></value>
812
[QueryParam("device_id")]
913
public string? DeviceId { get; set; }
1014

15+
/// <summary>
16+
/// Undocumented by Spotify Beta Docs
17+
/// </summary>
18+
/// <value></value>
1119
[BodyParam("context_uri")]
1220
public string? ContextUri { get; set; }
1321

22+
/// <summary>
23+
/// Undocumented by Spotify Beta Docs
24+
/// </summary>
25+
/// <value></value>
1426
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227")]
1527
[BodyParam("uris")]
1628
public IList<string>? Uris { get; set; }
1729

30+
/// <summary>
31+
/// Undocumented by Spotify Beta Docs
32+
/// </summary>
33+
/// <value></value>
1834
[BodyParam("offset")]
1935
public Offset? OffsetParam { get; set; }
2036

37+
/// <summary>
38+
/// Undocumented by Spotify Beta Docs
39+
/// </summary>
40+
/// <value></value>
2141
[BodyParam("position_ms")]
2242
public int? PositionMs { get; set; }
2343

2444
public class Offset
2545
{
46+
/// <summary>
47+
/// Undocumented by Spotify Beta Docs
48+
/// </summary>
49+
/// <value></value>
2650
[JsonProperty("uri", NullValueHandling = NullValueHandling.Ignore)]
2751
public string? Uri { get; set; }
2852

53+
/// <summary>
54+
/// Undocumented by Spotify Beta Docs
55+
/// </summary>
56+
/// <value></value>
2957
[JsonProperty("position", NullValueHandling = NullValueHandling.Ignore)]
3058
public int? Position { get; set; }
3159
}

‎SpotifyAPI.Web/Models/Request/PlayerSeekToRequest.cs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,32 @@ namespace SpotifyAPI.Web
22
{
33
public class PlayerSeekToRequest : RequestParams
44
{
5+
/// <summary>
6+
///
7+
/// </summary>
8+
/// <param name="positionMs">
9+
/// The position in milliseconds to seek to. Must be a positive number.
10+
/// Passing in a position that is greater than the length of the track will
11+
/// cause the player to start playing the next song.
12+
/// </param>
513
public PlayerSeekToRequest(long positionMs)
614
{
715
PositonMs = positionMs;
816
}
917

18+
/// <summary>
19+
/// The position in milliseconds to seek to. Must be a positive number.
20+
/// Passing in a position that is greater than the length of the track will cause
21+
/// the player to start playing the next song.
22+
/// </summary>
23+
/// <value></value>
1024
[QueryParam("position_ms")]
1125
public long PositonMs { get; }
1226

27+
/// <summary>
28+
/// The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
29+
/// </summary>
30+
/// <value></value>
1331
[QueryParam("device_id")]
1432
public string? DeviceId { get; set; }
1533
}

‎SpotifyAPI.Web/Models/Request/PlayerShuffleRequest.cs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,27 @@ namespace SpotifyAPI.Web
22
{
33
public class PlayerShuffleRequest : RequestParams
44
{
5+
/// <summary>
6+
///
7+
/// </summary>
8+
/// <param name="state">true : Shuffle user’s playback false : Do not shuffle user’s playback.</param>
59
public PlayerShuffleRequest(bool state)
610
{
711
State = state;
812
}
913

14+
/// <summary>
15+
/// true : Shuffle user’s playback false : Do not shuffle user’s playback.
16+
/// </summary>
17+
/// <value></value>
1018
[QueryParam("state")]
1119
public bool State { get; }
1220

21+
/// <summary>
22+
/// The id of the device this command is targeting. If not supplied,
23+
/// the user’s currently active device is the target.
24+
/// </summary>
25+
/// <value></value>
1326
[QueryParam("device_id")]
1427
public string? DeviceId { get; set; }
1528
}

‎SpotifyAPI.Web/Models/Request/PlayerSkipPreviousRequest.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ namespace SpotifyAPI.Web
22
{
33
public class PlayerSkipPreviousRequest : RequestParams
44
{
5+
/// <summary>
6+
/// The id of the device this command is targeting.
7+
/// If not supplied, the user’s currently active device is the target.
8+
/// </summary>
9+
/// <value></value>
510
[QueryParam("device_id")]
611
public string? DeviceId { get; set; }
712
}

‎SpotifyAPI.Web/Models/Request/PlayerVolumeRequest.cs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@ namespace SpotifyAPI.Web
22
{
33
public class PlayerVolumeRequest : RequestParams
44
{
5+
/// <summary>
6+
///
7+
/// </summary>
8+
/// <param name="volumePercent">The volume to set. Must be a value from 0 to 100 inclusive.</param>
59
public PlayerVolumeRequest(int volumePercent)
610
{
711
VolumePercent = volumePercent;
812
}
913

14+
/// <summary>
15+
/// The volume to set. Must be a value from 0 to 100 inclusive.
16+
/// </summary>
17+
/// <value></value>
1018
[QueryParam("volume_percent")]
1119
public int VolumePercent { get; }
1220

21+
/// <summary>
22+
/// The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
23+
/// </summary>
24+
/// <value></value>
1325
[QueryParam("device_id")]
1426
public string? DeviceId { get; set; }
1527
}

0 commit comments

Comments
 (0)