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 comment_create( &self, input: CommentCreateInput, ) -> Result<Value, LinearError>
pub async fn issue_create( &self, input: IssueCreateInput, ) -> Result<Value, LinearError>
pub async fn issue_update( &self, input: IssueUpdateInput, id: String, ) -> Result<Value, LinearError>
pub async fn issue_archive( &self, trash: Option<bool>, id: String, ) -> Result<Value, LinearError>
pub async fn issue_delete( &self, permanently_delete: Option<bool>, id: String, ) -> Result<Value, LinearError>
Source§impl Client
impl Client
pub fn workflow_states(&self) -> WorkflowStatesQuery<'_>
pub fn users(&self) -> UsersQuery<'_>
pub async fn whoami(&self) -> Result<User, LinearError>
pub fn projects(&self) -> ProjectsQuery<'_>
pub async fn project(&self, id: String) -> Result<Project, LinearError>
pub fn teams(&self) -> TeamsQuery<'_>
pub async fn team(&self, id: String) -> Result<Team, LinearError>
pub fn search_issues(&self, term: impl Into<String>) -> SearchIssuesQuery<'_>
pub fn issues(&self) -> IssuesQuery<'_>
pub async fn issue(&self, id: String) -> Result<Issue, LinearError>
pub fn issue_labels(&self) -> IssueLabelsQuery<'_>
pub fn cycles(&self) -> CyclesQuery<'_>
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