Skip to main content

LinearClient

Struct LinearClient 

Source
pub struct LinearClient { /* private fields */ }

Implementations§

Source§

impl LinearClient

Source

pub fn new(config: &Config) -> Result<Self>

Source

pub fn with_api_key(api_key: &str) -> Self

Create a client with an explicit API key (for FFI callers).

Source

pub fn with_http_client(client: Client, api_key: &str) -> Self

Create a client reusing an existing reqwest::Client.

Use this when the HTTP client was already constructed inside a tokio runtime context (e.g. from the FFI layer).

Source

pub async fn list_teams(&self) -> Result<Vec<TeamNode>>

Source

pub async fn fetch_issues( &self, team_key: &str, after_cursor: Option<&str>, updated_after: Option<&str>, include_archived: bool, ) -> Result<(Vec<(Issue, Vec<Relation>)>, bool, Option<String>)>

Source

pub async fn sync_team( &self, db: &Database, team_key: &str, workspace_id: &str, full: bool, include_archived: bool, progress: Option<&(dyn Fn(usize) + Send + Sync)>, ) -> Result<usize>

Source

pub async fn create_issue( &self, team_id: &str, title: &str, description: Option<&str>, priority: Option<i32>, label_ids: &[String], parent_id: Option<&str>, ) -> Result<(String, String)>

Source

pub async fn add_comment(&self, issue_id: &str, body: &str) -> Result<()>

Source

pub async fn update_issue( &self, issue_id: &str, title: Option<&str>, description: Option<&str>, priority: Option<i32>, state_id: Option<&str>, label_ids: Option<&[String]>, project_id: Option<&str>, ) -> Result<()>

Source

pub async fn fetch_single_issue( &self, issue_id: &str, ) -> Result<(Issue, Vec<Relation>)>

Source

pub async fn fetch_issue_by_identifier( &self, identifier: &str, ) -> Result<Option<(Issue, Vec<Relation>)>>

Fetch a single issue from Linear by its identifier (e.g., “CUT-537”). Parses the identifier into team key + number and queries via the issues filter.

Source

pub async fn get_team_id(&self, team_key: &str) -> Result<String>

Get a team’s ID from its key

Source

pub async fn get_state_id( &self, team_key: &str, state_name: &str, ) -> Result<String>

Look up a workflow state ID by name for a given team. Matches case-insensitively (e.g. “done”, “cancelled”, “duplicate”).

Source

pub async fn get_label_ids(&self, label_names: &[String]) -> Result<Vec<String>>

Resolve label names to IDs for a workspace. Linear labels are workspace-scoped, not team-scoped. Returns IDs for all matched labels and errors for any not found.

Source

pub async fn get_project_id(&self, project_name: &str) -> Result<String>

Resolve a project name to its ID. Matches case-insensitively.

Source

pub async fn create_relation( &self, issue_id: &str, related_issue_id: &str, relation_type: &str, ) -> Result<String>

Create a relation between two issues. Linear API types: “blocks”, “duplicate”, “related”. If relation_type is “blocked_by”, we swap the issues and create a “blocks” relation.

Source

pub async fn delete_relation(&self, relation_id: &str) -> Result<()>

Delete a relation by its ID.

Trait Implementations§

Source§

impl Clone for LinearClient

Source§

fn clone(&self) -> LinearClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompatExt for T

Source§

fn compat(self) -> Compat<T>

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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