pub struct ApiClient { /* private fields */ }
Expand description
Apple music api client
Api client can be cloned safely as reqwest uses Arc internally
Implementations§
Source§impl ApiClient
impl ApiClient
Sourcepub fn new(
developer_token: &str,
media_user_token: &str,
storefront_country: Country,
) -> Result<ApiClient, Error>
pub fn new( developer_token: &str, media_user_token: &str, storefront_country: Country, ) -> Result<ApiClient, Error>
Create a new ApiClient
instance
Sourcepub fn get_storefront_country(&self) -> Country
pub fn get_storefront_country(&self) -> Country
Get the default storefront country for this client
Sourcepub fn get_localization(&self) -> &str
pub fn get_localization(&self) -> &str
Get the default localization for this client
Sourcepub fn set_localization(&mut self, localization: &str)
pub fn set_localization(&mut self, localization: &str)
Set the default localization for this client
Sourcepub fn get(&self, endpoint: &str) -> RequestBuilder
pub fn get(&self, endpoint: &str) -> RequestBuilder
Convenience method to make a GET request to an endpoint
Sourcepub fn post(&self, endpoint: &str) -> RequestBuilder
pub fn post(&self, endpoint: &str) -> RequestBuilder
Convenience method to make a POST request to an endpoint
Sourcepub fn put(&self, endpoint: &str) -> RequestBuilder
pub fn put(&self, endpoint: &str) -> RequestBuilder
Convenience method to make a PUT request to an endpoint
Sourcepub fn delete(&self, endpoint: &str) -> RequestBuilder
pub fn delete(&self, endpoint: &str) -> RequestBuilder
Convenience method to make a DELETE request to an endpoint
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApiClient
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl !UnwindSafe for ApiClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more