Skip to main content

lineark_sdk/generated/
client_impl.rs

1//! Generated `impl Client` delegation methods.
2//!
3//! This module provides thin wrapper methods on [`Client`] that
4//! delegate to the standalone functions in [`queries`](super::queries) and
5//! [`mutations`](super::mutations).
6//!
7//! Generated by lineark-codegen — do not edit.
8#![allow(clippy::too_many_arguments)]
9use super::inputs::*;
10use super::queries::*;
11use super::types::*;
12use crate::client::Client;
13use crate::error::LinearError;
14impl Client {
15    /// All issue workflow states.
16    pub fn workflow_states(&self) -> WorkflowStatesQueryBuilder<'_> {
17        crate::generated::queries::workflow_states(self)
18    }
19    /// All users for the organization.
20    pub fn users(&self) -> UsersQueryBuilder<'_> {
21        crate::generated::queries::users(self)
22    }
23    /// The currently authenticated user.
24    pub async fn whoami(&self) -> Result<User, LinearError> {
25        crate::generated::queries::whoami(self).await
26    }
27    /// All projects.
28    pub fn projects(&self) -> ProjectsQueryBuilder<'_> {
29        crate::generated::queries::projects(self)
30    }
31    /// One specific project.
32    pub async fn project(&self, id: String) -> Result<Project, LinearError> {
33        crate::generated::queries::project(self, id).await
34    }
35    /// All teams whose issues can be accessed by the user. This might be different from `administrableTeams`, which also includes teams whose settings can be changed by the user.
36    pub fn teams(&self) -> TeamsQueryBuilder<'_> {
37        crate::generated::queries::teams(self)
38    }
39    /// One specific team.
40    pub async fn team(&self, id: String) -> Result<Team, LinearError> {
41        crate::generated::queries::team(self, id).await
42    }
43    /// Search issues.
44    pub fn search_issues(&self, term: impl Into<String>) -> SearchIssuesQueryBuilder<'_> {
45        crate::generated::queries::search_issues(self, term)
46    }
47    /// All issues.
48    pub fn issues(&self) -> IssuesQueryBuilder<'_> {
49        crate::generated::queries::issues(self)
50    }
51    /// One specific issue.
52    pub async fn issue(&self, id: String) -> Result<Issue, LinearError> {
53        crate::generated::queries::issue(self, id).await
54    }
55    /// All issue relationships.
56    pub fn issue_relations(&self) -> IssueRelationsQueryBuilder<'_> {
57        crate::generated::queries::issue_relations(self)
58    }
59    /// One specific issue relation.
60    pub async fn issue_relation(&self, id: String) -> Result<IssueRelation, LinearError> {
61        crate::generated::queries::issue_relation(self, id).await
62    }
63    /// All issue labels.
64    pub fn issue_labels(&self) -> IssueLabelsQueryBuilder<'_> {
65        crate::generated::queries::issue_labels(self)
66    }
67    /// All documents in the workspace.
68    pub fn documents(&self) -> DocumentsQueryBuilder<'_> {
69        crate::generated::queries::documents(self)
70    }
71    /// One specific document.
72    pub async fn document(&self, id: String) -> Result<Document, LinearError> {
73        crate::generated::queries::document(self, id).await
74    }
75    /// All cycles.
76    pub fn cycles(&self) -> CyclesQueryBuilder<'_> {
77        crate::generated::queries::cycles(self)
78    }
79    /// One specific cycle.
80    pub async fn cycle(&self, id: String) -> Result<Cycle, LinearError> {
81        crate::generated::queries::cycle(self, id).await
82    }
83    /// XHR request payload to upload an images, video and other attachments directly to Linear's cloud storage.
84    pub async fn file_upload(
85        &self,
86        meta_data: Option<serde_json::Value>,
87        make_public: Option<bool>,
88        size: i64,
89        content_type: String,
90        filename: String,
91    ) -> Result<serde_json::Value, LinearError> {
92        crate::generated::mutations::file_upload(
93            self,
94            meta_data,
95            make_public,
96            size,
97            content_type,
98            filename,
99        )
100        .await
101    }
102    /// Upload an image from an URL to Linear.
103    pub async fn image_upload_from_url(
104        &self,
105        url: String,
106    ) -> Result<serde_json::Value, LinearError> {
107        crate::generated::mutations::image_upload_from_url(self, url).await
108    }
109    /// Creates a new issue.
110    pub async fn issue_create(
111        &self,
112        input: IssueCreateInput,
113    ) -> Result<serde_json::Value, LinearError> {
114        crate::generated::mutations::issue_create(self, input).await
115    }
116    /// Updates an issue.
117    pub async fn issue_update(
118        &self,
119        input: IssueUpdateInput,
120        id: String,
121    ) -> Result<serde_json::Value, LinearError> {
122        crate::generated::mutations::issue_update(self, input, id).await
123    }
124    /// Archives an issue.
125    pub async fn issue_archive(
126        &self,
127        trash: Option<bool>,
128        id: String,
129    ) -> Result<serde_json::Value, LinearError> {
130        crate::generated::mutations::issue_archive(self, trash, id).await
131    }
132    /// Unarchives an issue.
133    pub async fn issue_unarchive(&self, id: String) -> Result<serde_json::Value, LinearError> {
134        crate::generated::mutations::issue_unarchive(self, id).await
135    }
136    /// Deletes (trashes) an issue.
137    pub async fn issue_delete(
138        &self,
139        permanently_delete: Option<bool>,
140        id: String,
141    ) -> Result<serde_json::Value, LinearError> {
142        crate::generated::mutations::issue_delete(self, permanently_delete, id).await
143    }
144    /// Creates a new issue relation.
145    pub async fn issue_relation_create(
146        &self,
147        override_created_at: Option<serde_json::Value>,
148        input: IssueRelationCreateInput,
149    ) -> Result<serde_json::Value, LinearError> {
150        crate::generated::mutations::issue_relation_create(self, override_created_at, input).await
151    }
152    /// Creates a new document.
153    pub async fn document_create(
154        &self,
155        input: DocumentCreateInput,
156    ) -> Result<serde_json::Value, LinearError> {
157        crate::generated::mutations::document_create(self, input).await
158    }
159    /// Updates a document.
160    pub async fn document_update(
161        &self,
162        input: DocumentUpdateInput,
163        id: String,
164    ) -> Result<serde_json::Value, LinearError> {
165        crate::generated::mutations::document_update(self, input, id).await
166    }
167    /// Deletes (trashes) a document.
168    pub async fn document_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
169        crate::generated::mutations::document_delete(self, id).await
170    }
171    /// Creates a new comment.
172    pub async fn comment_create(
173        &self,
174        input: CommentCreateInput,
175    ) -> Result<serde_json::Value, LinearError> {
176        crate::generated::mutations::comment_create(self, input).await
177    }
178}