pub struct Client { /* private fields */ }Expand description
The Linear API client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn from_token(token: impl Into<String>) -> Result<Self, LinearError>
pub fn from_token(token: impl Into<String>) -> Result<Self, LinearError>
Create a client with an explicit API token.
Sourcepub fn from_env() -> Result<Self, LinearError>
pub fn from_env() -> Result<Self, LinearError>
Create a client from the LINEAR_API_TOKEN environment variable.
Sourcepub fn from_file() -> Result<Self, LinearError>
pub fn from_file() -> Result<Self, LinearError>
Create a client from the ~/.linear_api_token file.
Sourcepub fn auto() -> Result<Self, LinearError>
pub fn auto() -> Result<Self, LinearError>
Create a client by auto-detecting the token (env -> file).
Sourcepub async fn execute<T: DeserializeOwned>(
&self,
query: &str,
variables: Value,
data_path: &str,
) -> Result<T, LinearError>
pub async fn execute<T: DeserializeOwned>( &self, query: &str, variables: Value, data_path: &str, ) -> Result<T, LinearError>
Execute a GraphQL query and extract a single object from the response.
Sourcepub async fn execute_connection<T: DeserializeOwned>(
&self,
query: &str,
variables: Value,
data_path: &str,
) -> Result<Connection<T>, LinearError>
pub async fn execute_connection<T: DeserializeOwned>( &self, query: &str, variables: Value, data_path: &str, ) -> Result<Connection<T>, LinearError>
Execute a GraphQL query and extract a Connection from the response.
impl Client
This impl block contains no items.
Allow integration tests (in tests/ directory) to set base URL.
Source§impl Client
impl Client
pub async fn workflow_states( &self, before: Option<String>, after: Option<String>, first: Option<i64>, last: Option<i64>, include_archived: Option<bool>, ) -> Result<Connection<WorkflowState>, LinearError>
pub async fn users( &self, include_disabled: Option<bool>, before: Option<String>, after: Option<String>, first: Option<i64>, last: Option<i64>, include_archived: Option<bool>, ) -> Result<Connection<User>, LinearError>
pub async fn viewer(&self) -> Result<User, LinearError>
pub async fn projects( &self, before: Option<String>, after: Option<String>, first: Option<i64>, last: Option<i64>, include_archived: Option<bool>, ) -> Result<Connection<Project>, LinearError>
pub async fn project(&self, id: String) -> Result<Project, LinearError>
pub async fn teams( &self, before: Option<String>, after: Option<String>, first: Option<i64>, last: Option<i64>, include_archived: Option<bool>, ) -> Result<Connection<Team>, LinearError>
pub async fn team(&self, id: String) -> Result<Team, LinearError>
pub async fn search_issues( &self, before: Option<String>, after: Option<String>, first: Option<i64>, last: Option<i64>, include_archived: Option<bool>, term: String, include_comments: Option<bool>, team_id: Option<String>, ) -> Result<Connection<Issue>, LinearError>
pub async fn issues( &self, before: Option<String>, after: Option<String>, first: Option<i64>, last: Option<i64>, include_archived: Option<bool>, ) -> Result<Connection<Issue>, LinearError>
pub async fn issue(&self, id: String) -> Result<Issue, LinearError>
pub async fn issue_labels( &self, before: Option<String>, after: Option<String>, first: Option<i64>, last: Option<i64>, include_archived: Option<bool>, ) -> Result<Connection<IssueLabel>, LinearError>
pub async fn cycles( &self, before: Option<String>, after: Option<String>, first: Option<i64>, last: Option<i64>, include_archived: Option<bool>, ) -> Result<Connection<Cycle>, LinearError>
pub async fn cycle(&self, id: String) -> Result<Cycle, LinearError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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