pub struct Client {
    pub default_headers: HttpRequestHeaders,
    pub auth_data: AuthData,
    /* private fields */
}Fields
default_headers: HttpRequestHeadersauth_data: AuthDataImplementations
sourceimpl Client
 
impl Client
sourcepub fn new(
    username: String,
    client_secret: String,
    environment: Environment
) -> Self
 
pub fn new(
    username: String,
    client_secret: String,
    environment: Environment
) -> Self
Initialize a new PayPal client. To authenticate, use the authenticate method.
sourcepub fn compose_url(&self, request_path: &str) -> Url
 
pub fn compose_url(&self, request_path: &str) -> Url
Composes an URL from the base URL and the provided path.
Arguments
- path- The path to append to the base URL.
sourcepub fn compose_url_with_query(
    &self,
    request_path: &str,
    query: &QueryParams
) -> Result<Url, Error>
 
pub fn compose_url_with_query(
    &self,
    request_path: &str,
    query: &QueryParams
) -> Result<Url, Error>
Composes an URL with query parameters.
Arguments
- path- The path to append to the base URL.
- query_params- The query parameters to append to the URL.
pub fn with_app_info(self, app_info: AppInfo) -> Self
sourcepub async fn get<T: Endpoint>(
    &mut self,
    endpoint: &T
) -> Result<T::ResponseBody, PayPalError>
 
pub async fn get<T: Endpoint>(
    &mut self,
    endpoint: &T
) -> Result<T::ResponseBody, PayPalError>
sourcepub async fn post<T: Endpoint>(
    &mut self,
    endpoint: &T
) -> Result<T::ResponseBody, PayPalError>
 
pub async fn post<T: Endpoint>(
    &mut self,
    endpoint: &T
) -> Result<T::ResponseBody, PayPalError>
pub fn set_request_headers(
    &self,
    request_builder: RequestBuilder,
    headers: &HttpRequestHeaders
) -> RequestBuilder
pub async fn authenticate(&mut self) -> Result<(), PayPalError>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more