pub struct Client<'a> { /* private fields */ }
Expand description
Client for accessing Listen Notes API.
Implementations§
Source§impl Client<'_>
impl Client<'_>
Sourcepub fn new(id: Option<&str>) -> Client<'_>
pub fn new(id: Option<&str>) -> Client<'_>
Creates new Listen API Client.
Uses default HTTP client with 30 second timeouts.
To access production API:
let client = podcast_api::Client::new(Some("YOUR-API-KEY"));
To access mock API:
let client = podcast_api::Client::new(None);
Sourcepub fn new_custom<'a>(
client: Client,
id: Option<&'a str>,
user_agent: Option<&'a str>,
) -> Client<'a>
pub fn new_custom<'a>( client: Client, id: Option<&'a str>, user_agent: Option<&'a str>, ) -> Client<'a>
Creates new Listen API Client with user provided HTTP Client.
Sourcepub async fn search(&self, parameters: &Value) -> Result<Response>
pub async fn search(&self, parameters: &Value) -> Result<Response>
Calls GET /search
with supplied parameters.
Sourcepub async fn search_episode_titles(
&self,
parameters: &Value,
) -> Result<Response>
pub async fn search_episode_titles( &self, parameters: &Value, ) -> Result<Response>
Calls GET /search_episode_titles
with supplied parameters.
Sourcepub async fn typeahead(&self, parameters: &Value) -> Result<Response>
pub async fn typeahead(&self, parameters: &Value) -> Result<Response>
Calls GET /typeahead
with supplied parameters.
Sourcepub async fn spellcheck(&self, parameters: &Value) -> Result<Response>
pub async fn spellcheck(&self, parameters: &Value) -> Result<Response>
Calls GET /spellcheck
with supplied parameters.
Calls GET /related_searches
with supplied parameters.
Sourcepub async fn fetch_trending_searches(
&self,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_trending_searches( &self, parameters: &Value, ) -> Result<Response>
Calls GET /trending_searches
with supplied parameters.
Sourcepub async fn fetch_best_podcasts(&self, parameters: &Value) -> Result<Response>
pub async fn fetch_best_podcasts(&self, parameters: &Value) -> Result<Response>
Calls GET /best_podcasts
with supplied parameters.
Sourcepub async fn fetch_podcast_by_id(
&self,
id: &str,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_podcast_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>
Calls GET /podcasts/{id}
with supplied parameters.
Sourcepub async fn batch_fetch_podcasts(&self, parameters: &Value) -> Result<Response>
pub async fn batch_fetch_podcasts(&self, parameters: &Value) -> Result<Response>
Calls POST /podcasts
with supplied parameters.
Sourcepub async fn fetch_episode_by_id(
&self,
id: &str,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_episode_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>
Calls GET /episodes/{id}
with supplied parameters.
Sourcepub async fn batch_fetch_episodes(&self, parameters: &Value) -> Result<Response>
pub async fn batch_fetch_episodes(&self, parameters: &Value) -> Result<Response>
Calls POST /episodes
with supplied parameters.
Sourcepub async fn fetch_curated_podcasts_list_by_id(
&self,
id: &str,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_curated_podcasts_list_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>
Calls GET /curated_podcasts/{id}
with supplied parameters.
Sourcepub async fn fetch_curated_podcasts_lists(
&self,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_curated_podcasts_lists( &self, parameters: &Value, ) -> Result<Response>
Calls GET /curated_podcasts
with supplied parameters.
Sourcepub async fn fetch_podcast_genres(&self, parameters: &Value) -> Result<Response>
pub async fn fetch_podcast_genres(&self, parameters: &Value) -> Result<Response>
Calls GET /genres
with supplied parameters.
Sourcepub async fn fetch_podcast_regions(
&self,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_podcast_regions( &self, parameters: &Value, ) -> Result<Response>
Calls GET /regions
with supplied parameters.
Sourcepub async fn fetch_podcast_languages(
&self,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_podcast_languages( &self, parameters: &Value, ) -> Result<Response>
Calls GET /languages
with supplied parameters.
Sourcepub async fn just_listen(&self, parameters: &Value) -> Result<Response>
pub async fn just_listen(&self, parameters: &Value) -> Result<Response>
Calls GET /just_listen
with supplied parameters.
Sourcepub async fn fetch_recommendations_for_podcast(
&self,
id: &str,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_recommendations_for_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>
Calls GET /podcasts/{id}/recommendations
with supplied parameters.
Sourcepub async fn fetch_recommendations_for_episode(
&self,
id: &str,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_recommendations_for_episode( &self, id: &str, parameters: &Value, ) -> Result<Response>
Calls GET /episodes/{id}/recommendations
with supplied parameters.
Sourcepub async fn fetch_playlist_by_id(
&self,
id: &str,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_playlist_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>
Calls GET /playlists/{id}
with supplied parameters.
Sourcepub async fn fetch_my_playlists(&self, parameters: &Value) -> Result<Response>
pub async fn fetch_my_playlists(&self, parameters: &Value) -> Result<Response>
Calls GET /playlists
with supplied parameters.
Sourcepub async fn submit_podcast(&self, parameters: &Value) -> Result<Response>
pub async fn submit_podcast(&self, parameters: &Value) -> Result<Response>
Calls POST /podcasts/submit
with supplied parameters.
Sourcepub async fn delete_podcast(
&self,
id: &str,
parameters: &Value,
) -> Result<Response>
pub async fn delete_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>
Calls DELETE /podcasts/{id}
with supplied parameters.
Sourcepub async fn fetch_audience_for_podcast(
&self,
id: &str,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_audience_for_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>
Calls GET /podcasts/{id}/audience
with supplied parameters.
Sourcepub async fn fetch_podcasts_by_domain(
&self,
domain_name: &str,
parameters: &Value,
) -> Result<Response>
pub async fn fetch_podcasts_by_domain( &self, domain_name: &str, parameters: &Value, ) -> Result<Response>
Calls GET /podcasts/domains/{domain_name}
with supplied parameters.