pub struct Client { /* private fields */ }Expand description
Client for Pathbase API
Version: 1.0.0
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(baseurl: &str) -> Self
pub fn new(baseurl: &str) -> Self
Create a new client.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Sourcepub fn new_with_client(baseurl: &str, client: Client) -> Self
pub fn new_with_client(baseurl: &str, client: Client) -> Self
Construct a new client with an existing reqwest::Client,
allowing more control over its configuration.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Source§impl Client
impl Client
Sourcepub async fn create_anon_path<'a>(
&'a self,
body: &'a AnonUploadBody,
) -> Result<ResponseValue<AnonUploadResponse>, Error<()>>
pub async fn create_anon_path<'a>( &'a self, body: &'a AnonUploadBody, ) -> Result<ResponseValue<AnonUploadResponse>, Error<()>>
Sends a POST request to /api/v1/anon/paths
Sourcepub async fn logout<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>>
pub async fn logout<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>>
Sends a POST request to /api/v1/auth/logout
Sourcepub async fn me<'a>(&'a self) -> Result<ResponseValue<User>, Error<()>>
pub async fn me<'a>(&'a self) -> Result<ResponseValue<User>, Error<()>>
Sends a GET request to /api/v1/auth/me
Sourcepub async fn health<'a>(
&'a self,
) -> Result<ResponseValue<HealthResponse>, Error<HealthResponse>>
pub async fn health<'a>( &'a self, ) -> Result<ResponseValue<HealthResponse>, Error<HealthResponse>>
Sends a GET request to /api/v1/health
Sourcepub async fn create_repo<'a>(
&'a self,
body: &'a CreateRepoBody,
) -> Result<ResponseValue<Repo>, Error<()>>
pub async fn create_repo<'a>( &'a self, body: &'a CreateRepoBody, ) -> Result<ResponseValue<Repo>, Error<()>>
Sends a POST request to /api/v1/repos
Sourcepub async fn get_repo<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
) -> Result<ResponseValue<Repo>, Error<()>>
pub async fn get_repo<'a>( &'a self, owner: &'a str, repo: &'a str, ) -> Result<ResponseValue<Repo>, Error<()>>
Sends a GET request to /api/v1/repos/{owner}/{repo}
Arguments:
owner: Owner usernamerepo: Repository name
Sourcepub async fn delete_repo<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
) -> Result<ResponseValue<()>, Error<()>>
pub async fn delete_repo<'a>( &'a self, owner: &'a str, repo: &'a str, ) -> Result<ResponseValue<()>, Error<()>>
Sends a DELETE request to /api/v1/repos/{owner}/{repo}
Arguments:
owner: Owner usernamerepo: Repository name
Sourcepub async fn update_repo<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
body: &'a UpdateRepoBody,
) -> Result<ResponseValue<Repo>, Error<()>>
pub async fn update_repo<'a>( &'a self, owner: &'a str, repo: &'a str, body: &'a UpdateRepoBody, ) -> Result<ResponseValue<Repo>, Error<()>>
Sends a PATCH request to /api/v1/repos/{owner}/{repo}
Arguments:
owner: Owner usernamerepo: Repository namebody
Sourcepub async fn list_graphs<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
) -> Result<ResponseValue<Vec<Graph>>, Error<()>>
pub async fn list_graphs<'a>( &'a self, owner: &'a str, repo: &'a str, ) -> Result<ResponseValue<Vec<Graph>>, Error<()>>
Sends a GET request to /api/v1/repos/{owner}/{repo}/graphs
Arguments:
owner: Owner usernamerepo: Repository name
Sourcepub async fn create_graph<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
body: &'a UploadGraphBody,
) -> Result<ResponseValue<Graph>, Error<()>>
pub async fn create_graph<'a>( &'a self, owner: &'a str, repo: &'a str, body: &'a UploadGraphBody, ) -> Result<ResponseValue<Graph>, Error<()>>
Sends a POST request to /api/v1/repos/{owner}/{repo}/graphs
Arguments:
owner: Owner usernamerepo: Repository namebody
Sourcepub async fn get_graph<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
slug: &'a str,
) -> Result<ResponseValue<Graph>, Error<()>>
pub async fn get_graph<'a>( &'a self, owner: &'a str, repo: &'a str, slug: &'a str, ) -> Result<ResponseValue<Graph>, Error<()>>
Sends a GET request to /api/v1/repos/{owner}/{repo}/graphs/{slug}
Arguments:
owner: Owner usernamerepo: Repository nameslug: Graph slug
Sourcepub async fn delete_graph<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
slug: &'a str,
) -> Result<ResponseValue<()>, Error<()>>
pub async fn delete_graph<'a>( &'a self, owner: &'a str, repo: &'a str, slug: &'a str, ) -> Result<ResponseValue<()>, Error<()>>
Sends a DELETE request to /api/v1/repos/{owner}/{repo}/graphs/{slug}
Arguments:
owner: Owner usernamerepo: Repository nameslug: Graph slug
Sourcepub async fn list_paths<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
) -> Result<ResponseValue<Vec<TracePath>>, Error<()>>
pub async fn list_paths<'a>( &'a self, owner: &'a str, repo: &'a str, ) -> Result<ResponseValue<Vec<TracePath>>, Error<()>>
Sends a GET request to /api/v1/repos/{owner}/{repo}/paths
Arguments:
owner: Owner usernamerepo: Repository name
Sourcepub async fn create_path<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
body: &'a UploadPathBody,
) -> Result<ResponseValue<TracePath>, Error<()>>
pub async fn create_path<'a>( &'a self, owner: &'a str, repo: &'a str, body: &'a UploadPathBody, ) -> Result<ResponseValue<TracePath>, Error<()>>
Sends a POST request to /api/v1/repos/{owner}/{repo}/paths
Arguments:
owner: Owner usernamerepo: Repository namebody
Sourcepub async fn get_path<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
slug: &'a str,
) -> Result<ResponseValue<TracePath>, Error<()>>
pub async fn get_path<'a>( &'a self, owner: &'a str, repo: &'a str, slug: &'a str, ) -> Result<ResponseValue<TracePath>, Error<()>>
Sends a GET request to /api/v1/repos/{owner}/{repo}/paths/{slug}
Arguments:
owner: Owner usernamerepo: Repository nameslug: Path slug
Sourcepub async fn delete_path<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
slug: &'a str,
) -> Result<ResponseValue<()>, Error<()>>
pub async fn delete_path<'a>( &'a self, owner: &'a str, repo: &'a str, slug: &'a str, ) -> Result<ResponseValue<()>, Error<()>>
Sends a DELETE request to /api/v1/repos/{owner}/{repo}/paths/{slug}
Arguments:
owner: Owner usernamerepo: Repository nameslug: Path slug
Sourcepub async fn update_path<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
slug: &'a str,
body: &'a UpdatePathBody,
) -> Result<ResponseValue<TracePath>, Error<()>>
pub async fn update_path<'a>( &'a self, owner: &'a str, repo: &'a str, slug: &'a str, body: &'a UpdatePathBody, ) -> Result<ResponseValue<TracePath>, Error<()>>
Sends a PATCH request to /api/v1/repos/{owner}/{repo}/paths/{slug}
Arguments:
owner: Owner usernamerepo: Repository nameslug: Path slugbody
Sourcepub async fn download_path<'a>(
&'a self,
owner: &'a str,
repo: &'a str,
slug: &'a str,
) -> Result<ResponseValue<Map<String, Value>>, Error<()>>
pub async fn download_path<'a>( &'a self, owner: &'a str, repo: &'a str, slug: &'a str, ) -> Result<ResponseValue<Map<String, Value>>, Error<()>>
Sends a GET request to /api/v1/repos/{owner}/{repo}/paths/{slug}/download
Arguments:
owner: Owner usernamerepo: Repository nameslug: Path slug
Sourcepub async fn get_profile<'a>(&'a self) -> Result<ResponseValue<User>, Error<()>>
pub async fn get_profile<'a>(&'a self) -> Result<ResponseValue<User>, Error<()>>
Sends a GET request to /api/v1/settings/profile
Sourcepub async fn update_profile<'a>(
&'a self,
body: &'a UpdateProfileBody,
) -> Result<ResponseValue<User>, Error<()>>
pub async fn update_profile<'a>( &'a self, body: &'a UpdateProfileBody, ) -> Result<ResponseValue<User>, Error<()>>
Sends a PATCH request to /api/v1/settings/profile
Sourcepub async fn get_user<'a>(
&'a self,
username: &'a str,
) -> Result<ResponseValue<User>, Error<()>>
pub async fn get_user<'a>( &'a self, username: &'a str, ) -> Result<ResponseValue<User>, Error<()>>
Sends a GET request to /api/v1/users/{username}
Arguments:
username: Username
Sourcepub async fn list_repos<'a>(
&'a self,
username: &'a str,
) -> Result<ResponseValue<Vec<Repo>>, Error<()>>
pub async fn list_repos<'a>( &'a self, username: &'a str, ) -> Result<ResponseValue<Vec<Repo>>, Error<()>>
Sends a GET request to /api/v1/users/{username}/repos
Arguments:
username: Username