Skip to content

Commit 7c64ada

Browse files
committed
Final update of files
1 parent 053f173 commit 7c64ada

File tree

8 files changed

+91
-60
lines changed

8 files changed

+91
-60
lines changed

README.md

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ and executing it with your spotifyClient `executeRequest`
4242
Example:
4343

4444
```java
45-
public static void main(String[]args){
46-
SpotifyClient spotifyClient=new SpotifyClientBuilder("CLIENT_ID","CLIENT_SECRET","REDIRECT_URL")
47-
.getBuiltClient();
48-
TrackGet trackGet=new TrackGet("Track_id");
49-
SpotifyResponse response=spotifyClient.executeRequest(trackGet);
50-
JSONObject jsonObject=response.getJsonObject();
51-
System.out.println(jsonObject.toString());
52-
}
45+
public static void main(String[] args){
46+
SpotifyClient spotifyClient = new SpotifyClientBuilder("CLIENT_ID", "CLIENT_SECRET", "REDIRECT_URL").getBuiltClient();
47+
TrackGet trackGet = new TrackGet("Track_id");
48+
SpotifyResponse response = spotifyClient.executeRequest(trackGet);
49+
JSONObject jsonObject = response.getJsonObject();
50+
System.out.println(jsonObject.toString());
51+
}
5352
```
5453

5554
Returns a `SpotifyResponse` that encapsulates the json response from the spotify api
@@ -61,9 +60,9 @@ All Json classes were taken from https://github.com/tdunning/open-json with only
6160
<details open>
6261
<summary><strong><u>Album:</u></strong></summary>
6362

