pub struct SdkClient { /* private fields */ }
Expand description
Wrapper of a reqwest::Client
to make API requests to Fundamentum.
It contains the possible HTTP methods to be used with the client.
Implementations§
Source§impl SdkClient
impl SdkClient
Sourcepub fn new(config: ClientConfig, api_version: &str) -> Self
pub fn new(config: ClientConfig, api_version: &str) -> Self
Create a new Client.
Sourcepub const fn config(&self) -> &ClientConfig
pub const fn config(&self) -> &ClientConfig
Get the current configuration of this client.
Sourcepub async fn status(&self) -> Result<Status, SdkClientError>
pub async fn status(&self) -> Result<Status, SdkClientError>
Sourcepub async fn get_openapi_json(&self) -> Result<Value, SdkClientError>
pub async fn get_openapi_json(&self) -> Result<Value, SdkClientError>
Sourcepub async fn get<T, S>(&self, path: S) -> Result<T, SdkClientError>
pub async fn get<T, S>(&self, path: S) -> Result<T, SdkClientError>
Method to perform a GET HTTP request.
§Errors
The request may fail if the path is invalid or inexistant.
Sourcepub async fn delete<T, S>(&self, path: S) -> Result<T, SdkClientError>
pub async fn delete<T, S>(&self, path: S) -> Result<T, SdkClientError>
Method to perform a DELETE HTTP request.
§Errors
The request may fail if the path is invalid or inexistant.
Sourcepub async fn post_body<T, S, B>(
&self,
path: S,
body: B,
) -> Result<T, SdkClientError>
pub async fn post_body<T, S, B>( &self, path: S, body: B, ) -> Result<T, SdkClientError>
Method to perform a POST HTTP request with a body.
§Errors
The request may fail if the path is invalid or inexistant, or if the body is invalid.
Sourcepub async fn put_body<T, S, B>(
&self,
path: S,
body: B,
) -> Result<T, SdkClientError>
pub async fn put_body<T, S, B>( &self, path: S, body: B, ) -> Result<T, SdkClientError>
Method to perform a PUT HTTP request with a body.
§Errors
The request may fail if the path is invalid or inexistant, or if the body is invalid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SdkClient
impl !RefUnwindSafe for SdkClient
impl Send for SdkClient
impl Sync for SdkClient
impl Unpin for SdkClient
impl !UnwindSafe for SdkClient
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