@@ -112,36 +112,66 @@ impl Client<'_> {
112
112
self . post ( "episodes" , parameters) . await
113
113
}
114
114
115
- /// Calls [`GET /curated_podcasts/{id}`](https://www.listennotes.com/api/docs/#post -api-v2-curated_podcasts-id) with supplied parameters.
115
+ /// Calls [`GET /curated_podcasts/{id}`](https://www.listennotes.com/api/docs/#get -api-v2-curated_podcasts-id) with supplied parameters.
116
116
pub async fn fetch_curated_podcasts_list_by_id ( & self , id : & str , parameters : & Value ) -> Result < Response > {
117
117
self . get ( & format ! ( "curated_podcasts/{}" , id) , parameters) . await
118
118
}
119
119
120
- /// Calls [`GET /curated_podcasts`](https://www.listennotes.com/api/docs/#post -api-v2-curated_podcasts) with supplied parameters.
120
+ /// Calls [`GET /curated_podcasts`](https://www.listennotes.com/api/docs/#get -api-v2-curated_podcasts) with supplied parameters.
121
121
pub async fn fetch_curated_podcasts_lists ( & self , parameters : & Value ) -> Result < Response > {
122
122
self . get ( "curated_podcasts" , parameters) . await
123
123
}
124
124
125
- /// Calls [`GET /genres`](https://www.listennotes.com/api/docs/#post -api-v2-genres) with supplied parameters.
125
+ /// Calls [`GET /genres`](https://www.listennotes.com/api/docs/#get -api-v2-genres) with supplied parameters.
126
126
pub async fn fetch_podcast_genres ( & self , parameters : & Value ) -> Result < Response > {
127
127
self . get ( "genres" , parameters) . await
128
128
}
129
129
130
- /// Calls [`GET /regions`](https://www.listennotes.com/api/docs/#post -api-v2-regions) with supplied parameters.
130
+ /// Calls [`GET /regions`](https://www.listennotes.com/api/docs/#get -api-v2-regions) with supplied parameters.
131
131
pub async fn fetch_podcast_regions ( & self , parameters : & Value ) -> Result < Response > {
132
132
self . get ( "regions" , parameters) . await
133
133
}
134
134
135
- /// Calls [`GET /languages`](https://www.listennotes.com/api/docs/#post -api-v2-languages) with supplied parameters.
135
+ /// Calls [`GET /languages`](https://www.listennotes.com/api/docs/#get -api-v2-languages) with supplied parameters.
136
136
pub async fn fetch_podcast_languages ( & self , parameters : & Value ) -> Result < Response > {
137
137
self . get ( "languages" , parameters) . await
138
138
}
139
139
140
- /// Calls [`GET /just_listen`](https://www.listennotes.com/api/docs/#post -api-v2-just_listen) with supplied parameters.
140
+ /// Calls [`GET /just_listen`](https://www.listennotes.com/api/docs/#get -api-v2-just_listen) with supplied parameters.
141
141
pub async fn just_listen ( & self , parameters : & Value ) -> Result < Response > {
142
142
self . get ( "just_listen" , parameters) . await
143
143
}
144
144
145
+ /// Calls [`GET /podcasts/{id}/recommendations`](https://www.listennotes.com/api/docs/#get-api-v2-podcasts-id-recommendations) with supplied parameters.
146
+ pub async fn fetch_recommendations_for_podcast ( & self , id : & str , parameters : & Value ) -> Result < Response > {
147
+ self . get ( & format ! ( "podcasts/{}/recommendations" , id) , parameters) . await
148
+ }
149
+
150
+ /// Calls [`GET /episodes/{id}/recommendations`](https://www.listennotes.com/api/docs/#get-api-v2-episodes-id-recommendations) with supplied parameters.
151
+ pub async fn fetch_recommendations_for_episode ( & self , id : & str , parameters : & Value ) -> Result < Response > {
152
+ self . get ( & format ! ( "episodes/{}/recommendations" , id) , parameters) . await
153
+ }
154
+
155
+ /// Calls [`GET /playlists/{id}`](https://www.listennotes.com/api/docs/#get-api-v2-playlists-id) with supplied parameters.
156
+ pub async fn fetch_playlist_by_id ( & self , id : & str , parameters : & Value ) -> Result < Response > {
157
+ self . get ( & format ! ( "playlists/{}" , id) , parameters) . await
158
+ }
159
+
160
+ /// Calls [`GET /playlists`](https://www.listennotes.com/api/docs/#get-api-v2-playlists) with supplied parameters.
161
+ pub async fn fetch_my_playlists ( & self , parameters : & Value ) -> Result < Response > {
162
+ self . get ( "playlists" , parameters) . await
163
+ }
164
+
165
+ /// Calls [`POST /podcasts/submit`](https://www.listennotes.com/api/docs/#post-api-v2-podcasts-submit) with supplied parameters.
166
+ pub async fn submit_podcast ( & self , parameters : & Value ) -> Result < Response > {
167
+ self . post ( "podcasts/submit" , parameters) . await
168
+ }
169
+
170
+ /// Calls [`DELETE /podcasts/{id}`](https://www.listennotes.com/api/docs/#delete-api-v2-podcasts-id) with supplied parameters.
171
+ pub async fn delete_podcast ( & self , id : & str , parameters : & Value ) -> Result < Response > {
172
+ self . delete ( & format ! ( "podcasts/{}" , id) , parameters) . await
173
+ }
174
+
145
175
async fn get ( & self , endpoint : & str , parameters : & Value ) -> Result < Response > {
146
176
let request = self
147
177
. client
@@ -161,6 +191,15 @@ impl Client<'_> {
161
191
Ok ( self . request ( request) . await ?)
162
192
}
163
193
194
+ async fn delete ( & self , endpoint : & str , parameters : & Value ) -> Result < Response > {
195
+ let request = self
196
+ . client
197
+ . delete ( format ! ( "{}/{}" , self . api. url( ) , endpoint) )
198
+ . query ( parameters) ;
199
+
200
+ Ok ( self . request ( request) . await ?)
201
+ }
202
+
164
203
async fn request ( & self , request : RequestBuilder ) -> Result < Response > {
165
204
let request = if let Api :: Production ( key) = self . api {
166
205
request. header ( "X-ListenAPI-Key" , key)
0 commit comments