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 project.
186    ///
187    /// Full type: [`Project`](super::types::Project)
188    pub async fn project_create<
189        T: serde::de::DeserializeOwned
190            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
191    >(
192        &self,
193        slack_channel_name: Option<String>,
194        input: ProjectCreateInput,
195    ) -> Result<T, LinearError> {
196        crate::generated::mutations::project_create::<T>(self, slack_channel_name, input).await
197    }
198    /// Updates a project.
199    ///
200    /// Full type: [`Project`](super::types::Project)
201    pub async fn project_update<
202        T: serde::de::DeserializeOwned
203            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
204    >(
205        &self,
206        input: ProjectUpdateInput,
207        id: String,
208    ) -> Result<T, LinearError> {
209        crate::generated::mutations::project_update::<T>(self, input, id).await
210    }
211    /// Deletes (trashes) a project.
212    ///
213    /// Full type: [`Project`](super::types::Project)
214    pub async fn project_delete<
215        T: serde::de::DeserializeOwned
216            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
217    >(
218        &self,
219        id: String,
220    ) -> Result<T, LinearError> {
221        crate::generated::mutations::project_delete::<T>(self, id).await
222    }
223    /// Creates a new project milestone.
224    ///
225    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
226    pub async fn project_milestone_create<
227        T: serde::de::DeserializeOwned
228            + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
229    >(
230        &self,
231        input: ProjectMilestoneCreateInput,
232    ) -> Result<T, LinearError> {
233        crate::generated::mutations::project_milestone_create::<T>(self, input).await
234    }
235    /// Updates a project milestone.
236    ///
237    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
238    pub async fn project_milestone_update<
239        T: serde::de::DeserializeOwned
240            + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
241    >(
242        &self,
243        input: ProjectMilestoneUpdateInput,
244        id: String,
245    ) -> Result<T, LinearError> {
246        crate::generated::mutations::project_milestone_update::<T>(self, input, id).await
247    }
248    /// Deletes a project milestone.
249    pub async fn project_milestone_delete(
250        &self,
251        id: String,
252    ) -> Result<serde_json::Value, LinearError> {
253        crate::generated::mutations::project_milestone_delete(self, id).await
254    }
255    /// Creates a new issue.
256    ///
257    /// Full type: [`Issue`](super::types::Issue)
258    pub async fn issue_create<
259        T: serde::de::DeserializeOwned
260            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
261    >(
262        &self,
263        input: IssueCreateInput,
264    ) -> Result<T, LinearError> {
265        crate::generated::mutations::issue_create::<T>(self, input).await
266    }
267    /// Updates an issue.
268    ///
269    /// Full type: [`Issue`](super::types::Issue)
270    pub async fn issue_update<
271        T: serde::de::DeserializeOwned
272            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
273    >(
274        &self,
275        input: IssueUpdateInput,
276        id: String,
277    ) -> Result<T, LinearError> {
278        crate::generated::mutations::issue_update::<T>(self, input, id).await
279    }
280    /// Archives an issue.
281    ///
282    /// Full type: [`Issue`](super::types::Issue)
283    pub async fn issue_archive<
284        T: serde::de::DeserializeOwned
285            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
286    >(
287        &self,
288        trash: Option<bool>,
289        id: String,
290    ) -> Result<T, LinearError> {
291        crate::generated::mutations::issue_archive::<T>(self, trash, id).await
292    }
293    /// Unarchives an issue.
294    ///
295    /// Full type: [`Issue`](super::types::Issue)
296    pub async fn issue_unarchive<
297        T: serde::de::DeserializeOwned
298            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
299    >(
300        &self,
301        id: String,
302    ) -> Result<T, LinearError> {
303        crate::generated::mutations::issue_unarchive::<T>(self, id).await
304    }
305    /// Deletes (trashes) an issue.
306    ///
307    /// Full type: [`Issue`](super::types::Issue)
308    pub async fn issue_delete<
309        T: serde::de::DeserializeOwned
310            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
311    >(
312        &self,
313        permanently_delete: Option<bool>,
314        id: String,
315    ) -> Result<T, LinearError> {
316        crate::generated::mutations::issue_delete::<T>(self, permanently_delete, id).await
317    }
318    /// Creates a new issue relation.
319    ///
320    /// Full type: [`IssueRelation`](super::types::IssueRelation)
321    pub async fn issue_relation_create<
322        T: serde::de::DeserializeOwned
323            + crate::field_selection::GraphQLFields<FullType = super::types::IssueRelation>,
324    >(
325        &self,
326        override_created_at: Option<serde_json::Value>,
327        input: IssueRelationCreateInput,
328    ) -> Result<T, LinearError> {
329        crate::generated::mutations::issue_relation_create::<T>(self, override_created_at, input)
330            .await
331    }
332    /// Creates a new document.
333    ///
334    /// Full type: [`Document`](super::types::Document)
335    pub async fn document_create<
336        T: serde::de::DeserializeOwned
337            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
338    >(
339        &self,
340        input: DocumentCreateInput,
341    ) -> Result<T, LinearError> {
342        crate::generated::mutations::document_create::<T>(self, input).await
343    }
344    /// Updates a document.
345    ///
346    /// Full type: [`Document`](super::types::Document)
347    pub async fn document_update<
348        T: serde::de::DeserializeOwned
349            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
350    >(
351        &self,
352        input: DocumentUpdateInput,
353        id: String,
354    ) -> Result<T, LinearError> {
355        crate::generated::mutations::document_update::<T>(self, input, id).await
356    }
357    /// Deletes (trashes) a document.
358    ///
359    /// Full type: [`Document`](super::types::Document)
360    pub async fn document_delete<
361        T: serde::de::DeserializeOwned
362            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
363    >(
364        &self,
365        id: String,
366    ) -> Result<T, LinearError> {
367        crate::generated::mutations::document_delete::<T>(self, id).await
368    }
369    /// Creates a new comment.
370    ///
371    /// Full type: [`Comment`](super::types::Comment)
372    pub async fn comment_create<
373        T: serde::de::DeserializeOwned
374            + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
375    >(
376        &self,
377        input: CommentCreateInput,
378    ) -> Result<T, LinearError> {
379        crate::generated::mutations::comment_create::<T>(self, input).await
380    }
381}