[−][src]Struct zenkit::ApiClient
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]
&self,
workspace_id: ID,
predicate: P
) -> Result<Option<Arc<User>>, Error> where
P: Fn(&Arc<User>) -> bool,
Find first user matching predicate
pub async fn get_user_id(
&self,
workspace_id: ID,
name: &str
) -> Result<Option<ID>, Error>
[src]
&self,
workspace_id: ID,
name: &str
) -> Result<Option<ID>, Error>
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]
&self,
user_allid: A
) -> Result<SharedAccesses, Error>
Returns shared accesses for user
pub async fn get_list_elements<A: Into<AllId>>(
&self,
list_allid: A
) -> Result<Vec<Element>, Error>
[src]
&self,
list_allid: A
) -> Result<Vec<Element>, Error>
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]
&self,
list_allid: L,
entry_allid: E
) -> Result<Entry, Error>
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]
&self,
list_allid: A,
params: &GetEntriesRequest
) -> Result<Vec<Entry>, Error>
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]
&self,
list_allid: A,
sort: Option<(&str, SortDirection)>,
limit: usize,
skip: usize
) -> Result<Vec<Entry>, Error>
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]
&self,
list_id: ID,
params: &GetEntriesViewRequest
) -> Result<GetEntriesViewResponse, Error>
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]
&self,
list_allid: L,
entry_allid: E,
checklists: Vec<Checklist>
) -> Result<(), Error>
Update checklists
pub async fn delete_entry<L: Into<AllId>, E: Into<AllId>>(
&self,
list_allid: L,
entry_allid: E
) -> Result<DeleteListEntryResponse, Error>
[src]
&self,
list_allid: L,
entry_allid: E
) -> Result<DeleteListEntryResponse, Error>
Delete a list entry
pub async fn get_all_workspaces_and_lists(
&self
) -> Result<Vec<Arc<Workspace>>, Error>
[src]
&self
) -> Result<Vec<Arc<Workspace>>, Error>
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]
&self,
workspace_id: ID,
list_allid: &str
) -> Result<Arc<ListInfo>, Error>
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]
&self,
list_id: ID,
val: Value
) -> Result<Entry, Error>
Creates a new list entry
pub async fn create_webhook(
&self,
webhook: &NewWebhook
) -> Result<Webhook, Error>
[src]
&self,
webhook: &NewWebhook
) -> Result<Webhook, Error>
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]
&self,
list_id: ID,
entry_id: ID,
val: Value
) -> Result<Entry, Error>
Updates list field-value
pub async fn create_list_comment(
&self,
list_id: ID,
comment: &NewComment
) -> Result<Activity, Error>
[src]
&self,
list_id: ID,
comment: &NewComment
) -> Result<Activity, Error>
Creates a new list Comment
pub async fn create_entry_comment(
&self,
list_id: ID,
entry_id: ID,
comment: &NewComment
) -> Result<Activity, Error>
[src]
&self,
list_id: ID,
entry_id: ID,
comment: &NewComment
) -> Result<Activity, Error>
Creates a new list entry Comment
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ApiClient
[src]
impl Send for ApiClient
[src]
impl Sync for ApiClient
[src]
impl Unpin for ApiClient
[src]
impl !UnwindSafe for ApiClient
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,