Trait paypal_rust::client::endpoint::Endpoint
source · pub trait Endpoint {
type QueryParams: Serialize;
type RequestBody: Serialize;
type ResponseBody: DeserializeOwned + Debug;
fn path(&self) -> Cow<'_, str>;
fn headers(&self) -> HttpRequestHeaders { ... }
fn query(&self) -> Option<Self::QueryParams> { ... }
fn request_body(&self) -> Option<Self::RequestBody> { ... }
fn request_method(&self) -> Method { ... }
fn request_strategy(&self) -> RequestStrategy { ... }
fn auth_strategy(&self) -> AuthStrategy { ... }
fn request_url(&self, environment: Environment) -> Url { ... }
}
Required Associated Types§
sourcetype QueryParams: Serialize
type QueryParams: Serialize
The query parameters the endpoint accepts.
sourcetype RequestBody: Serialize
type RequestBody: Serialize
The request body the endpoint accepts.
sourcetype ResponseBody: DeserializeOwned + Debug
type ResponseBody: DeserializeOwned + Debug
The response body the endpoint returns.
Required Methods§
Provided Methods§
sourcefn headers(&self) -> HttpRequestHeaders
fn headers(&self) -> HttpRequestHeaders
The headers to send with the request.
sourcefn query(&self) -> Option<Self::QueryParams>
fn query(&self) -> Option<Self::QueryParams>
The query parameters to send with the request.
sourcefn request_body(&self) -> Option<Self::RequestBody>
fn request_body(&self) -> Option<Self::RequestBody>
The request body to send with the request.
sourcefn request_method(&self) -> Method
fn request_method(&self) -> Method
The HTTP method to use for the request.
sourcefn request_strategy(&self) -> RequestStrategy
fn request_strategy(&self) -> RequestStrategy
The request strategy to use.
sourcefn auth_strategy(&self) -> AuthStrategy
fn auth_strategy(&self) -> AuthStrategy
The authorization strategy to use.
sourcefn request_url(&self, environment: Environment) -> Url
fn request_url(&self, environment: Environment) -> Url
The URL to send the request to. DO NOT OVERRIDE THIS METHOD.