pub struct GraphClient<'a> { /* private fields */ }
Expand description
Client for Graph operations
Implementations§
Source§impl<'a> GraphClient<'a>
impl<'a> GraphClient<'a>
pub fn new(client: &'a Client) -> Self
Sourcepub async fn list_graphs(
&self,
filter: Option<&str>,
order: Option<GraphOrder>,
limit: Option<u32>,
cursor: Option<&str>,
) -> Result<Collection<Graph>>
pub async fn list_graphs( &self, filter: Option<&str>, order: Option<GraphOrder>, limit: Option<u32>, cursor: Option<&str>, ) -> Result<Collection<Graph>>
List graphs
Accepted filters:
- owner:
<username>
- tag:
<tag>
- visibility:public|private
Sourcepub fn list_graphs_iterator(
&self,
filter: Option<&str>,
order: Option<GraphOrder>,
) -> CollectionIterator<'_, Graph>
pub fn list_graphs_iterator( &self, filter: Option<&str>, order: Option<GraphOrder>, ) -> CollectionIterator<'_, Graph>
List graphs with pagination support
Sourcepub async fn create_graph(&self, request: &CreateGraphRequest) -> Result<Graph>
pub async fn create_graph(&self, request: &CreateGraphRequest) -> Result<Graph>
Create a new graph
Sourcepub async fn update_graph(
&self,
graph_id: &str,
request: &UpdateGraphRequest,
) -> Result<Graph>
pub async fn update_graph( &self, graph_id: &str, request: &UpdateGraphRequest, ) -> Result<Graph>
Update a graph
Sourcepub async fn delete_graph(&self, graph_id: &str) -> Result<()>
pub async fn delete_graph(&self, graph_id: &str) -> Result<()>
Delete a graph
Sourcepub async fn get_graph_comments(
&self,
graph_id: &str,
limit: Option<u32>,
cursor: Option<&str>,
) -> Result<Collection<Comment>>
pub async fn get_graph_comments( &self, graph_id: &str, limit: Option<u32>, cursor: Option<&str>, ) -> Result<Collection<Comment>>
Get comments on a graph
Sourcepub fn get_graph_comments_iterator(
&self,
graph_id: &str,
) -> CollectionIterator<'_, Comment>
pub fn get_graph_comments_iterator( &self, graph_id: &str, ) -> CollectionIterator<'_, Comment>
Get comments with pagination support
Sourcepub async fn add_graph_comment(
&self,
graph_id: &str,
comment_text: &str,
) -> Result<Comment>
pub async fn add_graph_comment( &self, graph_id: &str, comment_text: &str, ) -> Result<Comment>
Add a comment to a graph
Sourcepub async fn get_graph_relationship<T>(
&self,
graph_id: &str,
relationship: &str,
limit: Option<u32>,
cursor: Option<&str>,
) -> Result<Collection<T>>where
T: DeserializeOwned,
pub async fn get_graph_relationship<T>(
&self,
graph_id: &str,
relationship: &str,
limit: Option<u32>,
cursor: Option<&str>,
) -> Result<Collection<T>>where
T: DeserializeOwned,
Get related objects for a graph
Supported relationships:
- owner: Returns the user who owns the graph
- editors: Returns users who can edit the graph
- viewers: Returns users who can view the graph
- group: Returns the group the graph belongs to
Sourcepub async fn get_graph_relationship_descriptors(
&self,
graph_id: &str,
relationship: &str,
limit: Option<u32>,
cursor: Option<&str>,
) -> Result<Collection<GraphRelationshipDescriptor>>
pub async fn get_graph_relationship_descriptors( &self, graph_id: &str, relationship: &str, limit: Option<u32>, cursor: Option<&str>, ) -> Result<Collection<GraphRelationshipDescriptor>>
Get object descriptors related to a graph (minimal info)
This returns just the related object’s IDs and context attributes instead of returning all attributes
Sourcepub fn get_graph_relationship_iterator<T>(
&self,
graph_id: &str,
relationship: &str,
) -> CollectionIterator<'_, T>where
T: DeserializeOwned + Clone,
pub fn get_graph_relationship_iterator<T>(
&self,
graph_id: &str,
relationship: &str,
) -> CollectionIterator<'_, T>where
T: DeserializeOwned + Clone,
Get a relationship iterator for pagination
Sourcepub async fn add_graph_editors(
&self,
graph_id: &str,
user_ids: &[String],
) -> Result<()>
pub async fn add_graph_editors( &self, graph_id: &str, user_ids: &[String], ) -> Result<()>
Add editors to a graph
Sourcepub async fn remove_graph_editors(
&self,
graph_id: &str,
user_ids: &[String],
) -> Result<()>
pub async fn remove_graph_editors( &self, graph_id: &str, user_ids: &[String], ) -> Result<()>
Remove editors from a graph
Auto Trait Implementations§
impl<'a> Freeze for GraphClient<'a>
impl<'a> !RefUnwindSafe for GraphClient<'a>
impl<'a> Send for GraphClient<'a>
impl<'a> Sync for GraphClient<'a>
impl<'a> Unpin for GraphClient<'a>
impl<'a> !UnwindSafe for GraphClient<'a>
Blanket Implementations§
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