[][src]Struct zenkit::ApiClient

pub struct ApiClient { /* fields omitted */ }

Zenkit http/API client

Implementations

impl ApiClient[src]

pub fn get_rate_limit(&self) -> Option<u32>[src]

Returns the rate limit returned on the most recent api call Not yet implemented

pub fn get_rate_limit_remaining(&self) -> Option<u32>[src]

Returns the rate limit remaining on the most recent api call Not yet implemented

pub async fn get_users(&self, workspace_id: ID) -> Result<Vec<Arc<User>>, Error>[src]

Returns users in workspace. This method caches the user list so subsequent calls for the same workspace use the in-memory list.

pub async fn get_users_raw(&self, workspace_id: ID) -> Result<Vec<User>, Error>[src]

Returns users in the workspace. Bypasses cache and uses zenkit api directly. See also get_users.

pub async fn find_user<P>(
    &self,
    workspace_id: ID,
    predicate: P
) -> Result<Option<Arc<User>>, Error> where
    P: Fn(&Arc<User>) -> bool
[src]

Find first user matching predicate

pub async fn get_user_id(
    &self,
    workspace_id: ID,
    name: &str
) -> Result<Option<ID>, Error>
[src]

Finds the user id for the name. Name parameter can be display name, full name, or uuid. String matching is case-insensitive. Return value is Some(id) if found, None if no match, or Err if there was a network problem getting the user list.

pub async fn get_user_accesses(&self) -> Result<Vec<Access>, Error>[src]

get accesses for the user

pub async fn get_shared_accesses<A: Into<AllId>>(
    &self,
    user_allid: A
) -> Result<SharedAccesses, Error>
[src]

Returns shared accesses for user

pub async fn get_list_elements<A: Into<AllId>>(
    &self,
    list_allid: A
) -> Result<Vec<Element>, Error>
[src]

returns schema fields of list

pub async fn get_entry<L: Into<AllId>, E: Into<AllId>>(
    &self,
    list_allid: L,
    entry_allid: E
) -> Result<Entry, Error>
[src]

Returns a single list item

pub async fn get_list_entries<A: Into<AllId>>(
    &self,
    list_allid: A,
    params: &GetEntriesRequest
) -> Result<Vec<Entry>, Error>
[src]

Returns items from list (possibly filtered/sorted), with pagination Parameter may be id or uuid. To use name lookup, use get_list_info. See also get_list_entries_for_view

pub async fn get_list_entries_sorted<A: Into<AllId>>(
    &self,
    list_allid: A,
    sort: Option<(&str, SortDirection)>,
    limit: usize,
    skip: usize
) -> Result<Vec<Entry>, Error>
[src]

Returns list items sorted by last update (asc or desc), with pagination Set 'sort' to Some(column-name, direction), e.g., Some("updated_at", Desc)

pub async fn get_list_entries_for_view(
    &self,
    list_id: ID,
    params: &GetEntriesViewRequest
) -> Result<GetEntriesViewResponse, Error>
[src]

Returns items from list - with filter and optional group-by Compared to get_list_entries, this fn allows optional grouping, and optionally can return deprecated items, and doesn't allow sorting.

pub async fn update_checklists<L: Into<AllId>, E: Into<AllId>>(
    &self,
    list_allid: L,
    entry_allid: E,
    checklists: Vec<Checklist>
) -> Result<(), Error>
[src]

Update checklists

pub async fn delete_entry<L: Into<AllId>, E: Into<AllId>>(
    &self,
    list_allid: L,
    entry_allid: E
) -> Result<DeleteListEntryResponse, Error>
[src]

Delete a list entry

pub async fn get_all_workspaces_and_lists(
    &self
) -> Result<Vec<Arc<Workspace>>, Error>
[src]

Loads all workspaces and lists that the current user can access.

Performance notes:

  • Repeaded calls return cached data.

pub async fn get_workspace(&self, ws_id: &str) -> Result<Arc<Workspace>, Error>[src]

Returns the workspace. ws_id may be ID, UUID, or title.

Performance notes:

  • If ID or UUID are known, those are preferred over title due to a potential performance benefit.
  • If you expect to call this for more than one workspace during a single app session, it is almost always more efficient to call get_all_workspaces_and_lists first, so that all workspaces are fetched with a single hit to Zenkit servers.
  • If called more than once for the same workspace id (or an alternate identifier of a previously-loaded workspace), a cached value is returned.
  • If get_all_workspaces_and_lists has been called previously, this function returns cached data and does not incur additional Zenkit server hits if ws_id is valid.
  • Non-matching parameters are more expensive, performance-wise. If the name does not match cached workspaces, an additional query will always be performed.

pub async fn get_list_info(
    &self,
    workspace_id: ID,
    list_allid: &str
) -> Result<Arc<ListInfo>, Error>
[src]

Retrieves a list, with field definitions. list_name parameter can be string name, id, or uuid

pub fn clear_workspace_cache(&self) -> Result<(), Error>[src]

Clears workspace cache

pub fn clear_list_cache(&self) -> Result<(), Error>[src]

Clears ListInfo cache. Note: ListInfo cache contains field definitions, not items.

pub async fn create_entry(
    &self,
    list_id: ID,
    val: Value
) -> Result<Entry, Error>
[src]

Creates a new list entry

pub async fn create_webhook(
    &self,
    webhook: &NewWebhook
) -> Result<Webhook, Error>
[src]

Creates a new webhook

pub async fn delete_webhook(&self, webhook_id: ID) -> Result<Webhook, Error>[src]

Deletes webhook

pub async fn get_webhooks(&self) -> Result<Vec<Webhook>, Error>[src]

List webhooks created by the current user

pub async fn update_entry(
    &self,
    list_id: ID,
    entry_id: ID,
    val: Value
) -> Result<Entry, Error>
[src]

Updates list field-value

pub async fn create_list_comment(
    &self,
    list_id: ID,
    comment: &NewComment
) -> Result<Activity, Error>
[src]

Creates a new list Comment

pub async fn create_entry_comment(
    &self,
    list_id: ID,
    entry_id: ID,
    comment: &NewComment
) -> Result<Activity, Error>
[src]

Creates a new list entry Comment

Trait Implementations

impl Debug for ApiClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.