Skip to main content

Client

Struct Client 

Source
pub struct Client<'a> { /* private fields */ }
Expand description

Client for accessing Listen Notes API. Each instance owns its HTTP configuration.

Implementations§

Source§

impl Client<'_>

Source

pub async fn search(&self, parameters: &Value) -> Result<Response>

Full-text search See full API documentation.

Source

pub async fn typeahead(&self, parameters: &Value) -> Result<Response>

Typeahead search See full API documentation.

Source

pub async fn search_episode_titles( &self, parameters: &Value, ) -> Result<Response>

Find individual episodes by searching for their titles See full API documentation.

Source

pub async fn spellcheck(&self, parameters: &Value) -> Result<Response>

Spell check on a search term See full API documentation.

Fetch related search terms See full API documentation.

Fetch trending search terms See full API documentation.

Source

pub async fn fetch_best_podcasts(&self, parameters: &Value) -> Result<Response>

Fetch a list of best podcasts by genre See full API documentation.

Source

pub async fn fetch_podcast_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>

Fetch detailed meta data and episodes for a podcast by id See full API documentation.

Source

pub async fn delete_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>

Request to delete a podcast See full API documentation.

Source

pub async fn fetch_episode_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>

Fetch detailed meta data for an episode by id See full API documentation.

Source

pub async fn batch_fetch_episodes(&self, parameters: &Value) -> Result<Response>

Batch fetch basic meta data for episodes See full API documentation.

Source

pub async fn batch_fetch_podcasts(&self, parameters: &Value) -> Result<Response>

Batch fetch basic meta data for podcasts See full API documentation.

Source

pub async fn fetch_curated_podcasts_list_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>

Fetch a curated list of podcasts by id See full API documentation.

Source

pub async fn fetch_podcast_genres(&self, parameters: &Value) -> Result<Response>

Fetch a list of podcast genres See full API documentation.

Source

pub async fn fetch_podcast_regions( &self, parameters: &Value, ) -> Result<Response>

Fetch a list of supported countries/regions for best podcasts See full API documentation.

Source

pub async fn fetch_podcast_languages( &self, parameters: &Value, ) -> Result<Response>

Fetch a list of supported languages for podcasts See full API documentation.

Source

pub async fn just_listen(&self, parameters: &Value) -> Result<Response>

Fetch a random podcast episode See full API documentation.

Source

pub async fn fetch_curated_podcasts_lists( &self, parameters: &Value, ) -> Result<Response>

Fetch curated lists of podcasts See full API documentation.

Source

pub async fn fetch_recommendations_for_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>

Fetch recommendations for a podcast See full API documentation.

Source

pub async fn fetch_recommendations_for_episode( &self, id: &str, parameters: &Value, ) -> Result<Response>

Fetch recommendations for an episode See full API documentation.

Source

pub async fn submit_podcast(&self, parameters: &Value) -> Result<Response>

Submit a podcast to Listen Notes database See full API documentation.

Source

pub async fn fetch_playlist_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>

Fetch a playlist’s info and items (i.e., episodes or podcasts). See full API documentation.

Source

pub async fn fetch_my_playlists(&self, parameters: &Value) -> Result<Response>

Fetch a list of your playlists. See full API documentation.

Source

pub async fn fetch_audience_for_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>

Fetch audience demographics for a podcast See full API documentation.

Source

pub async fn fetch_podcasts_by_domain( &self, domain_name: &str, parameters: &Value, ) -> Result<Response>

Fetch podcasts by a publisher’s domain name See full API documentation.

Source

pub async fn create_playlist(&self, parameters: &Value) -> Result<Response>

Create a playlist. See full API documentation.

Source

pub async fn update_playlist( &self, id: &str, parameters: &Value, ) -> Result<Response>

Update playlist metadata. See full API documentation.

Source

pub async fn delete_playlist( &self, id: &str, parameters: &Value, ) -> Result<Response>

Delete a playlist. See full API documentation.

Source

pub async fn add_playlist_item( &self, id: &str, parameters: &Value, ) -> Result<Response>

Add an episode or podcast to a playlist. See full API documentation.

Source

pub async fn delete_playlist_item( &self, id: &str, item_id: &str, parameters: &Value, ) -> Result<Response>

Remove an item from a playlist. See full API documentation.

Source

pub async fn update_playlist_item_notes( &self, id: &str, item_id: &str, parameters: &Value, ) -> Result<Response>

Update notes for a playlist item. See full API documentation.

Source§

impl<'a> Client<'a>

Source

pub fn new(api_key: Option<&'a str>) -> Self

Create a production client with an API key, or a public mock client with None. Uses a 30-second total timeout and a 10-second connection timeout.

Source

pub fn http_client_builder() -> ClientBuilder

Start with the SDK’s timeout, no-redirect, and no-retry defaults. Use this builder with Self::new_custom to customize proxies or timeouts.

Source

pub fn new_custom( client: Client, api_key: Option<&'a str>, user_agent: Option<&'a str>, ) -> Self

Create a client with a supplied HTTP client and optional User-Agent. The caller controls that HTTP client’s timeout, proxy, redirect, and retry policies.

Source

pub fn with_base_url(self, base_url: &str) -> Result<Self>

Override the API base URL, for example for a local test server. Requests send this client’s credentials to the supplied server.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Client<'a>

§

impl<'a> !UnwindSafe for Client<'a>

§

impl<'a> Freeze for Client<'a>

§

impl<'a> Send for Client<'a>

§

impl<'a> Sync for Client<'a>

§

impl<'a> Unpin for Client<'a>

§

impl<'a> UnsafeUnpin for Client<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more