Skip to content

Commit d98d06e

Browse files
committed
fix existing documentation errors
Signed-off-by: Adam Ratzman <adam@adamratzman.com>
1 parent 7a5a793 commit d98d06e

File tree

17 files changed

+166
-110
lines changed

17 files changed

+166
-110
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
}
2020

2121
apply plugin: 'kotlin'
22-
apply plugin: 'org.jeaddtbrains.dokka'
22+
apply plugin: 'org.jetbrains.dokka'
2323

2424
group 'com.adamratzman'
2525
version '2.1.0'

src/main/kotlin/com/adamratzman/spotify/endpoints/client/ClientFollowingAPI.kt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
2424
/**
2525
* Check to see if the current user is following another Spotify users.
2626
*
27-
* @param user Spotify ID to check.
27+
* @param user user id or uri to check.
2828
*
29-
* @throws BadRequestException if [userId] is a non-existing id
29+
* @throws BadRequestException if [user] is a non-existing id
3030
*/
3131
fun isFollowingUser(user: String): SpotifyRestAction<Boolean> {
3232
return toAction(Supplier {
@@ -37,8 +37,8 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
3737
/**
3838
* Check to see if the logged-in Spotify user is following the specified playlist.
3939
*
40-
* @param playlistOwner Spotify ID of the creator of the playlist
41-
* @param playlistId Spotify playlist ID
40+
* @param playlistOwner id or uri of the creator of the playlist
41+
* @param playlistId playlist id or uri
4242
*
4343
* @return booleans representing whether the user follows the playlist. User IDs **not** found will return false
4444
*
@@ -59,7 +59,7 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
5959
*
6060
* @param users List of the user Spotify IDs to check. Max 50
6161
*
62-
* @throws BadRequestException if [userIds] contains a non-existing id
62+
* @throws BadRequestException if [users] contains a non-existing id
6363
*/
6464
fun isFollowingUsers(vararg users: String): SpotifyRestAction<List<Boolean>> {
6565
return toAction(Supplier {
@@ -73,9 +73,9 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
7373
/**
7474
* Check to see if the current user is following a Spotify artist.
7575
*
76-
* @param artistId Spotify ID to check.
76+
* @param artist artist id to check.
7777
*
78-
* @throws BadRequestException if [artistId] is a non-existing id
78+
* @throws BadRequestException if [artist] is a non-existing id
7979
*/
8080
fun isFollowingArtist(artist: String): SpotifyRestAction<Boolean> {
8181
return toAction(Supplier {
@@ -86,9 +86,9 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
8686
/**
8787
* Check to see if the current user is following one or more artists.
8888
*
89-
* @param artistIds List of the artist Spotify IDs to check. Max 50
89+
* @param artists List of the artist ids or uris to check. Max 50
9090
*
91-
* @throws BadRequestException if [artistIds] contains a non-existing id
91+
* @throws BadRequestException if [artists] contains a non-existing id
9292
*/
9393
fun isFollowingArtists(vararg artists: String): SpotifyRestAction<List<Boolean>> {
9494
return toAction(Supplier {
@@ -174,7 +174,7 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
174174
/**
175175
* Add the current user as a follower of a playlist.
176176
*
177-
* @param playlist The Spotify ID of the playlist. Any playlist can be followed, regardless of its
177+
* @param playlist the spotify id or uri of the playlist. Any playlist can be followed, regardless of its
178178
* public/private status, as long as you know its playlist ID.
179179
* @param followPublicly Defaults to true. If true the playlist will be included in user’s public playlists,
180180
* if false it will remain private. To be able to follow playlists privately, the user must have granted the playlist-modify-private scope.
@@ -196,7 +196,7 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
196196
*
197197
* @param user The user to be unfollowed from
198198
*
199-
* @throws BadRequestException if [userId] is not found
199+
* @throws BadRequestException if [user] is not found
200200
*/
201201
fun unfollowUser(user: String): SpotifyRestAction<Unit> {
202202
return toAction(Supplier {
@@ -224,7 +224,7 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
224224
/**
225225
* Remove the current user as a follower of an artist
226226
*
227-
* @param artistId The artist to be unfollowed from
227+
* @param artist The artist to be unfollowed from
228228
*
229229
* @throws BadRequestException if an invalid id is provided
230230
*/
@@ -237,7 +237,7 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
237237
/**
238238
* Remove the current user as a follower of artists
239239
*
240-
* @param artistIds The artists to be unfollowed from
240+
* @param artists The artists to be unfollowed from
241241
*
242242
* @throws BadRequestException if an invalid id is provided
243243
*/
@@ -254,7 +254,7 @@ class ClientFollowingAPI(api: SpotifyAPI) : FollowingAPI(api) {
254254
/**
255255
* Remove the current user as a follower of a playlist.
256256
*
257-
* @param playlistId The Spotify ID of the playlist that is to be no longer followed.
257+
* @param playlist the spotify id or uri of the playlist that is to be no longer followed.
258258
*
259259
* @throws BadRequestException if the playlist is not found
260260
*/

src/main/kotlin/com/adamratzman/spotify/endpoints/client/ClientLibraryAPI.kt

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
2424
/**
2525
* Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library.
2626
*
27+
* @param limit The number of objects to return. Default: 20. Minimum: 1. Maximum: 50.
28+
* @param offset The index of the first item to return. Default: 0. Use with limit to get the next set of items
29+
* @param market Provide this parameter if you want the list of returned items to be relevant to a particular country.
30+
* If omitted, the returned items will be relevant to all countries.
31+
*
2732
* @return Paging Object of [SavedTrack] ordered by position in library
2833
*/
2934
fun getSavedTracks(
@@ -42,6 +47,11 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
4247
/**
4348
* Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
4449
*
50+
* @param limit The number of objects to return. Default: 20. Minimum: 1. Maximum: 50.
51+
* @param offset The index of the first item to return. Default: 0. Use with limit to get the next set of items
52+
* @param market Provide this parameter if you want the list of returned items to be relevant to a particular country.
53+
* If omitted, the returned items will be relevant to all countries.
54+
*
4555
* @return Paging Object of [SavedAlbum] ordered by position in library
4656
*/
4757
fun getSavedAlbums(
@@ -60,7 +70,10 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
6070
/**
6171
* Check if the [LibraryType] with id [id] is already saved in the current Spotify user’s ‘Your Music’ library.
6272
*
63-
* @throws BadRequestException if [track] is not found
73+
* @param type the type of object (album or track)
74+
* @param id the spotify id or uri of the object
75+
*
76+
* @throws BadRequestException if [id] is not found
6477
*/
6578
fun contains(type: LibraryType, id: String): SpotifyRestAction<Boolean> {
6679
return toAction(Supplier {
@@ -71,6 +84,9 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
7184
/**
7285
* Check if one or more of [LibraryType] is already saved in the current Spotify user’s ‘Your Music’ library.
7386
*
87+
* @param type the type of objects (album or track)
88+
* @param ids the spotify ids or uris of the objects
89+
*
7490
* @throws BadRequestException if any of the provided ids is invalid
7591
*/
7692
fun contains(type: LibraryType, vararg ids: String): SpotifyRestAction<List<Boolean>> {
@@ -85,6 +101,9 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
85101
/**
86102
* Save one of [LibraryType] to the current user’s ‘Your Music’ library.
87103
*
104+
* @param type the type of object (album or track)
105+
* @param id the spotify id or uri of the object
106+
*
88107
* @throws BadRequestException if the id is invalid
89108
*/
90109
fun add(type: LibraryType, id: String): SpotifyRestAction<Unit> {
@@ -96,6 +115,9 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
96115
/**
97116
* Save one or more of [LibraryType] to the current user’s ‘Your Music’ library.
98117
*
118+
* @param type the type of objects to check against (album or track)
119+
* @param ids the spotify ids or uris of the objects
120+
*
99121
* @throws BadRequestException if any of the provided ids is invalid
100122
*/
101123
fun add(type: LibraryType, vararg ids: String): SpotifyRestAction<Unit> {
@@ -108,6 +130,9 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
108130
/**
109131
* Remove one of [LibraryType] (track or album) from the current user’s ‘Your Music’ library.
110132
*
133+
* @param type the type of object to check against (album or track)
134+
* @param id the spotify id or uri of the object
135+
*
111136
* @throws BadRequestException if any of the provided ids is invalid
112137
*/
113138
fun remove(type: LibraryType, id: String): SpotifyRestAction<Unit> {
@@ -119,6 +144,9 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
119144
/**
120145
* Remove one or more of the [LibraryType] (tracks or albums) from the current user’s ‘Your Music’ library.
121146
*
147+
* @param type the type of objects to check against (album or track)
148+
* @param ids the spotify ids or uris of the objects
149+
*
122150
* @throws BadRequestException if any of the provided ids is invalid
123151
*/
124152
fun remove(type: LibraryType, vararg ids: String): SpotifyRestAction<Unit> {
@@ -129,6 +157,12 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
129157
}
130158
}
131159

160+
/**
161+
* Type of object in a user's Spotify library
162+
*
163+
* @param value Spotify id for the type
164+
* @param id how to transform an id (or uri) input into its Spotify id
165+
*/
132166
enum class LibraryType(private val value: String, internal val id: (String) -> String) {
133167
TRACK("tracks", { TrackURI(it).id }), ALBUM("albums", { AlbumURI(it).id });
134168

src/main/kotlin/com/adamratzman/spotify/endpoints/client/ClientPersonalizationAPI.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ import java.util.function.Supplier
1515
* Endpoints for retrieving information about the user’s listening habits.
1616
*/
1717
class ClientPersonalizationAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
18+
/**
19+
* The time frame for which attribute affinities are computed.
20+
*
21+
* @param id the Spotify id of the time frame
22+
*/
1823
enum class TimeRange(val id: String) {
1924
LONG_TERM("long_term"), MEDIUM_TERM("medium_term"), SHORT_TERM("short_term");
2025

@@ -31,6 +36,10 @@ class ClientPersonalizationAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
3136
* for each user. In the future, it is likely that this restriction will be relaxed. This data is typically updated
3237
* once each day for each user.
3338
*
39+
* @param limit The number of objects to return. Default: 20. Minimum: 1. Maximum: 50.
40+
* @param offset The index of the first item to return. Default: 0. Use with limit to get the next set of items
41+
* @param timeRange the time range to which to compute this. The default is [TimeRange.MEDIUM_TERM]
42+
*
3443
* @return [PagingObject] of full [Artist] objects sorted by affinity
3544
*/
3645
fun getTopArtists(
@@ -57,6 +66,10 @@ class ClientPersonalizationAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
5766
* for each user. In the future, it is likely that this restriction will be relaxed. This data is typically updated
5867
* once each day for each user.
5968
*
69+
* @param limit The number of objects to return. Default: 20. Minimum: 1. Maximum: 50.
70+
* @param offset The index of the first item to return. Default: 0. Use with limit to get the next set of items
71+
* @param timeRange the time range to which to compute this. The default is [TimeRange.MEDIUM_TERM]
72+
*
6073
* @return [PagingObject] of full [Track] objects sorted by affinity
6174
*/
6275
fun getTopTracks(

src/main/kotlin/com/adamratzman/spotify/endpoints/client/ClientPlayerAPI.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,20 @@ class ClientPlayerAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
127127

128128
/**
129129
* Start or resume playback.
130-
* **Note:** Only one of the following can be used: [albumId], [artistId], [playlist], or [tracksToPlay]. Else, you will
130+
* **Note:** Only one of the following can be used: [album], [artist], [playlist], or [tracksToPlay]. Else, you will
131131
* not see expected results.
132132
*
133133
* **Note also:** You can only use one of the following: [offsetNum] or [offsetTrackId]
134134
*
135135
* **Specify nothing to play to simply resume playback**
136136
*
137-
* @param albumId an album id to play
138-
* @param artistId an artist id for whom to play
139-
* @param playlist a playlist id from which to play
140-
* @param tracksToPlay track ids to play. these are converted into URIs. Max 100
141-
* @param offsetNum Indicates from where in the context playback should start. Only available with use of [albumId] or [playlist]
137+
* @param album an album id or uri to play
138+
* @param artist an artist id or uri for whom to play
139+
* @param playlist a playlist id or uri from which to play
140+
* @param tracksToPlay track ids or uris to play. these are converted into URIs. Max 100
141+
* @param offsetNum Indicates from where in the context playback should start. Only available with use of [album] or [playlist]
142142
* or when [tracksToPlay] is used.
143-
* @param offsetTrackId Does the same as [offsetNum] but with a track id instead of place number
143+
* @param offsetTrackId Does the same as [offsetNum] but with a track id or uri instead of place number
144144
* @param deviceId the device to play on
145145
*
146146
* @throws BadRequestException if more than one type of play type is specified or the offset is illegal.

0 commit comments

Comments
 (0)