Skip to content

Commit fdf0b3c

Browse files
committed
Added: Shows API : get multiple shows
1 parent 632cd5c commit fdf0b3c

File tree

7 files changed

+300
-0
lines changed

7 files changed

+300
-0
lines changed

src/main/java/Client/SpotifyRestAPI.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,28 @@ public BaseItem searchForItem(SpotifyClient client) throws IOException {
15311531
*************************************************************************/
15321532

15331533

1534+
public Controller.ShowController.MultipleShows.BaseShow getMultipleShows(SpotifyClient client) throws IOException {
1535+
1536+
String url = baseUrl + "/v1/shows/";
1537+
1538+
Retrofit retrofit = new Retrofit.Builder()
1539+
.baseUrl(url)
1540+
.addConverterFactory(GsonConverterFactory.create())
1541+
.build();
1542+
1543+
showInterface showInterface = retrofit.create(Model.showInterface.class);
1544+
1545+
Call<Controller.ShowController.MultipleShows.BaseShow> call = showInterface.getMultipleShows(getTokenString(client.getToken()),client.getShow().convertShowIds());
1546+
1547+
Response<Controller.ShowController.MultipleShows.BaseShow> response = call.execute();
1548+
1549+
return response.body();
1550+
1551+
}
1552+
1553+
1554+
1555+
15341556

15351557

15361558

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package Controller.ShowController;
2+
3+
public class Class {
4+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package Controller.ShowController.MultipleShows;
2+
3+
import com.google.gson.annotations.Expose;
4+
import com.google.gson.annotations.SerializedName;
5+
6+
import java.util.List;
7+
8+
public class BaseShow {
9+
10+
@SerializedName("shows")
11+
@Expose
12+
private List<Show> shows = null;
13+
14+
public List<Show> getShows() {
15+
return shows;
16+
}
17+
18+
public void setShows(List<Show> shows) {
19+
this.shows = shows;
20+
}
21+
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package Controller.ShowController.MultipleShows;
2+
3+
import com.google.gson.annotations.Expose;
4+
import com.google.gson.annotations.SerializedName;
5+
6+
public class ExternalUrls {
7+
8+
@SerializedName("spotify")
9+
@Expose
10+
private String spotify;
11+
12+
public String getSpotify() {
13+
return spotify;
14+
}
15+
16+
public void setSpotify(String spotify) {
17+
this.spotify = spotify;
18+
}
19+
20+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package Controller.ShowController.MultipleShows;
2+
3+
import com.google.gson.annotations.Expose;
4+
import com.google.gson.annotations.SerializedName;
5+
6+
public class Image {
7+
8+
@SerializedName("height")
9+
@Expose
10+
private Integer height;
11+
@SerializedName("url")
12+
@Expose
13+
private String url;
14+
@SerializedName("width")
15+
@Expose
16+
private Integer width;
17+
18+
public Integer getHeight() {
19+
return height;
20+
}
21+
22+
public void setHeight(Integer height) {
23+
this.height = height;
24+
}
25+
26+
public String getUrl() {
27+
return url;
28+
}
29+
30+
public void setUrl(String url) {
31+
this.url = url;
32+
}
33+
34+
public Integer getWidth() {
35+
return width;
36+
}
37+
38+
public void setWidth(Integer width) {
39+
this.width = width;
40+
}
41+
42+
}
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
package Controller.ShowController.MultipleShows;
2+
3+
import com.google.gson.annotations.Expose;
4+
import com.google.gson.annotations.SerializedName;
5+
6+
import java.util.List;
7+
8+
public class Show {
9+
10+
@SerializedName("available_markets")
11+
@Expose
12+
private List<String> availableMarkets = null;
13+
@SerializedName("copyrights")
14+
@Expose
15+
private List<Object> copyrights = null;
16+
@SerializedName("description")
17+
@Expose
18+
private String description;
19+
@SerializedName("explicit")
20+
@Expose
21+
private Boolean explicit;
22+
@SerializedName("external_urls")
23+
@Expose
24+
private ExternalUrls externalUrls;
25+
@SerializedName("href")
26+
@Expose
27+
private String href;
28+
@SerializedName("id")
29+
@Expose
30+
private String id;
31+
@SerializedName("images")
32+
@Expose
33+
private List<Image> images = null;
34+
@SerializedName("is_externally_hosted")
35+
@Expose
36+
private Boolean isExternallyHosted;
37+
@SerializedName("languages")
38+
@Expose
39+
private List<String> languages = null;
40+
@SerializedName("media_type")
41+
@Expose
42+
private String mediaType;
43+
@SerializedName("name")
44+
@Expose
45+
private String name;
46+
@SerializedName("publisher")
47+
@Expose
48+
private String publisher;
49+
@SerializedName("type")
50+
@Expose
51+
private String type;
52+
@SerializedName("uri")
53+
@Expose
54+
private String uri;
55+
56+
public List<String> getAvailableMarkets() {
57+
return availableMarkets;
58+
}
59+
60+
public void setAvailableMarkets(List<String> availableMarkets) {
61+
this.availableMarkets = availableMarkets;
62+
}
63+
64+
public List<Object> getCopyrights() {
65+
return copyrights;
66+
}
67+
68+
public void setCopyrights(List<Object> copyrights) {
69+
this.copyrights = copyrights;
70+
}
71+
72+
public String getDescription() {
73+
return description;
74+
}
75+
76+
public void setDescription(String description) {
77+
this.description = description;
78+
}
79+
80+
public Boolean getExplicit() {
81+
return explicit;
82+
}
83+
84+
public void setExplicit(Boolean explicit) {
85+
this.explicit = explicit;
86+
}
87+
88+
public ExternalUrls getExternalUrls() {
89+
return externalUrls;
90+
}
91+
92+
public void setExternalUrls(ExternalUrls externalUrls) {
93+
this.externalUrls = externalUrls;
94+
}
95+
96+
public String getHref() {
97+
return href;
98+
}
99+
100+
public void setHref(String href) {
101+
this.href = href;
102+
}
103+
104+
public String getId() {
105+
return id;
106+
}
107+
108+
public void setId(String id) {
109+
this.id = id;
110+
}
111+
112+
public List<Image> getImages() {
113+
return images;
114+
}
115+
116+
public void setImages(List<Image> images) {
117+
this.images = images;
118+
}
119+
120+
public Boolean getIsExternallyHosted() {
121+
return isExternallyHosted;
122+
}
123+
124+
public void setIsExternallyHosted(Boolean isExternallyHosted) {
125+
this.isExternallyHosted = isExternallyHosted;
126+
}
127+
128+
public List<String> getLanguages() {
129+
return languages;
130+
}
131+
132+
public void setLanguages(List<String> languages) {
133+
this.languages = languages;
134+
}
135+
136+
public String getMediaType() {
137+
return mediaType;
138+
}
139+
140+
public void setMediaType(String mediaType) {
141+
this.mediaType = mediaType;
142+
}
143+
144+
public String getName() {
145+
return name;
146+
}
147+
148+
public void setName(String name) {
149+
this.name = name;
150+
}
151+
152+
public String getPublisher() {
153+
return publisher;
154+
}
155+
156+
public void setPublisher(String publisher) {
157+
this.publisher = publisher;
158+
}
159+
160+
public String getType() {
161+
return type;
162+
}
163+
164+
public void setType(String type) {
165+
this.type = type;
166+
}
167+
168+
public String getUri() {
169+
return uri;
170+
}
171+
172+
public void setUri(String uri) {
173+
this.uri = uri;
174+
}
175+
176+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package Model;
2+
3+
import Controller.ShowController.MultipleShows.BaseShow;
4+
import retrofit2.Call;
5+
import retrofit2.http.GET;
6+
import retrofit2.http.Header;
7+
import retrofit2.http.Query;
8+
9+
public interface showInterface {
10+
11+
@GET("https://api.spotify.com/v1/shows")
12+
Call<BaseShow> getMultipleShows(@Header("Authorization") String auth, @Query("ids") String ids);
13+
14+
}

0 commit comments

Comments
 (0)