64-
- **AlbumGet** ([api.spotify.com/v1/albums/{id}](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-album))
63+
- AlbumGet ([api.spotify.com/v1/albums/{id}](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-album))
6564
- AlbumTracksGet ([api.spotify.com/v1/albums/{id}/tracks](https://developer.spoify.com/documentation/web-api/reference/#/operations/get-an-albums-tracks))
66-
- **SeveralAlbumsGet** ([api.spotify.com/v1/albums](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-multiple-albums))
65+
- SeveralAlbumsGet ([api.spotify.com/v1/albums](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-multiple-albums))
6766

6867
</details>
6968
<br>
@@ -79,96 +78,94 @@ All Json classes were taken from https://github.com/tdunning/open-json with only
7978
</details>
8079
<br>
8180
<details open>
82-
<summary><strong><u>Audiobooks</u></strong></summary>
81+
<summary><strong><u>Audiobooks:</u></strong></summary>
8382

84-
- AudiobookGet
85-
- SeveralAudioBooksGet
83+
- AudiobookGet ([api.spotify.com/v1/audiobooks/{id}](https://developer.spotify.com/documentation/web-api/reference/get-an-audiobook))
84+
- SeveralAudioBooksGet ([api.spotify.com/v1/audiobooks/](https://developer.spotify.com/documentation/web-api/reference/get-multiple-audiobooks))
85+
- AudiobookChaptersGet ([api.spotify.com/v1/audiobooks/{id}/chapters](https://developer.spotify.com/documentation/web-api/reference/get-audiobook-chapters))
8686

8787
</details>
8888
<br>
8989
<details open>
90-
<summary><strong><u>Chapters</u></strong></summary>
90+
<summary><strong><u>Categories:</u></strong></summary>
9191

92-
- ChapterGet
93-
- SeveralChaptersGet
92+
- CategoriesGet ([api.spotify.com/v1/browse/categories/{category_id}](https://developer.spotify.com/documentation/web-api/reference/get-a-category))
93+
- SeveralCategoriesGet ([api.spotify.com/v1/browse/categories](https://developer.spotify.com/documentation/web-api/reference/get-categories))
9494

9595
</details>
9696
<br>
9797
<details open>
98-
<summary><strong><u>Categories</u></strong></summary>
98+
<summary><strong><u>Chapters:</u></strong></summary>
9999

100-
- SeveralCategoriesGet
101-
- SingleCategoriesGet
100+
- ChapterGet ([api.spotify.com/v1/chapters/{id}](https://developer.spotify.com/documentation/web-api/reference/get-a-chapter))
101+
- SeveralChaptersGet ([api.spotify.com/v1/chapters](https://developer.spotify.com/documentation/web-api/reference/get-several-chapters))
102102

103103
</details>
104104
<br>
105105
<details open>
106-
<summary><strong><u>Episodes</u></strong></summary>
106+
<summary><strong><u>Episodes:</u></strong></summary>
107107

108-
- EpisodeGet
109-
- SeveralEpisodesGet
108+
- EpisodeGet ([api.spotify.com/v1/episodes/{id}](https://developer.spotify.com/documentation/web-api/reference/get-an-episode))
109+
- SeveralEpisodesGet ([api.spotify.com/v1/episodes](https://developer.spotify.com/documentation/web-api/reference/get-multiple-episodes))
110110

111111
</details>
112112
<br>
113113
<details open>
114-
<summary><strong><u>Genres</u></strong></summary>
114+
<summary><strong><u>Genres:</u></strong></summary>
115115

116-
- GenreAvailableGet
116+
- GenreAvailableGet ([api.spotify.com/v1/recommendations/available-genre-seeds](https://developer.spotify.com/documentation/web-api/reference/get-recommendation-genres))
117117

118118
</details>
119119
<br>
120120
<details open>
121-
<summary><strong><u>Markets</u></strong></summary>
121+
<summary><strong><u>Markets:</u></strong></summary>
122122

123-
- MarketsAvailableGet
123+
- MarketsAvailableGet ([api.spotify.com/v1/markets](https://developer.spotify.com/documentation/web-api/reference/get-available-markets))
124124

125125
</details>
126126
<br>
127127
<details open>
128-
<summary><strong><u>Playlists</u></strong></summary>
128+
<summary><strong><u>Playlists:</u></strong></summary>
129129

130-
- CategoriesPlaylistsGet
131-
- FeaturedPlaylistGet
132-
- PlaylistGet
133-
- PlaylistImageGet
134-
- PlaylistTracksGet
130+
- PlaylistGet ([api.spotify.com/v1/playlists/{playlist_id}](https://developer.spotify.com/documentation/web-api/reference/get-playlist))
131+
- CategoriesPlaylistsGet ([api.spotify.com/v1/browse/categories/{category_id}/playlists](https://developer.spotify.com/documentation/web-api/reference/get-a-categories-playlists))
132+
- FeaturedPlaylistGet ([api.spotify.com/v1/browse/featured-playlists](https://developer.spotify.com/documentation/web-api/reference/get-featured-playlists))
133+
- PlaylistImageGet ([api.spotify.com/v1/playlists/{playlist_id}/images](https://developer.spotify.com/documentation/web-api/reference/get-playlist-cover))
134+
- PlaylistTracksGet [api.spotify.com/v1/playlists/{playlist_id}/tracks](https://developer.spotify.com/documentation/web-api/reference/get-playlists-tracks))
135135

136136
</details>
137137
<br>
138138
<details open>
139-
<summary><strong><u>Search</u></strong></summary>
139+
<summary><strong><u>Search:</u></strong></summary>
140140

141-
- **SearchGet**
141+
- SearchGet ([api.spotify.com/v1/search](https://developer.spotify.com/documentation/web-api/reference/search))
142142

143143
</details>
144144
<br>
145145
<details open>
146-
<summary><strong><u>Shows</u></strong></summary>
146+
<summary><strong><u>Shows:</u></strong></summary>
147+
148+
- ShowGet ([api.spotify.com/v1/shows/{id}](https://developer.spotify.com/documentation/web-api/reference/get-a-show))
149+
- SeveralShowsGet ([api.spotify.com/v1/shows](https://developer.spotify.com/documentation/web-api/reference/get-multiple-shows))
150+
- ShowEpisodesGet ([api.spotify.com/v1/shows/{id}/episodes](https://developer.spotify.com/documentation/web-api/reference/get-a-shows-episodes))
147151

148-
- SeveralShowsGet
149-
- ShowEpisodesGet
150-
- ShowGet
151152

152153
</details>
153154
<br>
154155
<details open>
155-
<summary><strong><u>Tracks</u></strong></summary>
156+
<summary><strong><u>Tracks:</u></strong></summary>
156157

157-
- **SeveralTrackAudioFeaturesGet** ([api.spotify.com/audio-features](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-several-audio-features))
158-
- **SeveralTracksGet** ([api.spotify.com/tracks](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-several-tracks))
159-
- **TrackAudioAnalysisGet** ([api.spotify.com/audio-analysis/{id}](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-analysis))
160-
- **TrackAudioFeaturesGet** ([api.spotify.com/audio-features/{id}](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-features))
161-
- **TrackGet** ([api.spotify.com/tracks/{id}](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-track))
162-
- **TrackRecommendationGet** ([api.spotify.com/recommendations](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-recommendations))
158+
- SeveralTrackAudioFeaturesGet ([api.spotify.com/audio-features](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-several-audio-features))
159+
- SeveralTracksGet ([api.spotify.com/tracks](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-several-tracks))
160+
- TrackAudioAnalysisGet ([api.spotify.com/audio-analysis/{id}](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-analysis))
161+
- TrackAudioFeaturesGet ([api.spotify.com/audio-features/{id}](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-audio-features))
162+
- TrackGet ([api.spotify.com/tracks/{id}](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-track))
163+
- TrackRecommendationGet ([api.spotify.com/recommendations](https://developer.spotify.com/documentation/web-api/reference/#/operations/get-recommendations))
163164

164165
</details>
165166

166-
(<b>bold</b> items are able to be serialized into the respective classes)
167-
168167
### <u>Future Plans</u>
169168
- Implement the remainder of api request
170-
- Completely finish writing the spotify objects
171-
- Rewrite how requests classes are written (annotations)
172169
- Bring back Spring support for handling user authentication
173170
- Add more branches of api requests not just web api
174171
- Optimise multiple call different threads

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>com.spotstat</groupId>
99
<artifactId>S4J</artifactId>
10-
<version>1.0.0-SNAPSHOT</version>
10+
<version>1.0.0</version>
1111

1212
<properties>
1313
<maven.compiler.source>17</maven.compiler.source>

src/main/java/com/spotify/objects/categories/Category.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
import com.spotify.objects.SpotifyObject;
55
import com.spotify.objects.search.AbstractSearchItems;
66
import com.spotify.objects.wrappers.SpotifyImage;
7-
import com.spotify.requests.categories.SingleCategoriesGet;
7+
import com.spotify.requests.categories.CategoriesGet;
88
import lombok.Getter;
99
import lombok.Setter;
1010

1111
/**
1212
* Represents spotify category<br>
1313
* Serialized from <a href="https://developer.spotify.com/documentation/web-api/reference/get-a-category">SingleCategoriesGet</a>
1414
*
15-
* @see SingleCategoriesGet
15+
* @see CategoriesGet
1616
* @see AbstractSearchItems
1717
* @see SpotifyObject
1818
*/

src/main/java/com/spotify/requests/categories/SingleCategoriesGet.java renamed to src/main/java/com/spotify/requests/categories/CategoriesGet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@Setter
2525
@SpotifyRequest("browse/categories")
2626
@SpotifySerialize(Category.class)
27-
public class SingleCategoriesGet implements SpotifyRequestVariant {
27+
public class CategoriesGet implements SpotifyRequestVariant {
2828

2929

3030
/**
@@ -46,10 +46,10 @@ public class SingleCategoriesGet implements SpotifyRequestVariant {
4646
private String locale;
4747

4848
/**
49-
* Initializes the {@link SingleCategoriesGet} request
49+
* Initializes the {@link CategoriesGet} request
5050
* @param id The Spotify category ID for the category.
5151
*/
52-
public SingleCategoriesGet(String id) {
52+
public CategoriesGet(String id) {
5353
this.id = id;
5454
}
5555

src/test/java/com/spotify/requests/connection/tests/CategoriesConnectionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.spotify.SpotifyResponse;
44
import com.spotify.requests.SpotifyRequestVariant;
55
import com.spotify.requests.categories.SeveralCategoriesGet;
6-
import com.spotify.requests.categories.SingleCategoriesGet;
6+
import com.spotify.requests.categories.CategoriesGet;
77
import com.spotify.requests.connection.AbstractConnectionTest;
88
import org.junit.jupiter.api.Tag;
99
import org.junit.jupiter.api.Test;
@@ -24,7 +24,7 @@ public void severalCategoriesGetTest() {
2424
@Test
2525
@Tag("NetworkTest")
2626
public void singleCategoriesGetTest() {
27-
SpotifyRequestVariant request = new SingleCategoriesGet("dinner");
27+
SpotifyRequestVariant request = new CategoriesGet("dinner");
2828
SpotifyResponse spotifyResponse = super.client.executeRequest(request);
2929
assertTrue(spotifyResponse.wasSuccess());
3030
}

src/test/java/com/spotify/requests/data/resources/SpotifyResponses-V1_0_0.json

Lines changed: 34 additions & 0 deletions
Large diffs are not rendered by default.

src/test/java/com/spotify/requests/data/resources/requestUrlClasses.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"com.spotify.requests.categories.SeveralCategoriesGet": {
6060
"url": "https://api.spotify.com/v1/browse/categories"
6161
},
62-
"com.spotify.requests.categories.SingleCategoriesGet": {
62+
"com.spotify.requests.categories.CategoriesGet": {
6363
"url": "https://api.spotify.com/v1/browse/categories/dinner",
6464
"id": "dinner"
6565
},

src/test/java/com/spotify/requests/data/tests/CategoriesUrlTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.spotify.requests.SpotifyRequestVariant;
44
import com.spotify.requests.categories.SeveralCategoriesGet;
5-
import com.spotify.requests.categories.SingleCategoriesGet;
5+
import com.spotify.requests.categories.CategoriesGet;
66
import com.spotify.requests.data.AbstractUrlTest;
77
import org.junit.jupiter.api.Test;
88

@@ -20,7 +20,7 @@ public void severalCategoriesGetTestUrl() {
2020

2121
@Test
2222
public void singleCategoriesGetTestUrl() {
23-
SpotifyRequestVariant request = new SingleCategoriesGet("dinner");
23+
SpotifyRequestVariant request = new CategoriesGet("dinner");
2424
String actualUrl = super.client.getBuiltURL(request);
2525
assertEquals(actualUrl, super.getCorrectURL(request.getClass()));
2626
}

0 commit comments

Comments
 (0)