pub struct LinearClient { /* private fields */ }Implementations§
Source§impl LinearClient
impl LinearClient
pub fn new(config: &Config) -> Result<Self>
Sourcepub fn with_api_key(api_key: &str) -> Self
pub fn with_api_key(api_key: &str) -> Self
Create a client with an explicit API key (for FFI callers).
Sourcepub fn with_http_client(client: Client, api_key: &str) -> Self
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).
pub async fn list_teams(&self) -> Result<Vec<TeamNode>>
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>)>
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>
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)>
pub async fn add_comment(&self, issue_id: &str, body: &str) -> Result<()>
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<()>
pub async fn fetch_single_issue( &self, issue_id: &str, ) -> Result<(Issue, Vec<Relation>)>
Sourcepub async fn fetch_issue_by_identifier(
&self,
identifier: &str,
) -> Result<Option<(Issue, Vec<Relation>)>>
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.
Sourcepub async fn get_team_id(&self, team_key: &str) -> Result<String>
pub async fn get_team_id(&self, team_key: &str) -> Result<String>
Get a team’s ID from its key
Sourcepub async fn get_state_id(
&self,
team_key: &str,
state_name: &str,
) -> Result<String>
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”).
Sourcepub async fn get_label_ids(&self, label_names: &[String]) -> Result<Vec<String>>
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.
Sourcepub async fn get_project_id(&self, project_name: &str) -> Result<String>
pub async fn get_project_id(&self, project_name: &str) -> Result<String>
Resolve a project name to its ID. Matches case-insensitively.
Sourcepub async fn create_relation(
&self,
issue_id: &str,
related_issue_id: &str,
relation_type: &str,
) -> Result<String>
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.
Sourcepub async fn delete_relation(&self, relation_id: &str) -> Result<()>
pub async fn delete_relation(&self, relation_id: &str) -> Result<()>
Delete a relation by its ID.
Trait Implementations§
Source§impl Clone for LinearClient
impl Clone for LinearClient
Source§fn clone(&self) -> LinearClient
fn clone(&self) -> LinearClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more