pub struct Client { /* private fields */ }Expand description
Client for the BinDist Customer API.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(
base_url: impl AsRef<str>,
api_key: impl Into<String>,
) -> Result<Self>
pub fn new( base_url: impl AsRef<str>, api_key: impl Into<String>, ) -> Result<Self>
Create a new client with the default reqwest::Client and a 30s
timeout.
Sourcepub fn with_http_client(
base_url: impl AsRef<str>,
api_key: impl Into<String>,
http: Client,
) -> Result<Self>
pub fn with_http_client( base_url: impl AsRef<str>, api_key: impl Into<String>, http: Client, ) -> Result<Self>
Create a new client with a caller-supplied reqwest::Client.
Sourcepub async fn list_applications(
&self,
opts: &ListApplicationsOptions,
) -> Result<Page<Vec<Application>>>
pub async fn list_applications( &self, opts: &ListApplicationsOptions, ) -> Result<Page<Vec<Application>>>
GET /v1/applications
Sourcepub async fn get_application(&self, application_id: &str) -> Result<Application>
pub async fn get_application(&self, application_id: &str) -> Result<Application>
GET /v1/applications/{application_id}
Sourcepub async fn list_versions(
&self,
application_id: &str,
opts: &ListVersionsOptions,
) -> Result<Page<Vec<Version>>>
pub async fn list_versions( &self, application_id: &str, opts: &ListVersionsOptions, ) -> Result<Page<Vec<Version>>>
GET /v1/applications/{application_id}/versions
Sourcepub async fn list_version_files(
&self,
application_id: &str,
version: &str,
) -> Result<Vec<VersionFile>>
pub async fn list_version_files( &self, application_id: &str, version: &str, ) -> Result<Vec<VersionFile>>
GET /v1/applications/{application_id}/versions/{version}/files
Sourcepub async fn get_download_info(
&self,
application_id: &str,
version: &str,
opts: &GetDownloadInfoOptions,
) -> Result<DownloadInfo>
pub async fn get_download_info( &self, application_id: &str, version: &str, opts: &GetDownloadInfoOptions, ) -> Result<DownloadInfo>
GET /v1/downloads/url — generate a pre-signed download URL.
POST /v1/downloads/share — mint a public share link.
Sourcepub async fn public_download(&self, token: &str) -> Result<Response>
pub async fn public_download(&self, token: &str) -> Result<Response>
Convenience helper for GET /v1/downloads/d/{token}. Returns the
underlying response (which is typically a 302 redirect to a
pre-signed S3 URL). reqwest follows redirects by default, so the
body is the downloaded bytes.
This endpoint requires no authentication.
Sourcepub async fn download(
&self,
application_id: &str,
version: &str,
opts: &GetDownloadInfoOptions,
) -> Result<(DownloadInfo, Bytes)>
pub async fn download( &self, application_id: &str, version: &str, opts: &GetDownloadInfoOptions, ) -> Result<(DownloadInfo, Bytes)>
Download the bytes for the given application/version. Uses
Client::get_download_info to obtain the pre-signed URL and
streams it in full.