GraphClient

Struct GraphClient 

Source
pub struct GraphClient<'a> { /* private fields */ }
Expand description

Client for Graph operations

Implementations§

Source§

impl<'a> GraphClient<'a>

Source

pub fn new(client: &'a Client) -> Self

Source

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
Source

pub fn list_graphs_iterator( &self, filter: Option<&str>, order: Option<GraphOrder>, ) -> CollectionIterator<'_, Graph>

List graphs with pagination support

Source

pub async fn get_graph(&self, graph_id: &str) -> Result<Graph>

Get a graph by ID

Source

pub async fn create_graph(&self, request: &CreateGraphRequest) -> Result<Graph>

Create a new graph

Source

pub async fn update_graph( &self, graph_id: &str, request: &UpdateGraphRequest, ) -> Result<Graph>

Update a graph

Source

pub async fn delete_graph(&self, graph_id: &str) -> Result<()>

Delete a graph

Source

pub async fn get_graph_comments( &self, graph_id: &str, limit: Option<u32>, cursor: Option<&str>, ) -> Result<Collection<Comment>>

Get comments on a graph

Source

pub fn get_graph_comments_iterator( &self, graph_id: &str, ) -> CollectionIterator<'_, Comment>

Get comments with pagination support

Source

pub async fn add_graph_comment( &self, graph_id: &str, comment_text: &str, ) -> Result<Comment>

Add a comment to a graph

Source

pub async fn get_graph_relationship<T>( &self, graph_id: &str, relationship: &str, limit: Option<u32>, cursor: Option<&str>, ) -> Result<Collection<T>>

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
Source

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

Source

pub fn get_graph_relationship_iterator<T>( &self, graph_id: &str, relationship: &str, ) -> CollectionIterator<'_, T>

Get a relationship iterator for pagination

Source

pub async fn add_graph_editors( &self, graph_id: &str, user_ids: &[String], ) -> Result<()>

Add editors to a graph

Source

pub async fn remove_graph_editors( &self, graph_id: &str, user_ids: &[String], ) -> Result<()>

Remove editors from a graph

Source

pub async fn add_graph_viewers( &self, graph_id: &str, user_ids: &[String], ) -> Result<()>

Add viewers to a graph

Source

pub async fn remove_graph_viewers( &self, graph_id: &str, user_ids: &[String], ) -> Result<()>

Remove viewers 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> 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<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: 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: 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,