Skip to main content

lineark_sdk/generated/
queries.rs

1//! Generated query methods on Client.
2//!
3//! Generated by lineark-codegen — do not edit.
4use super::types::*;
5use crate::client::Client;
6use crate::error::LinearError;
7use crate::pagination::Connection;
8#[must_use]
9pub struct WorkflowStatesQuery<'a> {
10    client: &'a Client,
11    before: Option<String>,
12    after: Option<String>,
13    first: Option<i64>,
14    last: Option<i64>,
15    include_archived: Option<bool>,
16}
17impl<'a> WorkflowStatesQuery<'a> {
18    pub fn before(mut self, value: impl Into<String>) -> Self {
19        self.before = Some(value.into());
20        self
21    }
22    pub fn after(mut self, value: impl Into<String>) -> Self {
23        self.after = Some(value.into());
24        self
25    }
26    pub fn first(mut self, value: i64) -> Self {
27        self.first = Some(value);
28        self
29    }
30    pub fn last(mut self, value: i64) -> Self {
31        self.last = Some(value);
32        self
33    }
34    pub fn include_archived(mut self, value: bool) -> Self {
35        self.include_archived = Some(value);
36        self
37    }
38    pub async fn send(self) -> Result<Connection<WorkflowState>, LinearError> {
39        let variables = serde_json::json!(
40            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
41            : self.last, "includeArchived" : self.include_archived }
42        );
43        self.client
44            .execute_connection::<
45                WorkflowState,
46            >(
47                "query WorkflowStates($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { workflowStates(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt name color description position type } pageInfo { hasNextPage endCursor } } }",
48                variables,
49                "workflowStates",
50            )
51            .await
52    }
53}
54#[must_use]
55pub struct UsersQuery<'a> {
56    client: &'a Client,
57    include_disabled: Option<bool>,
58    before: Option<String>,
59    after: Option<String>,
60    first: Option<i64>,
61    last: Option<i64>,
62    include_archived: Option<bool>,
63}
64impl<'a> UsersQuery<'a> {
65    pub fn include_disabled(mut self, value: bool) -> Self {
66        self.include_disabled = Some(value);
67        self
68    }
69    pub fn before(mut self, value: impl Into<String>) -> Self {
70        self.before = Some(value.into());
71        self
72    }
73    pub fn after(mut self, value: impl Into<String>) -> Self {
74        self.after = Some(value.into());
75        self
76    }
77    pub fn first(mut self, value: i64) -> Self {
78        self.first = Some(value);
79        self
80    }
81    pub fn last(mut self, value: i64) -> Self {
82        self.last = Some(value);
83        self
84    }
85    pub fn include_archived(mut self, value: bool) -> Self {
86        self.include_archived = Some(value);
87        self
88    }
89    pub async fn send(self) -> Result<Connection<User>, LinearError> {
90        let variables = serde_json::json!(
91            { "includeDisabled" : self.include_disabled, "before" : self.before, "after"
92            : self.after, "first" : self.first, "last" : self.last, "includeArchived" :
93            self.include_archived }
94        );
95        self.client
96            .execute_connection::<
97                User,
98            >(
99                "query Users($includeDisabled: Boolean, $before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { users(includeDisabled: $includeDisabled, before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt name displayName email avatarUrl disableReason calendarHash description statusEmoji statusLabel statusUntilAt timezone lastSeen initials avatarBackgroundColor guest app isMentionable isAssignable active url createdIssueCount canAccessAnyPublicTeam isMe admin owner supportsAgentSessions inviteHash gitHubUserId } pageInfo { hasNextPage endCursor } } }",
100                variables,
101                "users",
102            )
103            .await
104    }
105}
106#[must_use]
107pub struct ProjectsQuery<'a> {
108    client: &'a Client,
109    before: Option<String>,
110    after: Option<String>,
111    first: Option<i64>,
112    last: Option<i64>,
113    include_archived: Option<bool>,
114}
115impl<'a> ProjectsQuery<'a> {
116    pub fn before(mut self, value: impl Into<String>) -> Self {
117        self.before = Some(value.into());
118        self
119    }
120    pub fn after(mut self, value: impl Into<String>) -> Self {
121        self.after = Some(value.into());
122        self
123    }
124    pub fn first(mut self, value: i64) -> Self {
125        self.first = Some(value);
126        self
127    }
128    pub fn last(mut self, value: i64) -> Self {
129        self.last = Some(value);
130        self
131    }
132    pub fn include_archived(mut self, value: bool) -> Self {
133        self.include_archived = Some(value);
134        self
135    }
136    pub async fn send(self) -> Result<Connection<Project>, LinearError> {
137        let variables = serde_json::json!(
138            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
139            : self.last, "includeArchived" : self.include_archived }
140        );
141        self.client
142            .execute_connection::<
143                Project,
144            >(
145                "query Projects($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { projects(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt updateReminderFrequencyInWeeks updateReminderFrequency frequencyResolution updateRemindersDay updateRemindersHour name description slugId icon color projectUpdateRemindersPausedUntilAt startDate startDateResolution targetDate targetDateResolution startedAt completedAt canceledAt autoArchivedAt trashed sortOrder prioritySortOrder priority health healthUpdatedAt issueCountHistory completedIssueCountHistory scopeHistory completedScopeHistory inProgressScopeHistory progressHistory currentProgress slackNewIssue slackIssueComments slackIssueStatuses labelIds url progress scope content contentState state priorityLabel } pageInfo { hasNextPage endCursor } } }",
146                variables,
147                "projects",
148            )
149            .await
150    }
151}
152#[must_use]
153pub struct TeamsQuery<'a> {
154    client: &'a Client,
155    before: Option<String>,
156    after: Option<String>,
157    first: Option<i64>,
158    last: Option<i64>,
159    include_archived: Option<bool>,
160}
161impl<'a> TeamsQuery<'a> {
162    pub fn before(mut self, value: impl Into<String>) -> Self {
163        self.before = Some(value.into());
164        self
165    }
166    pub fn after(mut self, value: impl Into<String>) -> Self {
167        self.after = Some(value.into());
168        self
169    }
170    pub fn first(mut self, value: i64) -> Self {
171        self.first = Some(value);
172        self
173    }
174    pub fn last(mut self, value: i64) -> Self {
175        self.last = Some(value);
176        self
177    }
178    pub fn include_archived(mut self, value: bool) -> Self {
179        self.include_archived = Some(value);
180        self
181    }
182    pub async fn send(self) -> Result<Connection<Team>, LinearError> {
183        let variables = serde_json::json!(
184            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
185            : self.last, "includeArchived" : self.include_archived }
186        );
187        self.client
188            .execute_connection::<
189                Team,
190            >(
191                "query Teams($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { teams(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt name key description icon color retiredAt cyclesEnabled cycleStartDay cycleDuration cycleCooldownTime cycleIssueAutoAssignStarted cycleIssueAutoAssignCompleted cycleLockToActive upcomingCycleCount timezone inheritWorkflowStatuses inheritIssueEstimation issueEstimationType issueOrderingNoPriorityFirst issueEstimationAllowZero setIssueSortOrderOnStateChange issueEstimationExtended defaultIssueEstimate triageEnabled requirePriorityToLeaveTriage defaultTemplateForMembersId defaultTemplateForNonMembersId private allMembersCanJoin securitySettings scimManaged scimGroupName progressHistory currentProgress groupIssueHistory aiThreadSummariesEnabled aiDiscussionSummariesEnabled slackNewIssue slackIssueComments slackIssueStatuses autoClosePeriod autoCloseStateId autoArchivePeriod autoCloseParentIssues autoCloseChildIssues joinByDefault cycleCalenderUrl displayName issueCount issueSortOrderDefaultToBottom inviteHash } pageInfo { hasNextPage endCursor } } }",
192                variables,
193                "teams",
194            )
195            .await
196    }
197}
198#[must_use]
199pub struct SearchIssuesQuery<'a> {
200    client: &'a Client,
201    term: String,
202    before: Option<String>,
203    after: Option<String>,
204    first: Option<i64>,
205    last: Option<i64>,
206    include_archived: Option<bool>,
207    include_comments: Option<bool>,
208    team_id: Option<String>,
209}
210impl<'a> SearchIssuesQuery<'a> {
211    pub fn before(mut self, value: impl Into<String>) -> Self {
212        self.before = Some(value.into());
213        self
214    }
215    pub fn after(mut self, value: impl Into<String>) -> Self {
216        self.after = Some(value.into());
217        self
218    }
219    pub fn first(mut self, value: i64) -> Self {
220        self.first = Some(value);
221        self
222    }
223    pub fn last(mut self, value: i64) -> Self {
224        self.last = Some(value);
225        self
226    }
227    pub fn include_archived(mut self, value: bool) -> Self {
228        self.include_archived = Some(value);
229        self
230    }
231    pub fn include_comments(mut self, value: bool) -> Self {
232        self.include_comments = Some(value);
233        self
234    }
235    pub fn team_id(mut self, value: impl Into<String>) -> Self {
236        self.team_id = Some(value.into());
237        self
238    }
239    pub async fn send(self) -> Result<Connection<Issue>, LinearError> {
240        let variables = serde_json::json!(
241            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
242            : self.last, "includeArchived" : self.include_archived, "term" : self.term,
243            "includeComments" : self.include_comments, "teamId" : self.team_id }
244        );
245        self.client
246            .execute_connection::<
247                Issue,
248            >(
249                "query SearchIssues($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean, $term: String!, $includeComments: Boolean, $teamId: String) { searchIssues(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived, term: $term, includeComments: $includeComments, teamId: $teamId) { nodes { id createdAt updatedAt archivedAt number title priority estimate boardOrder sortOrder prioritySortOrder startedAt completedAt startedTriageAt triagedAt canceledAt autoClosedAt autoArchivedAt dueDate slaStartedAt slaMediumRiskAt slaHighRiskAt slaBreachesAt slaType addedToProjectAt addedToCycleAt addedToTeamAt trashed snoozedUntilAt suggestionsGeneratedAt activitySummary labelIds previousIdentifiers subIssueSortOrder reactionData priorityLabel integrationSourceType identifier url branchName customerTicketCount description } pageInfo { hasNextPage endCursor } } }",
250                variables,
251                "searchIssues",
252            )
253            .await
254    }
255}
256#[must_use]
257pub struct IssuesQuery<'a> {
258    client: &'a Client,
259    before: Option<String>,
260    after: Option<String>,
261    first: Option<i64>,
262    last: Option<i64>,
263    include_archived: Option<bool>,
264}
265impl<'a> IssuesQuery<'a> {
266    pub fn before(mut self, value: impl Into<String>) -> Self {
267        self.before = Some(value.into());
268        self
269    }
270    pub fn after(mut self, value: impl Into<String>) -> Self {
271        self.after = Some(value.into());
272        self
273    }
274    pub fn first(mut self, value: i64) -> Self {
275        self.first = Some(value);
276        self
277    }
278    pub fn last(mut self, value: i64) -> Self {
279        self.last = Some(value);
280        self
281    }
282    pub fn include_archived(mut self, value: bool) -> Self {
283        self.include_archived = Some(value);
284        self
285    }
286    pub async fn send(self) -> Result<Connection<Issue>, LinearError> {
287        let variables = serde_json::json!(
288            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
289            : self.last, "includeArchived" : self.include_archived }
290        );
291        self.client
292            .execute_connection::<
293                Issue,
294            >(
295                "query Issues($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { issues(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt number title priority estimate boardOrder sortOrder prioritySortOrder startedAt completedAt startedTriageAt triagedAt canceledAt autoClosedAt autoArchivedAt dueDate slaStartedAt slaMediumRiskAt slaHighRiskAt slaBreachesAt slaType addedToProjectAt addedToCycleAt addedToTeamAt trashed snoozedUntilAt suggestionsGeneratedAt activitySummary labelIds previousIdentifiers subIssueSortOrder reactionData priorityLabel integrationSourceType identifier url branchName customerTicketCount description } pageInfo { hasNextPage endCursor } } }",
296                variables,
297                "issues",
298            )
299            .await
300    }
301}
302#[must_use]
303pub struct IssueRelationsQuery<'a> {
304    client: &'a Client,
305    before: Option<String>,
306    after: Option<String>,
307    first: Option<i64>,
308    last: Option<i64>,
309    include_archived: Option<bool>,
310}
311impl<'a> IssueRelationsQuery<'a> {
312    pub fn before(mut self, value: impl Into<String>) -> Self {
313        self.before = Some(value.into());
314        self
315    }
316    pub fn after(mut self, value: impl Into<String>) -> Self {
317        self.after = Some(value.into());
318        self
319    }
320    pub fn first(mut self, value: i64) -> Self {
321        self.first = Some(value);
322        self
323    }
324    pub fn last(mut self, value: i64) -> Self {
325        self.last = Some(value);
326        self
327    }
328    pub fn include_archived(mut self, value: bool) -> Self {
329        self.include_archived = Some(value);
330        self
331    }
332    pub async fn send(self) -> Result<Connection<IssueRelation>, LinearError> {
333        let variables = serde_json::json!(
334            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
335            : self.last, "includeArchived" : self.include_archived }
336        );
337        self.client
338            .execute_connection::<
339                IssueRelation,
340            >(
341                "query IssueRelations($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { issueRelations(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt type } pageInfo { hasNextPage endCursor } } }",
342                variables,
343                "issueRelations",
344            )
345            .await
346    }
347}
348#[must_use]
349pub struct IssueLabelsQuery<'a> {
350    client: &'a Client,
351    before: Option<String>,
352    after: Option<String>,
353    first: Option<i64>,
354    last: Option<i64>,
355    include_archived: Option<bool>,
356}
357impl<'a> IssueLabelsQuery<'a> {
358    pub fn before(mut self, value: impl Into<String>) -> Self {
359        self.before = Some(value.into());
360        self
361    }
362    pub fn after(mut self, value: impl Into<String>) -> Self {
363        self.after = Some(value.into());
364        self
365    }
366    pub fn first(mut self, value: i64) -> Self {
367        self.first = Some(value);
368        self
369    }
370    pub fn last(mut self, value: i64) -> Self {
371        self.last = Some(value);
372        self
373    }
374    pub fn include_archived(mut self, value: bool) -> Self {
375        self.include_archived = Some(value);
376        self
377    }
378    pub async fn send(self) -> Result<Connection<IssueLabel>, LinearError> {
379        let variables = serde_json::json!(
380            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
381            : self.last, "includeArchived" : self.include_archived }
382        );
383        self.client
384            .execute_connection::<
385                IssueLabel,
386            >(
387                "query IssueLabels($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { issueLabels(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt name description color isGroup lastAppliedAt retiredAt } pageInfo { hasNextPage endCursor } } }",
388                variables,
389                "issueLabels",
390            )
391            .await
392    }
393}
394#[must_use]
395pub struct DocumentsQuery<'a> {
396    client: &'a Client,
397    before: Option<String>,
398    after: Option<String>,
399    first: Option<i64>,
400    last: Option<i64>,
401    include_archived: Option<bool>,
402}
403impl<'a> DocumentsQuery<'a> {
404    pub fn before(mut self, value: impl Into<String>) -> Self {
405        self.before = Some(value.into());
406        self
407    }
408    pub fn after(mut self, value: impl Into<String>) -> Self {
409        self.after = Some(value.into());
410        self
411    }
412    pub fn first(mut self, value: i64) -> Self {
413        self.first = Some(value);
414        self
415    }
416    pub fn last(mut self, value: i64) -> Self {
417        self.last = Some(value);
418        self
419    }
420    pub fn include_archived(mut self, value: bool) -> Self {
421        self.include_archived = Some(value);
422        self
423    }
424    pub async fn send(self) -> Result<Connection<Document>, LinearError> {
425        let variables = serde_json::json!(
426            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
427            : self.last, "includeArchived" : self.include_archived }
428        );
429        self.client
430            .execute_connection::<
431                Document,
432            >(
433                "query Documents($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { documents(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt title icon color slugId hiddenAt trashed sortOrder content contentState documentContentId url } pageInfo { hasNextPage endCursor } } }",
434                variables,
435                "documents",
436            )
437            .await
438    }
439}
440#[must_use]
441pub struct CyclesQuery<'a> {
442    client: &'a Client,
443    before: Option<String>,
444    after: Option<String>,
445    first: Option<i64>,
446    last: Option<i64>,
447    include_archived: Option<bool>,
448}
449impl<'a> CyclesQuery<'a> {
450    pub fn before(mut self, value: impl Into<String>) -> Self {
451        self.before = Some(value.into());
452        self
453    }
454    pub fn after(mut self, value: impl Into<String>) -> Self {
455        self.after = Some(value.into());
456        self
457    }
458    pub fn first(mut self, value: i64) -> Self {
459        self.first = Some(value);
460        self
461    }
462    pub fn last(mut self, value: i64) -> Self {
463        self.last = Some(value);
464        self
465    }
466    pub fn include_archived(mut self, value: bool) -> Self {
467        self.include_archived = Some(value);
468        self
469    }
470    pub async fn send(self) -> Result<Connection<Cycle>, LinearError> {
471        let variables = serde_json::json!(
472            { "before" : self.before, "after" : self.after, "first" : self.first, "last"
473            : self.last, "includeArchived" : self.include_archived }
474        );
475        self.client
476            .execute_connection::<
477                Cycle,
478            >(
479                "query Cycles($before: String, $after: String, $first: Int, $last: Int, $includeArchived: Boolean) { cycles(before: $before, after: $after, first: $first, last: $last, includeArchived: $includeArchived) { nodes { id createdAt updatedAt archivedAt number name description startsAt endsAt completedAt autoArchivedAt issueCountHistory completedIssueCountHistory scopeHistory completedScopeHistory inProgressScopeHistory progressHistory currentProgress isActive isFuture isPast progress isNext isPrevious } pageInfo { hasNextPage endCursor } } }",
480                variables,
481                "cycles",
482            )
483            .await
484    }
485}
486impl Client {
487    pub fn workflow_states(&self) -> WorkflowStatesQuery<'_> {
488        WorkflowStatesQuery {
489            client: self,
490            before: None,
491            after: None,
492            first: None,
493            last: None,
494            include_archived: None,
495        }
496    }
497    pub fn users(&self) -> UsersQuery<'_> {
498        UsersQuery {
499            client: self,
500            include_disabled: None,
501            before: None,
502            after: None,
503            first: None,
504            last: None,
505            include_archived: None,
506        }
507    }
508    pub async fn whoami(&self) -> Result<User, LinearError> {
509        let variables = serde_json::json!({});
510        self.execute::<
511                User,
512            >(
513                "query Viewer { viewer { id createdAt updatedAt archivedAt name displayName email avatarUrl disableReason calendarHash description statusEmoji statusLabel statusUntilAt timezone lastSeen initials avatarBackgroundColor guest app isMentionable isAssignable active url createdIssueCount canAccessAnyPublicTeam isMe admin owner supportsAgentSessions inviteHash gitHubUserId } }",
514                variables,
515                "viewer",
516            )
517            .await
518    }
519    pub fn projects(&self) -> ProjectsQuery<'_> {
520        ProjectsQuery {
521            client: self,
522            before: None,
523            after: None,
524            first: None,
525            last: None,
526            include_archived: None,
527        }
528    }
529    pub async fn project(&self, id: String) -> Result<Project, LinearError> {
530        let variables = serde_json::json!({ "id" : id });
531        self.execute::<
532                Project,
533            >(
534                "query Project($id: String!) { project(id: $id) { id createdAt updatedAt archivedAt updateReminderFrequencyInWeeks updateReminderFrequency frequencyResolution updateRemindersDay updateRemindersHour name description slugId icon color projectUpdateRemindersPausedUntilAt startDate startDateResolution targetDate targetDateResolution startedAt completedAt canceledAt autoArchivedAt trashed sortOrder prioritySortOrder priority health healthUpdatedAt issueCountHistory completedIssueCountHistory scopeHistory completedScopeHistory inProgressScopeHistory progressHistory currentProgress slackNewIssue slackIssueComments slackIssueStatuses labelIds url progress scope content contentState state priorityLabel } }",
535                variables,
536                "project",
537            )
538            .await
539    }
540    pub fn teams(&self) -> TeamsQuery<'_> {
541        TeamsQuery {
542            client: self,
543            before: None,
544            after: None,
545            first: None,
546            last: None,
547            include_archived: None,
548        }
549    }
550    pub async fn team(&self, id: String) -> Result<Team, LinearError> {
551        let variables = serde_json::json!({ "id" : id });
552        self.execute::<
553                Team,
554            >(
555                "query Team($id: String!) { team(id: $id) { id createdAt updatedAt archivedAt name key description icon color retiredAt cyclesEnabled cycleStartDay cycleDuration cycleCooldownTime cycleIssueAutoAssignStarted cycleIssueAutoAssignCompleted cycleLockToActive upcomingCycleCount timezone inheritWorkflowStatuses inheritIssueEstimation issueEstimationType issueOrderingNoPriorityFirst issueEstimationAllowZero setIssueSortOrderOnStateChange issueEstimationExtended defaultIssueEstimate triageEnabled requirePriorityToLeaveTriage defaultTemplateForMembersId defaultTemplateForNonMembersId private allMembersCanJoin securitySettings scimManaged scimGroupName progressHistory currentProgress groupIssueHistory aiThreadSummariesEnabled aiDiscussionSummariesEnabled slackNewIssue slackIssueComments slackIssueStatuses autoClosePeriod autoCloseStateId autoArchivePeriod autoCloseParentIssues autoCloseChildIssues joinByDefault cycleCalenderUrl displayName issueCount issueSortOrderDefaultToBottom inviteHash } }",
556                variables,
557                "team",
558            )
559            .await
560    }
561    pub fn search_issues(&self, term: impl Into<String>) -> SearchIssuesQuery<'_> {
562        SearchIssuesQuery {
563            client: self,
564            term: term.into(),
565            before: None,
566            after: None,
567            first: None,
568            last: None,
569            include_archived: None,
570            include_comments: None,
571            team_id: None,
572        }
573    }
574    pub fn issues(&self) -> IssuesQuery<'_> {
575        IssuesQuery {
576            client: self,
577            before: None,
578            after: None,
579            first: None,
580            last: None,
581            include_archived: None,
582        }
583    }
584    pub async fn issue(&self, id: String) -> Result<Issue, LinearError> {
585        let variables = serde_json::json!({ "id" : id });
586        self.execute::<
587                Issue,
588            >(
589                "query Issue($id: String!) { issue(id: $id) { id createdAt updatedAt archivedAt number title priority estimate boardOrder sortOrder prioritySortOrder startedAt completedAt startedTriageAt triagedAt canceledAt autoClosedAt autoArchivedAt dueDate slaStartedAt slaMediumRiskAt slaHighRiskAt slaBreachesAt slaType addedToProjectAt addedToCycleAt addedToTeamAt trashed snoozedUntilAt suggestionsGeneratedAt activitySummary labelIds previousIdentifiers subIssueSortOrder reactionData priorityLabel integrationSourceType identifier url branchName customerTicketCount description } }",
590                variables,
591                "issue",
592            )
593            .await
594    }
595    pub fn issue_relations(&self) -> IssueRelationsQuery<'_> {
596        IssueRelationsQuery {
597            client: self,
598            before: None,
599            after: None,
600            first: None,
601            last: None,
602            include_archived: None,
603        }
604    }
605    pub async fn issue_relation(&self, id: String) -> Result<IssueRelation, LinearError> {
606        let variables = serde_json::json!({ "id" : id });
607        self.execute::<
608                IssueRelation,
609            >(
610                "query IssueRelation($id: String!) { issueRelation(id: $id) { id createdAt updatedAt archivedAt type } }",
611                variables,
612                "issueRelation",
613            )
614            .await
615    }
616    pub fn issue_labels(&self) -> IssueLabelsQuery<'_> {
617        IssueLabelsQuery {
618            client: self,
619            before: None,
620            after: None,
621            first: None,
622            last: None,
623            include_archived: None,
624        }
625    }
626    pub fn documents(&self) -> DocumentsQuery<'_> {
627        DocumentsQuery {
628            client: self,
629            before: None,
630            after: None,
631            first: None,
632            last: None,
633            include_archived: None,
634        }
635    }
636    pub async fn document(&self, id: String) -> Result<Document, LinearError> {
637        let variables = serde_json::json!({ "id" : id });
638        self.execute::<
639                Document,
640            >(
641                "query Document($id: String!) { document(id: $id) { id createdAt updatedAt archivedAt title icon color slugId hiddenAt trashed sortOrder content contentState documentContentId url } }",
642                variables,
643                "document",
644            )
645            .await
646    }
647    pub fn cycles(&self) -> CyclesQuery<'_> {
648        CyclesQuery {
649            client: self,
650            before: None,
651            after: None,
652            first: None,
653            last: None,
654            include_archived: None,
655        }
656    }
657    pub async fn cycle(&self, id: String) -> Result<Cycle, LinearError> {
658        let variables = serde_json::json!({ "id" : id });
659        self.execute::<
660                Cycle,
661            >(
662                "query Cycle($id: String!) { cycle(id: $id) { id createdAt updatedAt archivedAt number name description startsAt endsAt completedAt autoArchivedAt issueCountHistory completedIssueCountHistory scopeHistory completedScopeHistory inProgressScopeHistory progressHistory currentProgress isActive isFuture isPast progress isNext isPrevious } }",
663                variables,
664                "cycle",
665            )
666            .await
667    }
668}