Skip to main content

lineark_sdk/generated/
mutations.rs

1//! Generated mutation methods on Client.
2//!
3//! Generated by lineark-codegen — do not edit.
4#![allow(clippy::too_many_arguments)]
5use super::inputs::*;
6use crate::client::Client;
7use crate::error::LinearError;
8impl Client {
9    pub async fn comment_create(
10        &self,
11        input: CommentCreateInput,
12    ) -> Result<serde_json::Value, LinearError> {
13        let variables = serde_json::json!({ "input" : input });
14        self.execute::<
15                serde_json::Value,
16            >(
17                "mutation CommentCreate($input: CommentCreateInput!) { commentCreate(input: $input) { success comment { id createdAt updatedAt archivedAt body issueId documentContentId projectUpdateId initiativeUpdateId parentId resolvedAt resolvingCommentId editedAt bodyData quotedText reactionData threadSummary isArtificialAgentSessionRoot url hideInLinear } success } }",
18                variables,
19                "commentCreate",
20            )
21            .await
22    }
23    pub async fn issue_create(
24        &self,
25        input: IssueCreateInput,
26    ) -> Result<serde_json::Value, LinearError> {
27        let variables = serde_json::json!({ "input" : input });
28        self.execute::<
29                serde_json::Value,
30            >(
31                "mutation IssueCreate($input: IssueCreateInput!) { issueCreate(input: $input) { success issue { 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 } success } }",
32                variables,
33                "issueCreate",
34            )
35            .await
36    }
37    pub async fn issue_update(
38        &self,
39        input: IssueUpdateInput,
40        id: String,
41    ) -> Result<serde_json::Value, LinearError> {
42        let variables = serde_json::json!({ "input" : input, "id" : id });
43        self.execute::<
44                serde_json::Value,
45            >(
46                "mutation IssueUpdate($input: IssueUpdateInput!, $id: String!) { issueUpdate(input: $input, id: $id) { success issue { 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 } success } }",
47                variables,
48                "issueUpdate",
49            )
50            .await
51    }
52    pub async fn issue_archive(
53        &self,
54        trash: Option<bool>,
55        id: String,
56    ) -> Result<serde_json::Value, LinearError> {
57        let variables = serde_json::json!({ "trash" : trash, "id" : id });
58        self.execute::<
59                serde_json::Value,
60            >(
61                "mutation IssueArchive($trash: Boolean, $id: String!) { issueArchive(trash: $trash, id: $id) { success success entity { 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 } } }",
62                variables,
63                "issueArchive",
64            )
65            .await
66    }
67    pub async fn issue_delete(
68        &self,
69        permanently_delete: Option<bool>,
70        id: String,
71    ) -> Result<serde_json::Value, LinearError> {
72        let variables = serde_json::json!(
73            { "permanentlyDelete" : permanently_delete, "id" : id }
74        );
75        self.execute::<
76                serde_json::Value,
77            >(
78                "mutation IssueDelete($permanentlyDelete: Boolean, $id: String!) { issueDelete(permanentlyDelete: $permanentlyDelete, id: $id) { success success entity { 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 } } }",
79                variables,
80                "issueDelete",
81            )
82            .await
83    }
84}