pub struct OrdinaryApiClient<'a> { /* private fields */ }Available on crate feature
client only.Expand description
client for interaction with Ordinary API Server
Implementations§
Source§impl<'a> OrdinaryApiClient<'a>
impl<'a> OrdinaryApiClient<'a>
pub fn new( addr: &'a str, account: &'a str, api_domain: Option<&'a str>, danger_accept_invalid_certs: bool, user_agent: &str, ) -> Result<OrdinaryApiClient<'a>>
pub fn list_accounts() -> Result<Vec<AccountMeta>>
pub fn get_account(host: &str, account: &str) -> Result<AccountMeta>
Sourcepub async fn register(
&self,
password: &str,
invite_code: &str,
) -> Result<(TOTP, String)>
pub async fn register( &self, password: &str, invite_code: &str, ) -> Result<(TOTP, String)>
register with API server
Sourcepub async fn get_access(&self, duration_s: Option<u32>) -> Result<Vec<u8>>
pub async fn get_access(&self, duration_s: Option<u32>) -> Result<Vec<u8>>
get access token for API server
pub async fn reset_password( &self, old_password: &str, mfa_code: &str, new_password: &str, ) -> Result<()>
Sourcepub async fn invite_api_account(
&self,
app_domain: &str,
account_name: &str,
permissions: Vec<u8>,
) -> Result<String>
pub async fn invite_api_account( &self, app_domain: &str, account_name: &str, permissions: Vec<u8>, ) -> Result<String>
invite API account
Sourcepub async fn api_accounts_list(&self, proj_path: Option<&str>) -> Result<String>
pub async fn api_accounts_list(&self, proj_path: Option<&str>) -> Result<String>
list accounts for the API server
Sourcepub async fn app_logs(
&self,
proj_path: &str,
query: &str,
format: &str,
limit: &Option<usize>,
) -> Result<Value>
pub async fn app_logs( &self, proj_path: &str, query: &str, format: &str, limit: &Option<usize>, ) -> Result<Value>
query an app’s logs
Sourcepub async fn app_accounts_list(&self, proj_path: &str) -> Result<String>
pub async fn app_accounts_list(&self, proj_path: &str) -> Result<String>
list accounts for an app
Sourcepub async fn items_list(
&self,
proj_path: &str,
model_name: &str,
) -> Result<String>
pub async fn items_list( &self, proj_path: &str, model_name: &str, ) -> Result<String>
list app items by their model index
Sourcepub async fn write(&self, proj_path: &str, asset_path: &str) -> Result<()>
pub async fn write(&self, proj_path: &str, asset_path: &str) -> Result<()>
write a single asset
Sourcepub async fn write_all(&self, proj_path: &str) -> Result<()>
pub async fn write_all(&self, proj_path: &str) -> Result<()>
write all assets in assets dir_path
Sourcepub async fn upload(&self, proj_path: &str, template_name: &str) -> Result<()>
pub async fn upload(&self, proj_path: &str, template_name: &str) -> Result<()>
upload a single template
Sourcepub async fn upload_all(&self, proj_path: &str) -> Result<()>
pub async fn upload_all(&self, proj_path: &str) -> Result<()>
upload all templates
Sourcepub async fn install(&self, proj_path: &str, action_name: &str) -> Result<()>
pub async fn install(&self, proj_path: &str, action_name: &str) -> Result<()>
install single action
Sourcepub async fn install_all(&self, proj_path: &str) -> Result<()>
pub async fn install_all(&self, proj_path: &str) -> Result<()>
install all actions
Auto Trait Implementations§
impl<'a> Freeze for OrdinaryApiClient<'a>
impl<'a> !RefUnwindSafe for OrdinaryApiClient<'a>
impl<'a> Send for OrdinaryApiClient<'a>
impl<'a> Sync for OrdinaryApiClient<'a>
impl<'a> Unpin for OrdinaryApiClient<'a>
impl<'a> UnsafeUnpin for OrdinaryApiClient<'a>
impl<'a> !UnwindSafe for OrdinaryApiClient<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more