Skip to content

Commit 6a87082

Browse files
authored
Update to fixed-spotify-open-api.yml (#147)
1 parent b4c2308 commit 6a87082

21 files changed

+1028
-7
lines changed

spotify-web-api-java-generator/fixed-spotify-open-api.yml

Lines changed: 510 additions & 5 deletions
Large diffs are not rendered by default.

spotify-web-api-java/src/main/generated/de/sonallux/spotify/api/SpotifyWebApi.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ public class SpotifyWebApi {
1111

1212
private final AlbumsApi albumsApi;
1313
private final ArtistsApi artistsApi;
14+
private final AudiobooksApi audiobooksApi;
1415
private final BrowseApi browseApi;
16+
private final ChaptersApi chaptersApi;
1517
private final EpisodesApi episodesApi;
1618
private final FollowApi followApi;
1719
private final LibraryApi libraryApi;
@@ -27,7 +29,9 @@ public class SpotifyWebApi {
2729
SpotifyWebApi(ApiClient apiClient) {
2830
this.albumsApi = new AlbumsApi(apiClient);
2931
this.artistsApi = new ArtistsApi(apiClient);
32+
this.audiobooksApi = new AudiobooksApi(apiClient);
3033
this.browseApi = new BrowseApi(apiClient);
34+
this.chaptersApi = new ChaptersApi(apiClient);
3135
this.episodesApi = new EpisodesApi(apiClient);
3236
this.followApi = new FollowApi(apiClient);
3337
this.libraryApi = new LibraryApi(apiClient);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package de.sonallux.spotify.api.apis;
2+
3+
import de.sonallux.spotify.api.http.ApiClient;
4+
import de.sonallux.spotify.api.apis.audiobooks.*;
5+
import lombok.RequiredArgsConstructor;
6+
7+
/**
8+
* Audiobooks
9+
*/
10+
@RequiredArgsConstructor
11+
public class AudiobooksApi {
12+
private final ApiClient apiClient;
13+
14+
/**
15+
* <h4>Get an Audiobook</h4>
16+
* <p>Get Spotify catalog information for a single audiobook.<br><strong>Note: Audiobooks are only available for the US market.</strong></p>
17+
* @param id <p>The <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify ID</a>for the audiobook.</p>
18+
* @return a {@link GetAudiobookRequest} object to build and execute the request
19+
*/
20+
public GetAudiobookRequest getAudiobook(String id) {
21+
return new GetAudiobookRequest(apiClient, id);
22+
}
23+
24+
/**
25+
* <h4>Get Several Audiobooks</h4>
26+
* <p>Get Spotify catalog information for several audiobooks identified by their Spotify IDs.<br><strong>Note: Audiobooks are only available for the US market.</strong></p>
27+
* @param ids <p>A comma-separated list of the <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify IDs</a>. For example: <code>ids=4iV5W9uYEdYUVa79Axb7Rh,1301WleyT98MSxVHPZCA6M</code>. Maximum: 50 IDs.</p>
28+
* @return a {@link GetMultipleAudiobooksRequest} object to build and execute the request
29+
*/
30+
public GetMultipleAudiobooksRequest getMultipleAudiobooks(String ids) {
31+
return new GetMultipleAudiobooksRequest(apiClient, ids);
32+
}
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package de.sonallux.spotify.api.apis;
2+
3+
import de.sonallux.spotify.api.http.ApiClient;
4+
import de.sonallux.spotify.api.apis.chapters.*;
5+
import lombok.RequiredArgsConstructor;
6+
7+
/**
8+
* Chapters
9+
*/
10+
@RequiredArgsConstructor
11+
public class ChaptersApi {
12+
private final ApiClient apiClient;
13+
14+
/**
15+
* <h4>Get a Chapter</h4>
16+
* <p>Get Spotify catalog information for a single chapter.<br><strong>Note: Chapters are only available for the US market.</strong></p>
17+
* @param id <p>The <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify ID</a>for the chapter.</p>
18+
* @return a {@link GetChapterRequest} object to build and execute the request
19+
*/
20+
public GetChapterRequest getChapter(String id) {
21+
return new GetChapterRequest(apiClient, id);
22+
}
23+
24+
/**
25+
* <h4>Get Several Chapters</h4>
26+
* <p>Get Spotify catalog information for several chapters identified by their Spotify IDs.<br><strong>Note: Chapters are only available for the US market.</strong></p>
27+
* @param ids <p>A comma-separated list of the <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify IDs</a>. For example: <code>ids=4iV5W9uYEdYUVa79Axb7Rh,1301WleyT98MSxVHPZCA6M</code>. Maximum: 50 IDs.</p>
28+
* @return a {@link GetSeveralChaptersRequest} object to build and execute the request
29+
*/
30+
public GetSeveralChaptersRequest getSeveralChapters(String ids) {
31+
return new GetSeveralChaptersRequest(apiClient, ids);
32+
}
33+
}

spotify-web-api-java/src/main/generated/de/sonallux/spotify/api/apis/SearchApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class SearchApi {
1313

1414
/**
1515
* <h4>Search for Item</h4>
16-
* <p>Get Spotify catalog information about albums, artists, playlists, tracks, shows or episodes that match a keyword string.</p>
16+
* <p>Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.<br><strong>Note: Audiobooks are only available for the US market.</strong></p>
1717
* @param q <p>Your search query.</p><p>You can narrow down your search using field filters. The available filters are <code>album</code>, <code>artist</code>, <code>track</code>, <code>year</code>, <code>upc</code>, <code>tag:hipster</code>, <code>tag:new</code>, <code>isrc</code>, and <code>genre</code>. Each field filter only applies to certain result types.</p><p>The <code>artist</code> and <code>year</code> filters can be used while searching albums, artists and tracks. You can filter on a single <code>year</code> or a range (e.g. 1955-1960).<br>The <code>album</code> filter can be used while searching albums and tracks.<br>The <code>genre</code> filter can be used while searching artists and tracks.<br>The <code>isrc</code> and <code>track</code> filters can be used while searching tracks.<br>The <code>upc</code>, <code>tag:new</code> and <code>tag:hipster</code> filters can only be used while searching albums. The <code>tag:new</code> filter will return albums released in the past two weeks and <code>tag:hipster</code> can be used to return only albums with the lowest 10% popularity.<br></p>
1818
* @param type <p>A comma-separated list of item types to search across. Search results include hits from all the specified item types. For example: <code>q=abacab&amp;type=album,track</code> returns both albums and tracks matching &quot;abacab&quot;.</p>
1919
* @return a {@link SearchRequest} object to build and execute the request
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package de.sonallux.spotify.api.apis.audiobooks;
2+
3+
import com.fasterxml.jackson.core.type.TypeReference;
4+
import de.sonallux.spotify.api.http.ApiCall;
5+
import de.sonallux.spotify.api.http.ApiClient;
6+
import de.sonallux.spotify.api.http.Request;
7+
import de.sonallux.spotify.api.models.*;
8+
9+
/**
10+
* <h2>Get an Audiobook request</h2>
11+
*
12+
* <h3>Response</h3>
13+
* <p>An Audiobook</p>
14+
*/
15+
public class GetAudiobookRequest {
16+
private static final TypeReference<Audiobook> RESPONSE_TYPE = new TypeReference<>() {};
17+
private final ApiClient apiClient;
18+
private final Request request;
19+
20+
/**
21+
* Get an Audiobook request
22+
* @param apiClient <p>The API client</p>
23+
* @param id <p>The <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify ID</a>for the audiobook.</p>
24+
*/
25+
public GetAudiobookRequest(ApiClient apiClient, String id) {
26+
this.apiClient = apiClient;
27+
this.request = new Request("GET", "/audiobooks/{id}")
28+
.addPathParameter("id", String.valueOf(id))
29+
;
30+
}
31+
32+
/**
33+
* @param market <p>An <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2 country code</a>. If a country code is specified, only content that is available in that market will be returned.<br>If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.<br><em><strong>Note</strong>: If neither market or user country are provided, the content is considered unavailable for the client.</em><br>Users can view the country that is associated with their account in the <a href="https://www.spotify.com/se/account/overview/">account settings</a>.</p>
34+
* @return this request
35+
*/
36+
public GetAudiobookRequest market(String market) {
37+
this.request.addQueryParameter("market", String.valueOf(market));
38+
return this;
39+
}
40+
41+
/**
42+
* Build the request into an executable api call
43+
* @return an executable api call
44+
*/
45+
public ApiCall<Audiobook> build() {
46+
return apiClient.createApiCall(request, RESPONSE_TYPE);
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package de.sonallux.spotify.api.apis.audiobooks;
2+
3+
import com.fasterxml.jackson.core.type.TypeReference;
4+
import de.sonallux.spotify.api.http.ApiCall;
5+
import de.sonallux.spotify.api.http.ApiClient;
6+
import de.sonallux.spotify.api.http.Request;
7+
import de.sonallux.spotify.api.models.*;
8+
9+
/**
10+
* <h2>Get Several Audiobooks request</h2>
11+
*
12+
* <h3>Response</h3>
13+
* <p>A set of audiobooks</p>
14+
*/
15+
public class GetMultipleAudiobooksRequest {
16+
private static final TypeReference<ManyAudiobooks> RESPONSE_TYPE = new TypeReference<>() {};
17+
private final ApiClient apiClient;
18+
private final Request request;
19+
20+
/**
21+
* Get Several Audiobooks request
22+
* @param apiClient <p>The API client</p>
23+
* @param ids <p>A comma-separated list of the <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify IDs</a>. For example: <code>ids=4iV5W9uYEdYUVa79Axb7Rh,1301WleyT98MSxVHPZCA6M</code>. Maximum: 50 IDs.</p>
24+
*/
25+
public GetMultipleAudiobooksRequest(ApiClient apiClient, String ids) {
26+
this.apiClient = apiClient;
27+
this.request = new Request("GET", "/audiobooks")
28+
.addQueryParameter("ids", String.valueOf(ids))
29+
;
30+
}
31+
32+
/**
33+
* @param market <p>An <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2 country code</a>. If a country code is specified, only content that is available in that market will be returned.<br>If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.<br><em><strong>Note</strong>: If neither market or user country are provided, the content is considered unavailable for the client.</em><br>Users can view the country that is associated with their account in the <a href="https://www.spotify.com/se/account/overview/">account settings</a>.</p>
34+
* @return this request
35+
*/
36+
public GetMultipleAudiobooksRequest market(String market) {
37+
this.request.addQueryParameter("market", String.valueOf(market));
38+
return this;
39+
}
40+
41+
/**
42+
* Build the request into an executable api call
43+
* @return an executable api call
44+
*/
45+
public ApiCall<ManyAudiobooks> build() {
46+
return apiClient.createApiCall(request, RESPONSE_TYPE);
47+
}
48+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package de.sonallux.spotify.api.apis.chapters;
2+
3+
import com.fasterxml.jackson.core.type.TypeReference;
4+
import de.sonallux.spotify.api.http.ApiCall;
5+
import de.sonallux.spotify.api.http.ApiClient;
6+
import de.sonallux.spotify.api.http.Request;
7+
import de.sonallux.spotify.api.models.*;
8+
9+
/**
10+
* <h2>Get a Chapter request</h2>
11+
*
12+
* <h3>Response</h3>
13+
* <p>A Chapter</p>
14+
*/
15+
public class GetChapterRequest {
16+
private static final TypeReference<Chapter> RESPONSE_TYPE = new TypeReference<>() {};
17+
private final ApiClient apiClient;
18+
private final Request request;
19+
20+
/**
21+
* Get a Chapter request
22+
* @param apiClient <p>The API client</p>
23+
* @param id <p>The <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify ID</a>for the chapter.</p>
24+
*/
25+
public GetChapterRequest(ApiClient apiClient, String id) {
26+
this.apiClient = apiClient;
27+
this.request = new Request("GET", "/chapters/{id}")
28+
.addPathParameter("id", String.valueOf(id))
29+
;
30+
}
31+
32+
/**
33+
* @param market <p>An <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2 country code</a>. If a country code is specified, only content that is available in that market will be returned.<br>If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.<br><em><strong>Note</strong>: If neither market or user country are provided, the content is considered unavailable for the client.</em><br>Users can view the country that is associated with their account in the <a href="https://www.spotify.com/se/account/overview/">account settings</a>.</p>
34+
* @return this request
35+
*/
36+
public GetChapterRequest market(String market) {
37+
this.request.addQueryParameter("market", String.valueOf(market));
38+
return this;
39+
}
40+
41+
/**
42+
* Build the request into an executable api call
43+
* @return an executable api call
44+
*/
45+
public ApiCall<Chapter> build() {
46+
return apiClient.createApiCall(request, RESPONSE_TYPE);
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package de.sonallux.spotify.api.apis.chapters;
2+
3+
import com.fasterxml.jackson.core.type.TypeReference;
4+
import de.sonallux.spotify.api.http.ApiCall;
5+
import de.sonallux.spotify.api.http.ApiClient;
6+
import de.sonallux.spotify.api.http.Request;
7+
import de.sonallux.spotify.api.models.*;
8+
9+
/**
10+
* <h2>Get Several Chapters request</h2>
11+
*
12+
* <h3>Response</h3>
13+
* <p>A set of chapters</p>
14+
*/
15+
public class GetSeveralChaptersRequest {
16+
private static final TypeReference<ManyChapters> RESPONSE_TYPE = new TypeReference<>() {};
17+
private final ApiClient apiClient;
18+
private final Request request;
19+
20+
/**
21+
* Get Several Chapters request
22+
* @param apiClient <p>The API client</p>
23+
* @param ids <p>A comma-separated list of the <a href="https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids">Spotify IDs</a>. For example: <code>ids=4iV5W9uYEdYUVa79Axb7Rh,1301WleyT98MSxVHPZCA6M</code>. Maximum: 50 IDs.</p>
24+
*/
25+
public GetSeveralChaptersRequest(ApiClient apiClient, String ids) {
26+
this.apiClient = apiClient;
27+
this.request = new Request("GET", "/chapters")
28+
.addQueryParameter("ids", String.valueOf(ids))
29+
;
30+
}
31+
32+
/**
33+
* @param market <p>An <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2 country code</a>. If a country code is specified, only content that is available in that market will be returned.<br>If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.<br><em><strong>Note</strong>: If neither market or user country are provided, the content is considered unavailable for the client.</em><br>Users can view the country that is associated with their account in the <a href="https://www.spotify.com/se/account/overview/">account settings</a>.</p>
34+
* @return this request
35+
*/
36+
public GetSeveralChaptersRequest market(String market) {
37+
this.request.addQueryParameter("market", String.valueOf(market));
38+
return this;
39+
}
40+
41+
/**
42+
* Build the request into an executable api call
43+
* @return an executable api call
44+
*/
45+
public ApiCall<ManyChapters> build() {
46+
return apiClient.createApiCall(request, RESPONSE_TYPE);
47+
}
48+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package de.sonallux.spotify.api.models;
2+
3+
import lombok.*;
4+
5+
/**
6+
* AudiobookObject
7+
*/
8+
@Getter
9+
@Setter
10+
@NoArgsConstructor
11+
public class Audiobook extends AudiobookBase {
12+
/**
13+
* <p>The chapters of the audiobook.</p>
14+
*/
15+
public Paging<SimplifiedChapter> chapters;
16+
}

0 commit comments

Comments
 (0)