Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }

Implementations§

Source§

impl Client

Source

pub fn new(base: &str, token: Option<String>) -> Result<Self>

Source

pub fn authenticated(&self, token: Option<String>) -> Self

Source

pub fn with_telemetry(self, enabled: bool) -> Self

Apply diagnostic opt-out to every Apps API request, including uploads and downloads.

Source

pub fn base_url(&self) -> &str

Source

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.

Source

pub async fn me(&self) -> Result<Value>

Source

pub async fn register_platform(&self, target: &str) -> Result<Value>

Record this signed-in account’s platform for the author-visible target population.

Source

pub async fn search( &self, query: &str, private: bool, mine: bool, ) -> Result<Value>

Source

pub async fn app(&self, id: &str) -> Result<Value>

Source

pub async fn available(&self, id: &str) -> Result<Value>

Source

pub async fn create( &self, id: &str, name: &str, description: &str, logo: Option<&str>, key: Option<&str>, ) -> Result<Value>

Source

pub async fn edit( &self, id: &str, changes: Value, key: Option<&str>, ) -> Result<Value>

Source

pub async fn action( &self, method: &str, app: &str, rest: &[&str], body: Option<Value>, key: Option<&str>, ) -> Result<Value>

Source

pub async fn resolve( &self, spec: &InstallSpec, target: &str, ) -> Result<Resolution>

Source

pub async fn upload( &self, app: &str, target: &str, bytes: Vec<u8>, key: Option<&str>, ) -> Result<Value>

Source

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.

Source

pub async fn download(&self, resolution: &Resolution) -> Result<Vec<u8>>

Source

pub async fn signing_keys(&self) -> Result<Value>

The public keys that sign this service’s releases.

Source

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.

Source

pub async fn author_keys(&self) -> Result<Value>

Your registered author keys.

Source

pub async fn add_author_key( &self, public_key: &str, name: Option<&str>, key: Option<&str>, ) -> Result<Value>

Register an author public key (base64 Ed25519).

Source

pub async fn revoke_author_key( &self, key_id: &str, reason: Option<&str>, key: Option<&str>, ) -> Result<Value>

Revoke an author key so nothing new can be signed with it.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn subscription(&self, id: &str) -> Result<Value>

Source

pub async fn create_subscription( &self, subscription: &NewSubscription, key: Option<&str>, ) -> Result<Value>

Subscribe. A webhook subscription’s secret is in the result once.

Source

pub async fn update_subscription( &self, id: &str, changes: Value, key: Option<&str>, ) -> Result<Value>

Change types, channels, delivery, description or status.

Source

pub async fn pause_subscription( &self, id: &str, key: Option<&str>, ) -> Result<Value>

Source

pub async fn resume_subscription( &self, id: &str, key: Option<&str>, ) -> Result<Value>

Source

pub async fn cancel_subscription( &self, id: &str, key: Option<&str>, ) -> Result<Value>

Source

pub async fn subscription_deliveries( &self, id: &str, status: Option<&str>, ) -> Result<Value>

Source

pub async fn rotate_subscription_secret( &self, id: &str, key: Option<&str>, ) -> Result<Value>

Source

pub async fn ping_subscription( &self, id: &str, key: Option<&str>, ) -> Result<Value>

Queue a signed ping delivery to a webhook subscription.

Source

pub async fn report( &self, message: &str, pr: Option<&str>, key: Option<&str>, ) -> Result<Value>

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more