pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new(base: &str, token: Option<String>) -> Result<Self>
pub fn authenticated(&self, token: Option<String>) -> Self
Sourcepub fn with_telemetry(self, enabled: bool) -> Self
pub fn with_telemetry(self, enabled: bool) -> Self
Apply diagnostic opt-out to every Apps API request, including uploads and downloads.
pub fn base_url(&self) -> &str
Sourcepub async fn request(
&self,
method: &str,
path: &[&str],
query: &[(&str, String)],
body: Option<Value>,
idempotency_key: Option<&str>,
) -> Result<Value>
pub async fn request( &self, method: &str, path: &[&str], query: &[(&str, String)], body: Option<Value>, idempotency_key: Option<&str>, ) -> Result<Value>
Author/user endpoint escape hatch; CLI features all call this primary package interface.
pub async fn me(&self) -> Result<Value>
Sourcepub async fn register_platform(&self, target: &str) -> Result<Value>
pub async fn register_platform(&self, target: &str) -> Result<Value>
Record this signed-in account’s platform for the author-visible target population.
pub async fn search( &self, query: &str, private: bool, mine: bool, ) -> Result<Value>
pub async fn app(&self, id: &str) -> Result<Value>
pub async fn available(&self, id: &str) -> Result<Value>
pub async fn create( &self, id: &str, name: &str, description: &str, logo: Option<&str>, key: Option<&str>, ) -> Result<Value>
pub async fn edit( &self, id: &str, changes: Value, key: Option<&str>, ) -> Result<Value>
pub async fn action( &self, method: &str, app: &str, rest: &[&str], body: Option<Value>, key: Option<&str>, ) -> Result<Value>
pub async fn resolve( &self, spec: &InstallSpec, target: &str, ) -> Result<Resolution>
pub async fn upload( &self, app: &str, target: &str, bytes: Vec<u8>, key: Option<&str>, ) -> Result<Value>
Sourcepub async fn upload_signed(
&self,
app: &str,
target: &str,
bytes: Vec<u8>,
author: Option<&AuthorKey>,
key: Option<&str>,
) -> Result<Value>
pub async fn upload_signed( &self, app: &str, target: &str, bytes: Vec<u8>, author: Option<&AuthorKey>, key: Option<&str>, ) -> Result<Value>
Upload a package, signed with your author key when one is given.
pub async fn download(&self, resolution: &Resolution) -> Result<Vec<u8>>
Sourcepub async fn signing_keys(&self) -> Result<Value>
pub async fn signing_keys(&self) -> Result<Value>
The public keys that sign this service’s releases.
Sourcepub async fn withdraw_release(
&self,
app: &str,
release_id: &str,
reason: &str,
key: Option<&str>,
) -> Result<Value>
pub async fn withdraw_release( &self, app: &str, release_id: &str, reason: &str, key: Option<&str>, ) -> Result<Value>
Withdraw a bad release. It stops being served; installs and the updater move to the latest good release on its channel.
Your registered author keys.
Register an author public key (base64 Ed25519).
Revoke an author key so nothing new can be signed with it.
Sourcepub async fn capabilities(&self, require: &[&str]) -> Result<Value>
pub async fn capabilities(&self, require: &[&str]) -> Result<Value>
What this server supports, answering require queries such as
streaming, subscriptions or target:linux-x86_64 in requirements.
Sourcepub async fn events(
&self,
feed: &Feed,
after: Option<i64>,
types: &[&str],
limit: Option<u32>,
) -> Result<Value>
pub async fn events( &self, feed: &Feed, after: Option<i64>, types: &[&str], limit: Option<u32>, ) -> Result<Value>
One page of a feed as JSON, after the event seq after.
Sourcepub async fn stream_events(
&self,
feed: &Feed,
last_event_id: Option<&str>,
types: &[&str],
) -> Result<EventStream>
pub async fn stream_events( &self, feed: &Feed, last_event_id: Option<&str>, types: &[&str], ) -> Result<EventStream>
Open a server-sent event stream. Without last_event_id it starts at
the newest event, or where a subscription’s stream last stopped.
Sourcepub async fn subscriptions(&self, status: Option<&str>) -> Result<Value>
pub async fn subscriptions(&self, status: Option<&str>) -> Result<Value>
Your subscriptions. status is active, paused, cancelled or all;
the default lists active and paused ones.
pub async fn subscription(&self, id: &str) -> Result<Value>
Sourcepub async fn create_subscription(
&self,
subscription: &NewSubscription,
key: Option<&str>,
) -> Result<Value>
pub async fn create_subscription( &self, subscription: &NewSubscription, key: Option<&str>, ) -> Result<Value>
Subscribe. A webhook subscription’s secret is in the result once.
Sourcepub async fn update_subscription(
&self,
id: &str,
changes: Value,
key: Option<&str>,
) -> Result<Value>
pub async fn update_subscription( &self, id: &str, changes: Value, key: Option<&str>, ) -> Result<Value>
Change types, channels, delivery, description or status.
pub async fn pause_subscription( &self, id: &str, key: Option<&str>, ) -> Result<Value>
pub async fn resume_subscription( &self, id: &str, key: Option<&str>, ) -> Result<Value>
pub async fn cancel_subscription( &self, id: &str, key: Option<&str>, ) -> Result<Value>
pub async fn subscription_deliveries( &self, id: &str, status: Option<&str>, ) -> Result<Value>
pub async fn rotate_subscription_secret( &self, id: &str, key: Option<&str>, ) -> Result<Value>
Sourcepub async fn ping_subscription(
&self,
id: &str,
key: Option<&str>,
) -> Result<Value>
pub async fn ping_subscription( &self, id: &str, key: Option<&str>, ) -> Result<Value>
Queue a signed ping delivery to a webhook subscription.