Skip to content

Commit e15a142

Browse files
authored
Merge pull request #45 from adamint/dev
v2.1.0
2 parents 3e91f5f + 8f17b6b commit e15a142

File tree

1,053 files changed

+14709
-728
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,053 files changed

+14709
-728
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
.idea/**/gradle.xml
3030
.idea/**/libraries
3131

32-
# Gradle and Maven with auto-import
33-
# When using Gradle or Maven with auto-import, you should exclude module files,
32+
# Gradle and Maven with auto-# When using Gradle or Maven with auto-import, you should exclude module files,
3433
# since they will be recreated, and may cause churn. Uncomment if using
3534
# auto-import.
3635
.idea/modules.xml

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ This library is available via Maven Central.
2222
<dependency>
2323
<groupId>com.adamratzman</groupId>
2424
<artifactId>spotify-api-kotlin</artifactId>
25-
<version>2.0.1</version>
25+
<version>2.1.0</version>
2626
</dependency>
2727
```
2828

2929
### Gradle
3030
```
31-
compile group: 'com.adamratzman', name: 'spotify-api-kotlin', version: '2.0.1'
31+
compile group: 'com.adamratzman', name: 'spotify-api-kotlin', version: '2.1.0'
3232
```
3333

3434
To use the latest snapshot instead, you must add the Jitpack repository
@@ -44,6 +44,10 @@ dependencies {
4444
}
4545
```
4646

