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 (issue statuses). Returns a paginated list of workflow states visible to the authenticated user, across all teams they have access to.
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 in the workspace. Supports filtering, sorting, and pagination.
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 making the API request.
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    /// Returns all projects in the workspace, with optional filtering and sorting.
37    ///
38    /// Full type: [`Project`](super::types::Project)
39    pub fn projects<T>(&self) -> ProjectsQueryBuilder<'_, T> {
40        crate::generated::queries::projects(self)
41    }
42    /// Returns a single project by its identifier or URL slug.
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 the user can access. This includes public teams and private teams the user is a member of. This may differ from `administrableTeams`, which returns teams whose settings the user can change but whose issues they don't necessarily have access to.
52    ///
53    /// Full type: [`Team`](super::types::Team)
54    pub fn teams<T>(&self) -> TeamsQueryBuilder<'_, T> {
55        crate::generated::queries::teams(self)
56    }
57    /// Fetches a specific team by its ID.
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 by text query using full-text and vector search. Results are ranked by relevance unless an orderBy parameter is specified. Supports optional issue filters and comment inclusion. Rate-limited to 30 requests per minute.
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    /// Returns all project statuses in the workspace.
73    ///
74    /// Full type: [`ProjectStatus`](super::types::ProjectStatus)
75    pub fn project_statuses<T>(&self) -> ProjectStatusesQueryBuilder<'_, T> {
76        crate::generated::queries::project_statuses(self)
77    }
78    /// Returns all project milestones in the workspace, with optional filtering.
79    ///
80    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
81    pub fn project_milestones<T>(&self) -> ProjectMilestonesQueryBuilder<'_, T> {
82        crate::generated::queries::project_milestones(self)
83    }
84    /// Returns a single project milestone by its identifier.
85    ///
86    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
87    pub async fn project_milestone<
88        T: DeserializeOwned + GraphQLFields<FullType = super::types::ProjectMilestone>,
89    >(
90        &self,
91        id: String,
92    ) -> Result<T, LinearError> {
93        crate::generated::queries::project_milestone::<T>(self, id).await
94    }
95    /// Returns all project labels in the workspace, with optional filtering.
96    ///
97    /// Full type: [`ProjectLabel`](super::types::ProjectLabel)
98    pub fn project_labels<T>(&self) -> ProjectLabelsQueryBuilder<'_, T> {
99        crate::generated::queries::project_labels(self)
100    }
101    /// All issues. Returns a paginated list of issues visible to the authenticated user. Can be filtered by various criteria including team, assignee, state, labels, project, and cycle.
102    ///
103    /// Full type: [`Issue`](super::types::Issue)
104    pub fn issues<T>(&self) -> IssuesQueryBuilder<'_, T> {
105        crate::generated::queries::issues(self)
106    }
107    /// One specific issue, looked up by its unique identifier.
108    ///
109    /// Full type: [`Issue`](super::types::Issue)
110    pub async fn issue<T: DeserializeOwned + GraphQLFields<FullType = super::types::Issue>>(
111        &self,
112        id: String,
113    ) -> Result<T, LinearError> {
114        crate::generated::queries::issue::<T>(self, id).await
115    }
116    /// Find issue based on the VCS branch name.
117    ///
118    /// Full type: [`Issue`](super::types::Issue)
119    pub async fn issue_vcs_branch_search<
120        T: DeserializeOwned + GraphQLFields<FullType = super::types::Issue>,
121    >(
122        &self,
123        branch_name: String,
124    ) -> Result<Option<T>, LinearError> {
125        crate::generated::queries::issue_vcs_branch_search::<T>(self, branch_name).await
126    }
127    /// All issue relations. Returns a paginated list of all issue relations (blocks, blocked by, relates to, duplicates) visible to the authenticated user.
128    ///
129    /// Full type: [`IssueRelation`](super::types::IssueRelation)
130    pub fn issue_relations<T>(&self) -> IssueRelationsQueryBuilder<'_, T> {
131        crate::generated::queries::issue_relations(self)
132    }
133    /// One specific issue relation, looked up by its unique identifier.
134    ///
135    /// Full type: [`IssueRelation`](super::types::IssueRelation)
136    pub async fn issue_relation<
137        T: DeserializeOwned + GraphQLFields<FullType = super::types::IssueRelation>,
138    >(
139        &self,
140        id: String,
141    ) -> Result<T, LinearError> {
142        crate::generated::queries::issue_relation::<T>(self, id).await
143    }
144    /// All issue labels. Returns a paginated list of labels visible to the authenticated user, including both workspace-level and team-scoped labels.
145    ///
146    /// Full type: [`IssueLabel`](super::types::IssueLabel)
147    pub fn issue_labels<T>(&self) -> IssueLabelsQueryBuilder<'_, T> {
148        crate::generated::queries::issue_labels(self)
149    }
150    /// All documents the user has access to in the workspace.
151    ///
152    /// Full type: [`Document`](super::types::Document)
153    pub fn documents<T>(&self) -> DocumentsQueryBuilder<'_, T> {
154        crate::generated::queries::documents(self)
155    }
156    /// A specific document by ID or slug.
157    ///
158    /// Full type: [`Document`](super::types::Document)
159    pub async fn document<
160        T: DeserializeOwned + GraphQLFields<FullType = super::types::Document>,
161    >(
162        &self,
163        id: String,
164    ) -> Result<T, LinearError> {
165        crate::generated::queries::document::<T>(self, id).await
166    }
167    /// All cycles accessible to the user.
168    ///
169    /// Full type: [`Cycle`](super::types::Cycle)
170    pub fn cycles<T>(&self) -> CyclesQueryBuilder<'_, T> {
171        crate::generated::queries::cycles(self)
172    }
173    /// One specific cycle, looked up by ID or slug.
174    ///
175    /// Full type: [`Cycle`](super::types::Cycle)
176    pub async fn cycle<T: DeserializeOwned + GraphQLFields<FullType = super::types::Cycle>>(
177        &self,
178        id: String,
179    ) -> Result<T, LinearError> {
180        crate::generated::queries::cycle::<T>(self, id).await
181    }
182    /// XHR request payload to upload an images, video and other attachments directly to Linear's cloud storage.
183    pub async fn file_upload(
184        &self,
185        meta_data: Option<serde_json::Value>,
186        make_public: Option<bool>,
187        size: i64,
188        content_type: String,
189        filename: String,
190    ) -> Result<serde_json::Value, LinearError> {
191        crate::generated::mutations::file_upload(
192            self,
193            meta_data,
194            make_public,
195            size,
196            content_type,
197            filename,
198        )
199        .await
200    }
201    /// Upload an image from an URL to Linear.
202    pub async fn image_upload_from_url(
203        &self,
204        url: String,
205    ) -> Result<serde_json::Value, LinearError> {
206        crate::generated::mutations::image_upload_from_url(self, url).await
207    }
208    /// Creates a new project.
209    ///
210    /// Full type: [`Project`](super::types::Project)
211    pub async fn project_create<
212        T: serde::de::DeserializeOwned
213            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
214    >(
215        &self,
216        slack_channel_name: Option<String>,
217        input: ProjectCreateInput,
218    ) -> Result<T, LinearError> {
219        crate::generated::mutations::project_create::<T>(self, slack_channel_name, input).await
220    }
221    /// Updates a project.
222    ///
223    /// Full type: [`Project`](super::types::Project)
224    pub async fn project_update<
225        T: serde::de::DeserializeOwned
226            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
227    >(
228        &self,
229        input: ProjectUpdateInput,
230        id: String,
231    ) -> Result<T, LinearError> {
232        crate::generated::mutations::project_update::<T>(self, input, id).await
233    }
234    /// Deletes (trashes) a project. The project can be restored later with projectUnarchive.
235    ///
236    /// Full type: [`Project`](super::types::Project)
237    pub async fn project_delete<
238        T: serde::de::DeserializeOwned
239            + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
240    >(
241        &self,
242        id: String,
243    ) -> Result<T, LinearError> {
244        crate::generated::mutations::project_delete::<T>(self, id).await
245    }
246    /// Creates a new team. The user who creates the team will automatically be added as a member and owner of the newly created team. Default workflow states, labels, and other team resources are created alongside the team.
247    ///
248    /// Full type: [`Team`](super::types::Team)
249    pub async fn team_create<
250        T: serde::de::DeserializeOwned
251            + crate::field_selection::GraphQLFields<FullType = super::types::Team>,
252    >(
253        &self,
254        copy_settings_from_team_id: Option<String>,
255        input: TeamCreateInput,
256    ) -> Result<T, LinearError> {
257        crate::generated::mutations::team_create::<T>(self, copy_settings_from_team_id, input).await
258    }
259    /// Updates a team's settings, properties, or configuration. Requires team owner or workspace admin permissions for most changes.
260    ///
261    /// Full type: [`Team`](super::types::Team)
262    pub async fn team_update<
263        T: serde::de::DeserializeOwned
264            + crate::field_selection::GraphQLFields<FullType = super::types::Team>,
265    >(
266        &self,
267        mapping: Option<InheritanceEntityMapping>,
268        input: TeamUpdateInput,
269        id: String,
270    ) -> Result<T, LinearError> {
271        crate::generated::mutations::team_update::<T>(self, mapping, input, id).await
272    }
273    /// Archives a team and schedules its data for deletion. Requires team owner or workspace admin permissions.
274    pub async fn team_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
275        crate::generated::mutations::team_delete(self, id).await
276    }
277    /// Creates a new team membership, adding a user to a team. Validates that the user is not already a member, the team is not archived or retired, and the requesting user has permission to add members.
278    ///
279    /// Full type: [`TeamMembership`](super::types::TeamMembership)
280    pub async fn team_membership_create<
281        T: serde::de::DeserializeOwned
282            + crate::field_selection::GraphQLFields<FullType = super::types::TeamMembership>,
283    >(
284        &self,
285        input: TeamMembershipCreateInput,
286    ) -> Result<T, LinearError> {
287        crate::generated::mutations::team_membership_create::<T>(self, input).await
288    }
289    /// Deletes a team membership, removing the user from the team. Users can remove their own membership, or team owners and workspace admins can remove other members.
290    pub async fn team_membership_delete(
291        &self,
292        also_leave_parent_teams: Option<bool>,
293        id: String,
294    ) -> Result<serde_json::Value, LinearError> {
295        crate::generated::mutations::team_membership_delete(self, also_leave_parent_teams, id).await
296    }
297    /// Creates a new project milestone.
298    ///
299    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
300    pub async fn project_milestone_create<
301        T: serde::de::DeserializeOwned
302            + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
303    >(
304        &self,
305        input: ProjectMilestoneCreateInput,
306    ) -> Result<T, LinearError> {
307        crate::generated::mutations::project_milestone_create::<T>(self, input).await
308    }
309    /// Updates a project milestone.
310    ///
311    /// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
312    pub async fn project_milestone_update<
313        T: serde::de::DeserializeOwned
314            + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
315    >(
316        &self,
317        input: ProjectMilestoneUpdateInput,
318        id: String,
319    ) -> Result<T, LinearError> {
320        crate::generated::mutations::project_milestone_update::<T>(self, input, id).await
321    }
322    /// Deletes a project milestone.
323    pub async fn project_milestone_delete(
324        &self,
325        id: String,
326    ) -> Result<serde_json::Value, LinearError> {
327        crate::generated::mutations::project_milestone_delete(self, id).await
328    }
329    /// Creates a new issue.
330    ///
331    /// Full type: [`Issue`](super::types::Issue)
332    pub async fn issue_create<
333        T: serde::de::DeserializeOwned
334            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
335    >(
336        &self,
337        input: IssueCreateInput,
338    ) -> Result<T, LinearError> {
339        crate::generated::mutations::issue_create::<T>(self, input).await
340    }
341    /// Updates an issue.
342    ///
343    /// Full type: [`Issue`](super::types::Issue)
344    pub async fn issue_update<
345        T: serde::de::DeserializeOwned
346            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
347    >(
348        &self,
349        input: IssueUpdateInput,
350        id: String,
351    ) -> Result<T, LinearError> {
352        crate::generated::mutations::issue_update::<T>(self, input, id).await
353    }
354    /// Updates multiple issues at once.
355    ///
356    /// Full type: [`Issue`](super::types::Issue)
357    pub async fn issue_batch_update<
358        T: serde::de::DeserializeOwned
359            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
360    >(
361        &self,
362        input: IssueUpdateInput,
363        ids: Vec<String>,
364    ) -> Result<Vec<T>, LinearError> {
365        crate::generated::mutations::issue_batch_update::<T>(self, input, ids).await
366    }
367    /// Archives an issue.
368    ///
369    /// Full type: [`Issue`](super::types::Issue)
370    pub async fn issue_archive<
371        T: serde::de::DeserializeOwned
372            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
373    >(
374        &self,
375        trash: Option<bool>,
376        id: String,
377    ) -> Result<T, LinearError> {
378        crate::generated::mutations::issue_archive::<T>(self, trash, id).await
379    }
380    /// Unarchives an issue.
381    ///
382    /// Full type: [`Issue`](super::types::Issue)
383    pub async fn issue_unarchive<
384        T: serde::de::DeserializeOwned
385            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
386    >(
387        &self,
388        id: String,
389    ) -> Result<T, LinearError> {
390        crate::generated::mutations::issue_unarchive::<T>(self, id).await
391    }
392    /// Deletes (trashes) an issue.
393    ///
394    /// Full type: [`Issue`](super::types::Issue)
395    pub async fn issue_delete<
396        T: serde::de::DeserializeOwned
397            + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
398    >(
399        &self,
400        permanently_delete: Option<bool>,
401        id: String,
402    ) -> Result<T, LinearError> {
403        crate::generated::mutations::issue_delete::<T>(self, permanently_delete, id).await
404    }
405    /// Creates a new issue relation.
406    ///
407    /// Full type: [`IssueRelation`](super::types::IssueRelation)
408    pub async fn issue_relation_create<
409        T: serde::de::DeserializeOwned
410            + crate::field_selection::GraphQLFields<FullType = super::types::IssueRelation>,
411    >(
412        &self,
413        override_created_at: Option<serde_json::Value>,
414        input: IssueRelationCreateInput,
415    ) -> Result<T, LinearError> {
416        crate::generated::mutations::issue_relation_create::<T>(self, override_created_at, input)
417            .await
418    }
419    /// Deletes an issue relation.
420    pub async fn issue_relation_delete(
421        &self,
422        id: String,
423    ) -> Result<serde_json::Value, LinearError> {
424        crate::generated::mutations::issue_relation_delete(self, id).await
425    }
426    /// Creates a new label.
427    ///
428    /// Full type: [`IssueLabel`](super::types::IssueLabel)
429    pub async fn issue_label_create<
430        T: serde::de::DeserializeOwned
431            + crate::field_selection::GraphQLFields<FullType = super::types::IssueLabel>,
432    >(
433        &self,
434        replace_team_labels: Option<bool>,
435        input: IssueLabelCreateInput,
436    ) -> Result<T, LinearError> {
437        crate::generated::mutations::issue_label_create::<T>(self, replace_team_labels, input).await
438    }
439    /// Updates a label.
440    ///
441    /// Full type: [`IssueLabel`](super::types::IssueLabel)
442    pub async fn issue_label_update<
443        T: serde::de::DeserializeOwned
444            + crate::field_selection::GraphQLFields<FullType = super::types::IssueLabel>,
445    >(
446        &self,
447        replace_team_labels: Option<bool>,
448        input: IssueLabelUpdateInput,
449        id: String,
450    ) -> Result<T, LinearError> {
451        crate::generated::mutations::issue_label_update::<T>(self, replace_team_labels, input, id)
452            .await
453    }
454    /// Deletes an issue label.
455    pub async fn issue_label_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
456        crate::generated::mutations::issue_label_delete(self, id).await
457    }
458    /// Creates a new document.
459    ///
460    /// Full type: [`Document`](super::types::Document)
461    pub async fn document_create<
462        T: serde::de::DeserializeOwned
463            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
464    >(
465        &self,
466        input: DocumentCreateInput,
467    ) -> Result<T, LinearError> {
468        crate::generated::mutations::document_create::<T>(self, input).await
469    }
470    /// Updates a document.
471    ///
472    /// Full type: [`Document`](super::types::Document)
473    pub async fn document_update<
474        T: serde::de::DeserializeOwned
475            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
476    >(
477        &self,
478        input: DocumentUpdateInput,
479        id: String,
480    ) -> Result<T, LinearError> {
481        crate::generated::mutations::document_update::<T>(self, input, id).await
482    }
483    /// Deletes (trashes) a document. The document is marked as trashed and archived, but not permanently removed.
484    ///
485    /// Full type: [`Document`](super::types::Document)
486    pub async fn document_delete<
487        T: serde::de::DeserializeOwned
488            + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
489    >(
490        &self,
491        id: String,
492    ) -> Result<T, LinearError> {
493        crate::generated::mutations::document_delete::<T>(self, id).await
494    }
495    /// Creates a new comment.
496    ///
497    /// Full type: [`Comment`](super::types::Comment)
498    pub async fn comment_create<
499        T: serde::de::DeserializeOwned
500            + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
501    >(
502        &self,
503        input: CommentCreateInput,
504    ) -> Result<T, LinearError> {
505        crate::generated::mutations::comment_create::<T>(self, input).await
506    }
507    /// Updates a comment.
508    ///
509    /// Full type: [`Comment`](super::types::Comment)
510    pub async fn comment_update<
511        T: serde::de::DeserializeOwned
512            + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
513    >(
514        &self,
515        skip_edited_at: Option<bool>,
516        input: CommentUpdateInput,
517        id: String,
518    ) -> Result<T, LinearError> {
519        crate::generated::mutations::comment_update::<T>(self, skip_edited_at, input, id).await
520    }
521    /// Deletes a comment.
522    pub async fn comment_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
523        crate::generated::mutations::comment_delete(self, id).await
524    }
525    /// Resolves a comment thread. Marks the root comment as resolved by the current user.
526    ///
527    /// Full type: [`Comment`](super::types::Comment)
528    pub async fn comment_resolve<
529        T: serde::de::DeserializeOwned
530            + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
531    >(
532        &self,
533        resolving_comment_id: Option<String>,
534        id: String,
535    ) -> Result<T, LinearError> {
536        crate::generated::mutations::comment_resolve::<T>(self, resolving_comment_id, id).await
537    }
538    /// Unresolves a previously resolved comment thread. Clears the resolved state on the root comment.
539    ///
540    /// Full type: [`Comment`](super::types::Comment)
541    pub async fn comment_unresolve<
542        T: serde::de::DeserializeOwned
543            + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
544    >(
545        &self,
546        id: String,
547    ) -> Result<T, LinearError> {
548        crate::generated::mutations::comment_unresolve::<T>(self, id).await
549    }
550}