pub struct MailChimp { /* private fields */ }
Expand description
Entrypoint for interacting with the MailChimp API.
Implementations§
Source§impl MailChimp
impl MailChimp
Sourcepub fn new<I, K, R, T, Q, C>(
client_id: I,
client_secret: K,
redirect_uri: R,
token: T,
refresh_token: Q,
endpoint: C,
) -> Self
pub fn new<I, K, R, T, Q, C>( client_id: I, client_secret: K, redirect_uri: R, token: T, refresh_token: Q, endpoint: C, ) -> Self
Create a new MailChimp client struct. It takes a type that can convert into
an &str (String
or Vec<u8>
for example). As long as the function is
given a valid API key your requests will work.
Sourcepub fn new_from_env<T, R, C>(token: T, refresh_token: R, endpoint: C) -> Self
pub fn new_from_env<T, R, C>(token: T, refresh_token: R, endpoint: C) -> Self
Create a new MailChimp client struct from environment variables. It
takes a type that can convert into
an &str (String
or Vec<u8>
for example). As long as the function is
given a valid API key and your requests will work.
We pass in the token and refresh token to the client so if you are storing
it in a database, you can get it first.
pub fn user_consent_url(&self) -> String
pub async fn refresh_access_token(&mut self) -> Result<AccessToken, APIError>
pub async fn get_access_token( &mut self, code: &str, ) -> Result<AccessToken, APIError>
Auto Trait Implementations§
impl Freeze for MailChimp
impl !RefUnwindSafe for MailChimp
impl Send for MailChimp
impl Sync for MailChimp
impl Unpin for MailChimp
impl !UnwindSafe for MailChimp
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