47+
#### Android
48+
This library should work out of the box on Android.
49+
```
50+
4751
## Creating a SpotifyAPI or SpotifyClientAPI object
4852
In order to use the methods in this library, you must create either a `SpotifyAPI` or `SpotifyClientAPI` object using their respective exposed builders. Client-specific methods are unable to be accessed with the generic SpotifyAPI, rather you must create an instance of the Client API.
4953

build.gradle

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,46 @@
1+
buildscript {
2+
ext.kotlin_version = '1.3.11'
3+
ext.dokka_version = '0.9.17'
4+
5+
repositories { jcenter() }
6+
7+
dependencies {
8+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
9+
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
10+
}
11+
}
12+
13+
114
plugins {
215
id "com.diffplug.gradle.spotless" version "3.16.0"
316
id "base"
417
id "io.codearte.nexus-staging" version "0.12.0"
518
id "com.bmuschko.nexus" version "2.3.1"
6-
id "org.jetbrains.kotlin.jvm" version "1.3.11"
719
}
820

21+
apply plugin: 'kotlin'
22+
apply plugin: 'org.jetbrains.dokka'
23+
924
group 'com.adamratzman'
10-
version '2.0.1'
25+
version '2.1.0'
1126

1227
archivesBaseName = 'spotify-api-kotlin'
1328

1429
sourceCompatibility = 1.8
1530

1631
repositories {
1732
mavenCentral()
33+
jcenter()
1834
maven { url "https://dl.bintray.com/spekframework/spek" }
1935
}
2036

2137
dependencies {
2238
// Actual library dependencies
23-
implementation(group: 'org.json', name: 'json', version: '20180130')
24-
implementation("com.google.code.gson:gson:2.8.1")
25-
26-
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11"
27-
compile "org.jetbrains.kotlin:kotlin-reflect:1.3.11"
39+
implementation 'com.beust:klaxon:5.0.1'
2840

41+
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
42+
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
43+
2944
// Spek testing requirements
3045
testImplementation('org.spekframework.spek2:spek-dsl-jvm:2.0.0-rc.1') {
3146
exclude group: 'org.jetbrains.kotlin'
@@ -36,8 +51,24 @@ dependencies {
3651
}
3752

3853
testImplementation('org.junit.jupiter:junit-jupiter-api:5.2.0')
54+
testImplementation(group: 'org.json', name: 'json', version: '20180130')
3955
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
40-
testRuntimeOnly "org.jetbrains.kotlin:kotlin-reflect:1.3.11"
56+
57+
}
58+
59+
dokka {
60+
outputFormat = 'gfm'
61+
outputDirectory = 'docs/md'
62+
63+
jdkVersion = 8
64+
includeNonPublic = false
65+
impliedPlatforms = ["JVM"]
66+
67+
linkMapping {
68+
dir = "src/main/kotlin"
69+
url = "https://github.com/adamint/spotify-web-api-kotlin/tree/master/src/main/kotlin"
70+
suffix = "#L"
71+
}
4172
}
4273

4374
spotless {
@@ -47,7 +78,6 @@ spotless {
4778
}
4879
}
4980

50-
5181
test {
5282
systemProperties project.properties.subMap(
5383
["clientId", "clientSecret", "spotifyTokenString", "spotifyRedirectUri"]
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
3+
### All Types
4+
5+
| Name | Summary |
6+
|---|---|
7+
| [com.adamratzman.spotify.utils.AbstractPagingObject](../com.adamratzman.spotify.utils/-abstract-paging-object/index.md) | |
8+
| [com.adamratzman.spotify.utils.Album](../com.adamratzman.spotify.utils/-album/index.md) | |
9+
| [com.adamratzman.spotify.endpoints.public.AlbumAPI](../com.adamratzman.spotify.endpoints.public/-album-a-p-i/index.md) | Endpoints for retrieving information about one or more albums from the Spotify catalog. |
10+
| [com.adamratzman.spotify.utils.AlbumResultType](../com.adamratzman.spotify.utils/-album-result-type/index.md) | Album type |
11+
| [com.adamratzman.spotify.utils.AlbumURI](../com.adamratzman.spotify.utils/-album-u-r-i/index.md) | Represents a Spotify **Album** URI, parsed from either a Spotify ID or taken from an endpoint. |
12+
| [com.adamratzman.spotify.utils.Artist](../com.adamratzman.spotify.utils/-artist/index.md) | |
13+
| [com.adamratzman.spotify.utils.ArtistURI](../com.adamratzman.spotify.utils/-artist-u-r-i/index.md) | Represents a Spotify **Artist** URI, parsed from either a Spotify ID or taken from an endpoint. |
14+
| [com.adamratzman.spotify.endpoints.public.ArtistsAPI](../com.adamratzman.spotify.endpoints.public/-artists-a-p-i/index.md) | Endpoints for retrieving information about one or more artists from the Spotify catalog. |
15+
| [com.adamratzman.spotify.utils.AudioAnalysis](../com.adamratzman.spotify.utils/-audio-analysis/index.md) | |
16+
| [com.adamratzman.spotify.utils.AudioAnalysisMeta](../com.adamratzman.spotify.utils/-audio-analysis-meta/index.md) | |
17+
| [com.adamratzman.spotify.utils.AudioFeatures](../com.adamratzman.spotify.utils/-audio-features/index.md) | |
18+
| [com.adamratzman.spotify.utils.AudioSection](../com.adamratzman.spotify.utils/-audio-section/index.md) | |
19+
| [com.adamratzman.spotify.utils.AudioSegment](../com.adamratzman.spotify.utils/-audio-segment/index.md) | |
20+
| [com.adamratzman.spotify.utils.BadRequestException](../com.adamratzman.spotify.utils/-bad-request-exception/index.md) | |
21+
| [com.adamratzman.spotify.endpoints.public.BrowseAPI](../com.adamratzman.spotify.endpoints.public/-browse-a-p-i/index.md) | Endpoints for getting playlists and new album releases featured on Spotify’s Browse tab. |
22+
| [com.adamratzman.spotify.endpoints.client.ClientFollowingAPI](../com.adamratzman.spotify.endpoints.client/-client-following-a-p-i/index.md) | These endpoints allow you manage the artists, users and playlists that a Spotify user follows. |
23+
| [com.adamratzman.spotify.endpoints.client.ClientLibraryAPI](../com.adamratzman.spotify.endpoints.client/-client-library-a-p-i/index.md) | Endpoints for retrieving information about, and managing, tracks that the current user has saved in their “Your Music” library. |
24+
| [com.adamratzman.spotify.endpoints.client.ClientPersonalizationAPI](../com.adamratzman.spotify.endpoints.client/-client-personalization-a-p-i/index.md) | Endpoints for retrieving information about the user’s listening habits. |
25+
| [com.adamratzman.spotify.endpoints.client.ClientPlayerAPI](../com.adamratzman.spotify.endpoints.client/-client-player-a-p-i/index.md) | These endpoints allow for viewing and controlling user playback. Please view [the official documentation](https://developer.spotify.com/web-api/working-with-connect/) for more information on how this works. This is in beta and is available for **premium users only**. Endpoints are **not** guaranteed to work |
26+
| [com.adamratzman.spotify.endpoints.client.ClientPlaylistAPI](../com.adamratzman.spotify.endpoints.client/-client-playlist-a-p-i/index.md) | Endpoints for retrieving information about a user’s playlists and for managing a user’s playlists. |
27+
| [com.adamratzman.spotify.endpoints.client.ClientUserAPI](../com.adamratzman.spotify.endpoints.client/-client-user-a-p-i/index.md) | Endpoints for retrieving information about a user’s profile. |
28+
| [com.adamratzman.spotify.utils.Context](../com.adamratzman.spotify.utils/-context/index.md) | |
29+
| [com.adamratzman.spotify.utils.CurrentlyPlayingContext](../com.adamratzman.spotify.utils/-currently-playing-context/index.md) | |
30+
| [com.adamratzman.spotify.utils.CurrentlyPlayingObject](../com.adamratzman.spotify.utils/-currently-playing-object/index.md) | |
31+
| [com.adamratzman.spotify.utils.Cursor](../com.adamratzman.spotify.utils/-cursor/index.md) | The cursor to use as key to find the next page of items. |
32+
| [com.adamratzman.spotify.utils.CursorBasedPagingObject](../com.adamratzman.spotify.utils/-cursor-based-paging-object/index.md) | The cursor-based paging object is a container for a set of objects. It contains a key called items (whose value is an array of the requested objects) along with other keys like next and cursors that can be useful in future calls. |
33+
| [com.adamratzman.spotify.utils.Device](../com.adamratzman.spotify.utils/-device/index.md) | |
34+
| [com.adamratzman.spotify.utils.ErrorObject](../com.adamratzman.spotify.utils/-error-object/index.md) | Contains a parsed error from Spotify |
35+
| [com.adamratzman.spotify.utils.ErrorResponse](../com.adamratzman.spotify.utils/-error-response/index.md) | Wrapper around [ErrorObject](../com.adamratzman.spotify.utils/-error-object/index.md) |
36+
| [com.adamratzman.spotify.utils.FeaturedPlaylists](../com.adamratzman.spotify.utils/-featured-playlists/index.md) | Spotify featured playlists (on the Browse tab) |
37+
| [com.adamratzman.spotify.utils.Followers](../com.adamratzman.spotify.utils/-followers/index.md) | Spotify user's followers |
38+
| [com.adamratzman.spotify.endpoints.public.FollowingAPI](../com.adamratzman.spotify.endpoints.public/-following-a-p-i/index.md) | This endpoint allow you check the playlists that a Spotify user follows. |
39+
| [com.adamratzman.spotify.endpoints.client.LibraryType](../com.adamratzman.spotify.endpoints.client/-library-type/index.md) | Type of object in a user's Spotify library |
40+
| [com.adamratzman.spotify.utils.Linkable](../com.adamratzman.spotify.utils/-linkable/index.md) | Allow for track relinking |
41+
| [com.adamratzman.spotify.utils.LinkedTrack](../com.adamratzman.spotify.utils/-linked-track/index.md) | Represents a [relinked track](https://github.com/adamint/spotify-web-api-kotlin/blob/master/README.md#track-relinking). This is playable in the searched market. If null, the API result is playable in the market. |
42+
| [com.adamratzman.spotify.utils.Market](../com.adamratzman.spotify.utils/-market/index.md) | Represents Spotify markets (countries + distinctive territories) |
43+
| [com.adamratzman.spotify.utils.PagingObject](../com.adamratzman.spotify.utils/-paging-object/index.md) | The offset-based paging object is a container for a set of objects. It contains a key called items (whose value is an array of the requested objects) along with other keys like previous, next and limit that can be useful in future calls. |
44+
| [com.adamratzman.spotify.utils.PagingTraversalType](../com.adamratzman.spotify.utils/-paging-traversal-type/index.md) | |
45+
| [com.adamratzman.spotify.utils.PlayHistory](../com.adamratzman.spotify.utils/-play-history/index.md) | |
46+
| [com.adamratzman.spotify.utils.PlayHistoryContext](../com.adamratzman.spotify.utils/-play-history-context/index.md) | |
47+
| [com.adamratzman.spotify.utils.Playlist](../com.adamratzman.spotify.utils/-playlist/index.md) | |
48+
| [com.adamratzman.spotify.utils.PlaylistTrack](../com.adamratzman.spotify.utils/-playlist-track/index.md) | |
49+
| [com.adamratzman.spotify.utils.PlaylistTrackInfo](../com.adamratzman.spotify.utils/-playlist-track-info/index.md) | A collection containing a link ( href ) to the Web API endpoint where full details of the playlist’s tracks can be retrieved, along with the total number of tracks in the playlist. |
50+
| [com.adamratzman.spotify.utils.PlaylistURI](../com.adamratzman.spotify.utils/-playlist-u-r-i/index.md) | Represents a Spotify **Playlist** URI, parsed from either a Spotify ID or taken from an endpoint. |
51+
| [com.adamratzman.spotify.endpoints.public.PlaylistsAPI](../com.adamratzman.spotify.endpoints.public/-playlists-a-p-i/index.md) | Endpoints for retrieving information about a user’s playlists |
52+
| [com.adamratzman.spotify.utils.RecommendationResponse](../com.adamratzman.spotify.utils/-recommendation-response/index.md) | |
53+
| [com.adamratzman.spotify.utils.RecommendationSeed](../com.adamratzman.spotify.utils/-recommendation-seed/index.md) | Seed from which the recommendation was constructed |
54+
| [com.adamratzman.spotify.utils.RelinkingAvailableResponse](../com.adamratzman.spotify.utils/-relinking-available-response/index.md) | |
55+
| [com.adamratzman.spotify.utils.Restrictions](../com.adamratzman.spotify.utils/-restrictions/index.md) | Contains an explanation of why a track is not available |
56+
| [com.adamratzman.spotify.utils.SavedAlbum](../com.adamratzman.spotify.utils/-saved-album/index.md) | |
57+
| [com.adamratzman.spotify.utils.SavedTrack](../com.adamratzman.spotify.utils/-saved-track/index.md) | |
58+
| [com.adamratzman.spotify.endpoints.public.SearchAPI](../com.adamratzman.spotify.endpoints.public/-search-a-p-i/index.md) | Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string. |
59+
| [com.adamratzman.spotify.utils.SimpleAlbum](../com.adamratzman.spotify.utils/-simple-album/index.md) | |
60+
| [com.adamratzman.spotify.utils.SimpleArtist](../com.adamratzman.spotify.utils/-simple-artist/index.md) | |
61+
| [com.adamratzman.spotify.utils.SimplePlaylist](../com.adamratzman.spotify.utils/-simple-playlist/index.md) | |
62+
| [com.adamratzman.spotify.utils.SimpleTrack](../com.adamratzman.spotify.utils/-simple-track/index.md) | |
63+
| [com.adamratzman.spotify.main.SpotifyAPI](../com.adamratzman.spotify.main/-spotify-a-p-i/index.md) | |
64+
| [com.adamratzman.spotify.main.SpotifyApiBuilder](../com.adamratzman.spotify.main/-spotify-api-builder/index.md) | |
65+
| [com.adamratzman.spotify.main.SpotifyApiBuilderJava](../com.adamratzman.spotify.main/-spotify-api-builder-java/index.md) | |
66+
| [com.adamratzman.spotify.main.SpotifyAppAPI](../com.adamratzman.spotify.main/-spotify-app-a-p-i/index.md) | |
67+
| [com.adamratzman.spotify.utils.SpotifyCategory](../com.adamratzman.spotify.utils/-spotify-category/index.md) | Spotify music category |
68+
| [com.adamratzman.spotify.main.SpotifyClientAPI](../com.adamratzman.spotify.main/-spotify-client-a-p-i/index.md) | |
69+
| [com.adamratzman.spotify.utils.SpotifyCopyright](../com.adamratzman.spotify.utils/-spotify-copyright/index.md) | Describes an album's copyright |
70+
| [com.adamratzman.spotify.main.SpotifyCredentials](../com.adamratzman.spotify.main/-spotify-credentials/index.md) | |
71+
| [com.adamratzman.spotify.main.SpotifyCredentialsBuilder](../com.adamratzman.spotify.main/-spotify-credentials-builder/index.md) | |
72+
| [com.adamratzman.spotify.utils.SpotifyEndpoint](../com.adamratzman.spotify.utils/-spotify-endpoint/index.md) | |
73+
| [com.adamratzman.spotify.main.SpotifyException](../com.adamratzman.spotify.main/-spotify-exception/index.md) | |
74+
| [com.adamratzman.spotify.utils.SpotifyImage](../com.adamratzman.spotify.utils/-spotify-image/index.md) | A Spotify image |
75+
| [com.adamratzman.spotify.main.SpotifyLogger](../com.adamratzman.spotify.main/-spotify-logger/index.md) | |
76+
| [com.adamratzman.spotify.utils.SpotifyPublicUser](../com.adamratzman.spotify.utils/-spotify-public-user/index.md) | |
77+
| [com.adamratzman.spotify.main.SpotifyRestAction](../com.adamratzman.spotify.main/-spotify-rest-action/index.md) | |
78+
| [com.adamratzman.spotify.main.SpotifyRestActionPaging](../com.adamratzman.spotify.main/-spotify-rest-action-paging/index.md) | |
79+
| [com.adamratzman.spotify.main.SpotifyScope](../com.adamratzman.spotify.main/-spotify-scope/index.md) | |
80+
| [com.adamratzman.spotify.endpoints.client.SpotifyTrackPositions](../com.adamratzman.spotify.endpoints.client/-spotify-track-positions/index.md) | Represents the positions inside a playlist's items list of where to locate the track |
81+
| [com.adamratzman.spotify.utils.SpotifyUri](../com.adamratzman.spotify.utils/-spotify-uri/index.md) | Represents a Spotify URI, parsed from either a Spotify ID or taken from an endpoint. |
82+
| [com.adamratzman.spotify.utils.SpotifyUriException](../com.adamratzman.spotify.utils/-spotify-uri-exception/index.md) | |
83+
| [com.adamratzman.spotify.main.SpotifyUserAuthorizationBuilder](../com.adamratzman.spotify.main/-spotify-user-authorization-builder/index.md) | Authentication methods. |
84+
| [com.adamratzman.spotify.utils.SpotifyUserInformation](../com.adamratzman.spotify.utils/-spotify-user-information/index.md) | |
85+
| [com.adamratzman.spotify.utils.TimeInterval](../com.adamratzman.spotify.utils/-time-interval/index.md) | |
86+
| [com.adamratzman.spotify.utils.Token](../com.adamratzman.spotify.utils/-token/index.md) | Represents a Spotify Token, retrieved through instantiating a new [SpotifyAPI](#) |
87+
| [com.adamratzman.spotify.utils.Track](../com.adamratzman.spotify.utils/-track/index.md) | |
88+
| [com.adamratzman.spotify.utils.TrackAnalysis](../com.adamratzman.spotify.utils/-track-analysis/index.md) | |
89+
| [com.adamratzman.spotify.utils.TrackURI](../com.adamratzman.spotify.utils/-track-u-r-i/index.md) | Represents a Spotify **Track** URI, parsed from either a Spotify ID or taken from an endpoint. |
90+
| [com.adamratzman.spotify.endpoints.public.TracksAPI](../com.adamratzman.spotify.endpoints.public/-tracks-a-p-i/index.md) | Endpoints for retrieving information about one or more tracks from the Spotify catalog. |
91+
| [com.adamratzman.spotify.endpoints.public.TuneableTrackAttribute](../com.adamratzman.spotify.endpoints.public/-tuneable-track-attribute/index.md) | Describes a track attribute |
92+
| [com.adamratzman.spotify.endpoints.public.UserAPI](../com.adamratzman.spotify.endpoints.public/-user-a-p-i/index.md) | Endpoints for retrieving information about a user’s profile. |
93+
| [com.adamratzman.spotify.utils.UserURI](../com.adamratzman.spotify.utils/-user-u-r-i/index.md) | Represents a Spotify **User** URI, parsed from either a Spotify ID or taken from an endpoint. |
94+
| [com.adamratzman.spotify.utils.VideoThumbnail](../com.adamratzman.spotify.utils/-video-thumbnail/index.md) | |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[SpotifyKotlinWrapper](../../index.md) / [com.adamratzman.spotify.endpoints.client](../index.md) / [ClientFollowingAPI](index.md) / [&lt;init&gt;](./-init-.md)
2+
3+
# &lt;init&gt;
4+
5+
`ClientFollowingAPI(api: `[`SpotifyAPI`](../../com.adamratzman.spotify.main/-spotify-a-p-i/index.md)`)`
6+
7+
These endpoints allow you manage the artists, users and playlists that a Spotify user follows.
8+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[SpotifyKotlinWrapper](../../index.md) / [com.adamratzman.spotify.endpoints.client](../index.md) / [ClientFollowingAPI](index.md) / [followArtist](./follow-artist.md)
2+
3+
# followArtist
4+
5+
`fun followArtist(artistId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`SpotifyRestAction`](../../com.adamratzman.spotify.main/-spotify-rest-action/index.md)`<`[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`>`
6+
7+
Add the current user as a follower of an artist
8+
9+
### Exceptions
10+
11+
`BadRequestException` - if an invalid id is provided
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[SpotifyKotlinWrapper](../../index.md) / [com.adamratzman.spotify.endpoints.client](../index.md) / [ClientFollowingAPI](index.md) / [followArtists](./follow-artists.md)
2+
3+
# followArtists
4+
5+
`fun followArtists(vararg artists: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`SpotifyRestAction`](../../com.adamratzman.spotify.main/-spotify-rest-action/index.md)`<`[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`>`
6+
7+
Add the current user as a follower of other artists
8+
9+
### Exceptions
10+
11+
`BadRequestException` - if an invalid id is provided

0 commit comments

Comments
 (0)