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 crate::client::Client;
12use crate::error::LinearError;
13use crate::field_selection::GraphQLFields;
14use serde::de::DeserializeOwned;
15impl Client {
16    /// All issue workflow states.
17    ///
18    /// Full type: [`WorkflowState`](super::types::WorkflowState)
19    pub fn workflow_states<T>(&self) -> WorkflowStatesQueryBuilder<'_, T> {
20        crate::generated::queries::workflow_states(self)
21    }
22    /// All users for the organization.
23    ///
24    /// Full type: [`User`](super::types::User)
25    pub fn users<T>(&self) -> UsersQueryBuilder<'_, T> {
26        crate::generated::queries::users(self)
27    }
28    /// The currently authenticated user.
29    ///
30    /// Full type: [`User`](super::types::User)
31    pub async fn whoami<T: DeserializeOwned + GraphQLFields<FullType = super::types::User>>(
32        &self,
33    ) -> Result<T, LinearError> {
34        crate::generated::queries::whoami::<T>(self).await
35    }
36    /// All projects.
37    ///
38    /// Full type: [`Project`](super::types::Project)
39    pub fn projects<T>(&self) -> ProjectsQueryBuilder<'_, T> {
40        crate::generated::queries::projects(self)
41    }
42    /// One specific project.
43    ///
44    /// Full type: [`Project`](super::types::Project)
45    pub async fn project<T: DeserializeOwned + GraphQLFields<FullType = super::types::Project>>(
46        &self,
47        id: String,
48    ) -> Result<T, LinearError> {
49        crate::generated::queries::project::<T>(self, id).await
50    }
51    /// 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.
52    ///
53    /// Full type: [`Team`](super::types::Team)
54    pub fn teams<T>(&self) -> TeamsQueryBuilder<'_, T> {
55        crate::generated::queries::teams(self)
56    }
57    /// One specific team.
58    ///
59    /// Full type: [`Team`](super::types::Team)
60    pub async fn team<T: DeserializeOwned + GraphQLFields<FullType = super::types::Team>>(
61        &self,
62        id: String,
63    ) -> Result<T, LinearError> {
64        crate::generated::queries::team::<T>(self, id).await
65    }
66    /// Search issues.
67    ///
68    /// Full type: [`IssueSearchResult`](super::types::IssueSearchResult)
69    pub fn search_issues<T>(&self, term: impl Into<String>) -> SearchIssuesQueryBuilder<'_, T> {
70        crate::generated::queries::search_issues(self, term)
71    }
72    /// All milestones for the project.
73    ///
74    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
75    pub fn project_milestones<T>(&self) -> ProjectMilestonesQueryBuilder<'_, T> {
76        crate::generated::queries::project_milestones(self)
77    }
78    /// One specific project milestone.
79    ///
80    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
81    pub async fn project_milestone<
82        T: DeserializeOwned + GraphQLFields<FullType = super::types::ProjectMilestone>,
83    >(
84        &self,
85        id: String,
86    ) -> Result<T, LinearError> {
87        crate::generated::queries::project_milestone::<T>(self, id).await
88    }
89    /// All issues.
90    ///
91    /// Full type: [`Issue`](super::types::Issue)
92    pub fn issues<T>(&self) -> IssuesQueryBuilder<'_, T> {
93        crate::generated::queries::issues(self)
94    }
95    /// One specific issue.
96    ///
97    /// Full type: [`Issue`](super::types::Issue)
98    pub async fn issue<T: DeserializeOwned + GraphQLFields<FullType = super::types::Issue>>(
99        &self,
100        id: String,
101    ) -> Result<T, LinearError> {
102        crate::generated::queries::issue::<T>(self, id).await
103    }
104    /// All issue relationships.
105    ///
106    /// Full type: [`IssueRelation`](super::types::IssueRelation)
107    pub fn issue_relations<T>(&self) -> IssueRelationsQueryBuilder<'_, T> {
108        crate::generated::queries::issue_relations(self)
109    }
110    /// One specific issue relation.
111    ///
112    /// Full type: [`IssueRelation`](super::types::IssueRelation)
113    pub async fn issue_relation<
114        T: DeserializeOwned + GraphQLFields<FullType = super::types::IssueRelation>,
115    >(
116        &self,
117        id: String,
118    ) -> Result<T, LinearError> {
119        crate::generated::queries::issue_relation::<T>(self, id).await
120    }
121    /// All issue labels.
122    ///
123    /// Full type: [`IssueLabel`](super::types::IssueLabel)
124    pub fn issue_labels<T>(&self) -> IssueLabelsQueryBuilder<'_, T> {
125        crate::generated::queries::issue_labels(self)
126    }
127    /// All documents in the workspace.
128    ///
129    /// Full type: [`Document`](super::types::Document)
130    pub fn documents<T>(&self) -> DocumentsQueryBuilder<'_, T> {
131        crate::generated::queries::documents(self)
132    }
133    /// One specific document.
134    ///
135    /// Full type: [`Document`](super::types::Document)
136    pub async fn document<
137        T: DeserializeOwned + GraphQLFields<FullType = super::types::Document>,
138    >(
139        &self,
140        id: String,
141    ) -> Result<T, LinearError> {
142        crate::generated::queries::document::<T>(self, id).await
143    }
144    /// All cycles.
145    ///
146    /// Full type: [`Cycle`](super::types::Cycle)
147    pub fn cycles<T>(&self) -> CyclesQueryBuilder<'_, T> {
148        crate::generated::queries::cycles(self)
149    }
150    /// One specific cycle.
151    ///
152    /// Full type: [`Cycle`](super::types::Cycle)
153    pub async fn cycle<T: DeserializeOwned + GraphQLFields<FullType = super::types::Cycle>>(
154        &self,
155        id: String,
156    ) -> Result<T, LinearError> {
157        crate::generated::queries::cycle::<T>(self, id).await
158    }
159    /// XHR request payload to upload an images, video and other attachments directly to Linear's cloud storage.
160    pub async fn file_upload(
161        &self,
162        meta_data: Option<serde_json::Value>,
163        make_public: Option<bool>,
164        size: i64,
165        content_type: String,
166        filename: String,
167    ) -> Result<serde_json::Value, LinearError> {
168        crate::generated::mutations::file_upload(
169            self,
170            meta_data,
171            make_public,
172            size,
173            content_type,
174            filename,
175        )
176        .await
177    }
178    /// Upload an image from an URL to Linear.
179    pub async fn image_upload_from_url(
180        &self,
181        url: String,
182    ) -> Result<serde_json::Value, LinearError> {
183        crate::generated::mutations::image_upload_from_url(self, url).await
184    }
185    /// Creates a new comment.
186    ///
187    /// Full type: [`Comment`](super::types::Comment)
188    pub async fn comment_create<
189        T: serde::de::DeserializeOwned
190            + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
191    >(
192        &self,
193        input: CommentCreateInput,
194    ) -> Result<T, LinearError> {
195        crate::generated::mutations::comment_create::<T>(self, input).await
196    }
197    /// Creates a new project.
198    ///
199    /// Full type: [`Project`](super::types::Project)
200    pub async fn project_create<
201        T: serde::de::DeserializeOwned
202            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
203    >(
204        &self,
205        slack_channel_name: Option<String>,
206        input: ProjectCreateInput,
207    ) -> Result<T, LinearError> {
208        crate::generated::mutations::project_create::<T>(self, slack_channel_name, input).await
209    }
210    /// Updates a project.
211    ///
212    /// Full type: [`Project`](super::types::Project)
213    pub async fn project_update<
214        T: serde::de::DeserializeOwned
215            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
216    >(
217        &self,
218        input: ProjectUpdateInput,
219        id: String,
220    ) -> Result<T, LinearError> {
221        crate::generated::mutations::project_update::<T>(self, input, id).await
222    }
223    /// Deletes (trashes) a project.
224    ///
225    /// Full type: [`Project`](super::types::Project)
226    pub async fn project_delete<
227        T: serde::de::DeserializeOwned
228            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
229    >(
230        &self,
231        id: String,
232    ) -> Result<T, LinearError> {
233        crate::generated::mutations::project_delete::<T>(self, id).await
234    }
235    /// Creates a new project milestone.
236    ///
237    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
238    pub async fn project_milestone_create<
239        T: serde::de::DeserializeOwned
240            + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
241    >(
242        &self,
243        input: ProjectMilestoneCreateInput,
244    ) -> Result<T, LinearError> {
245        crate::generated::mutations::project_milestone_create::<T>(self, input).await
246    }
247    /// Updates a project milestone.
248    ///
249    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
250    pub async fn project_milestone_update<
251        T: serde::de::DeserializeOwned
252            + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
253    >(
254        &self,
255        input: ProjectMilestoneUpdateInput,
256        id: String,
257    ) -> Result<T, LinearError> {
258        crate::generated::mutations::project_milestone_update::<T>(self, input, id).await
259    }
260    /// Deletes a project milestone.
261    pub async fn project_milestone_delete(
262        &self,
263        id: String,
264    ) -> Result<serde_json::Value, LinearError> {
265        crate::generated::mutations::project_milestone_delete(self, id).await
266    }
267    /// Creates a new issue.
268    ///
269    /// Full type: [`Issue`](super::types::Issue)
270    pub async fn issue_create<
271        T: serde::de::DeserializeOwned
272            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
273    >(
274        &self,
275        input: IssueCreateInput,
276    ) -> Result<T, LinearError> {
277        crate::generated::mutations::issue_create::<T>(self, input).await
278    }
279    /// Updates an issue.
280    ///
281    /// Full type: [`Issue`](super::types::Issue)
282    pub async fn issue_update<
283        T: serde::de::DeserializeOwned
284            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
285    >(
286        &self,
287        input: IssueUpdateInput,
288        id: String,
289    ) -> Result<T, LinearError> {
290        crate::generated::mutations::issue_update::<T>(self, input, id).await
291    }
292    /// Archives an issue.
293    ///
294    /// Full type: [`Issue`](super::types::Issue)
295    pub async fn issue_archive<
296        T: serde::de::DeserializeOwned
297            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
298    >(
299        &self,
300        trash: Option<bool>,
301        id: String,
302    ) -> Result<T, LinearError> {
303        crate::generated::mutations::issue_archive::<T>(self, trash, id).await
304    }
305    /// Unarchives an issue.
306    ///
307    /// Full type: [`Issue`](super::types::Issue)
308    pub async fn issue_unarchive<
309        T: serde::de::DeserializeOwned
310            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
311    >(
312        &self,
313        id: String,
314    ) -> Result<T, LinearError> {
315        crate::generated::mutations::issue_unarchive::<T>(self, id).await
316    }
317    /// Deletes (trashes) an issue.
318    ///
319    /// Full type: [`Issue`](super::types::Issue)
320    pub async fn issue_delete<
321        T: serde::de::DeserializeOwned
322            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
323    >(
324        &self,
325        permanently_delete: Option<bool>,
326        id: String,
327    ) -> Result<T, LinearError> {
328        crate::generated::mutations::issue_delete::<T>(self, permanently_delete, id).await
329    }
330    /// Creates a new issue relation.
331    ///
332    /// Full type: [`IssueRelation`](super::types::IssueRelation)
333    pub async fn issue_relation_create<
334        T: serde::de::DeserializeOwned
335            + crate::field_selection::GraphQLFields<FullType = super::types::IssueRelation>,
336    >(
337        &self,
338        override_created_at: Option<serde_json::Value>,
339        input: IssueRelationCreateInput,
340    ) -> Result<T, LinearError> {
341        crate::generated::mutations::issue_relation_create::<T>(self, override_created_at, input)
342            .await
343    }
344    /// Creates a new document.
345    ///
346    /// Full type: [`Document`](super::types::Document)
347    pub async fn document_create<
348        T: serde::de::DeserializeOwned
349            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
350    >(
351        &self,
352        input: DocumentCreateInput,
353    ) -> Result<T, LinearError> {
354        crate::generated::mutations::document_create::<T>(self, input).await
355    }
356    /// Updates a document.
357    ///
358    /// Full type: [`Document`](super::types::Document)
359    pub async fn document_update<
360        T: serde::de::DeserializeOwned
361            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
362    >(
363        &self,
364        input: DocumentUpdateInput,
365        id: String,
366    ) -> Result<T, LinearError> {
367        crate::generated::mutations::document_update::<T>(self, input, id).await
368    }
369    /// Deletes (trashes) a document.
370    ///
371    /// Full type: [`Document`](super::types::Document)
372    pub async fn document_delete<
373        T: serde::de::DeserializeOwned
374            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
375    >(
376        &self,
377        id: String,
378    ) -> Result<T, LinearError> {
379        crate::generated::mutations::document_delete::<T>(self, id).await
380    }
381}