pub struct LinearClient { /* private fields */ }Implementations§
Source§impl LinearClient
impl LinearClient
pub async fn fetch_projects( &self, after_cursor: Option<&str>, include_archived: bool, workspace_id: &str, ) -> Result<(Vec<Project>, bool, Option<String>)>
pub async fn fetch_project( &self, id: &str, workspace_id: &str, ) -> Result<Project>
pub async fn fetch_project_milestones( &self, after_cursor: Option<&str>, include_archived: bool, workspace_id: &str, ) -> Result<(Vec<ProjectMilestone>, bool, Option<String>)>
pub async fn fetch_project_milestone( &self, id: &str, workspace_id: &str, ) -> Result<ProjectMilestone>
pub async fn fetch_milestones_for_project( &self, project_id: &str, after_cursor: Option<&str>, include_archived: bool, workspace_id: &str, ) -> Result<(Vec<ProjectMilestone>, bool, Option<String>)>
pub async fn sync_projects( &self, db: &Database, workspace_id: &str, ) -> Result<(usize, usize)>
pub async fn create_project(&self, input: &CreateProjectInput) -> Result<String>
pub async fn update_project( &self, id: &str, input: &UpdateProjectInput, ) -> Result<()>
pub async fn delete_project(&self, id: &str) -> Result<()>
pub async fn create_project_milestone( &self, input: &CreateProjectMilestoneInput, ) -> Result<String>
pub async fn update_project_milestone( &self, id: &str, input: &UpdateProjectMilestoneInput, ) -> Result<()>
pub async fn delete_project_milestone(&self, id: &str) -> Result<()>
pub async fn get_project_status_id(&self, status_name: &str) -> Result<String>
pub async fn get_project_label_ids( &self, names: &[String], ) -> Result<Vec<String>>
pub async fn find_project_by_name(&self, id_or_name: &str) -> Result<String>
pub async fn find_project_milestone( &self, project_id: Option<&str>, id_or_name: &str, ) -> Result<String>
pub async fn import_project( &self, db: &Database, workspace_id: &str, id_or_name: &str, ) -> Result<ProjectBundle>
pub async fn import_project_milestone( &self, db: &Database, workspace_id: &str, project_id: Option<&str>, id_or_name: &str, ) -> Result<ProjectMilestoneBundle>
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>, Vec<String>)>, 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, create: CreateIssueInput<'_>, ) -> Result<(String, String)>
pub async fn add_comment(&self, issue_id: &str, body: &str) -> Result<()>
pub async fn fetch_issue_comments(&self, issue_id: &str) -> Result<Vec<Comment>>
pub async fn sync_issue_comments( &self, db: &Database, issue_id: &str, workspace_id: &str, ) -> Result<usize>
pub fn comment_error_status(error: &Error) -> &'static str
pub async fn update_issue( &self, issue_id: &str, update: UpdateIssueInput<'_>, ) -> Result<()>
pub async fn fetch_single_issue( &self, issue_id: &str, ) -> Result<(Issue, Vec<Relation>, Vec<String>)>
Sourcepub async fn fetch_issue_by_identifier(
&self,
identifier: &str,
) -> Result<Option<(Issue, Vec<Relation>, Vec<String>)>>
pub async fn fetch_issue_by_identifier( &self, identifier: &str, ) -> Result<Option<(Issue, Vec<Relation>, Vec<String>)>>
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 resolve_assignee_id(&self, input: &str) -> Result<String>
pub async fn resolve_assignee_id(&self, input: &str) -> Result<String>
Resolve an assignee identifier to a Linear user id.
"me"(case-insensitive) → cachedviewer.id."none"(case-insensitive) → empty string (caller decides whether that’s allowed).- Anything else → case-insensitive
namelookup against the workspace’s users. Errors if zero or multiple matches.
Sourcepub async fn fetch_labels(&self) -> Result<Vec<LabelCatalogEntry>>
pub async fn fetch_labels(&self) -> Result<Vec<LabelCatalogEntry>>
Fetch the full label catalog for the workspace (all pages).
Sourcepub async fn sync_labels_catalog(
&self,
db: &Database,
workspace_id: &str,
) -> Result<usize>
pub async fn sync_labels_catalog( &self, db: &Database, workspace_id: &str, ) -> Result<usize>
Sync the workspace’s label catalog into the local database. Upserts labels by id and removes labels that no longer exist remotely.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more