@@ -38,9 +38,9 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
3838 *
3939 * @throws BadRequestException if [id] is not found
4040 */
41- fun doesLibraryContain (type : LibraryType , id : String ): SpotifyRestAction <Boolean > {
41+ fun contains (type : LibraryType , id : String ): SpotifyRestAction <Boolean > {
4242 return toAction(Supplier {
43- doesLibraryContain (type, ids = * arrayOf(id)).complete()[0 ]
43+ contains (type, ids = * arrayOf(id)).complete()[0 ]
4444 })
4545 }
4646
@@ -49,7 +49,7 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
4949 *
5050 * @throws BadRequestException if any of the provided ids is invalid
5151 */
52- fun doesLibraryContain (type : LibraryType , vararg ids : String ): SpotifyRestAction <List <Boolean >> {
52+ fun contains (type : LibraryType , vararg ids : String ): SpotifyRestAction <List <Boolean >> {
5353 return toAction(Supplier {
5454 get(EndpointBuilder (" /me/$type /contains" ).with (" ids" , ids.joinToString(" ," ) { it.encode() })
5555 .toString()).toObject<List <Boolean >>(api)
@@ -61,9 +61,9 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
6161 *
6262 * @throws BadRequestException if the id is invalid
6363 */
64- fun addToLibrary (type : LibraryType , id : String ): SpotifyRestAction <Unit > {
64+ fun add (type : LibraryType , id : String ): SpotifyRestAction <Unit > {
6565 return toAction(Supplier {
66- addToLibrary (type, ids = * arrayOf(id)).complete()
66+ add (type, ids = * arrayOf(id)).complete()
6767 })
6868 }
6969
@@ -72,7 +72,7 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
7272 *
7373 * @throws BadRequestException if any of the provided ids is invalid
7474 */
75- fun addToLibrary (type : LibraryType , vararg ids : String ): SpotifyRestAction <Unit > {
75+ fun add (type : LibraryType , vararg ids : String ): SpotifyRestAction <Unit > {
7676 return toAction(Supplier {
7777 put(EndpointBuilder (" /me/$type " ).with (" ids" , ids.joinToString(" ," ) { it.encode() }).toString())
7878 Unit
@@ -84,9 +84,9 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
8484 *
8585 * @throws BadRequestException if any of the provided ids is invalid
8686 */
87- fun removeFromLibrary (type : LibraryType , id : String ): SpotifyRestAction <Unit > {
87+ fun remove (type : LibraryType , id : String ): SpotifyRestAction <Unit > {
8888 return toAction(Supplier {
89- removeFromLibrary (type, ids = * arrayOf(id)).complete()
89+ remove (type, ids = * arrayOf(id)).complete()
9090 })
9191 }
9292
@@ -95,16 +95,16 @@ class ClientLibraryAPI(api: SpotifyAPI) : SpotifyEndpoint(api) {
9595 *
9696 * @throws BadRequestException if any of the provided ids is invalid
9797 */
98- fun removeFromLibrary (type : LibraryType , vararg ids : String ): SpotifyRestAction <Unit > {
98+ fun remove (type : LibraryType , vararg ids : String ): SpotifyRestAction <Unit > {
9999 return toAction(Supplier {
100100 delete(EndpointBuilder (" /me/$type " ).with (" ids" , ids.joinToString(" ," ) { it.encode() }).toString())
101101 Unit
102102 })
103103 }
104+ }
104105
105- enum class LibraryType (private val value : String ) {
106- TRACK (" tracks" ), ALBUM (" albums" );
106+ enum class LibraryType (private val value : String ) {
107+ TRACK (" tracks" ), ALBUM (" albums" );
107108
108- override fun toString () = value
109- }
109+ override fun toString () = value
110110}
0 commit comments