lineark-sdk 3.0.1

Typed, async-first Rust SDK for the Linear GraphQL API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
//! Generated mutation functions.
//!
//! Each mutation is exposed as a standalone async function. The
//! [`Client`] re-exports these as methods for convenience.
//!
//! Generated by lineark-codegen — do not edit.
#![allow(clippy::too_many_arguments)]
use super::inputs::*;
use crate::client::Client;
use crate::error::LinearError;
/// XHR request payload to upload an images, video and other attachments directly to Linear's cloud storage.
pub async fn file_upload(
    client: &Client,
    meta_data: Option<serde_json::Value>,
    make_public: Option<bool>,
    size: i64,
    content_type: String,
    filename: String,
) -> Result<serde_json::Value, LinearError> {
    let variables = serde_json::json!(
        { "metaData" : meta_data, "makePublic" : make_public, "size" : size,
        "contentType" : content_type, "filename" : filename }
    );
    let mut response_parts: Vec<String> = vec!["success".to_string()];
    response_parts.push(format!(
        "{} {{ {} }}",
        "uploadFile",
        <super::types::UploadFile as crate::field_selection::GraphQLFields>::selection()
    ));
    let query = String::from(
        "mutation FileUpload($metaData: JSON, $makePublic: Boolean, $size: Int!, $contentType: String!, $filename: String!) { fileUpload(metaData: $metaData, makePublic: $makePublic, size: $size, contentType: $contentType, filename: $filename) { ",
    ) + &response_parts.join(" ") + " } }";
    client
        .execute::<serde_json::Value>(&query, variables, "fileUpload")
        .await
}
/// Upload an image from an URL to Linear.
pub async fn image_upload_from_url(
    client: &Client,
    url: String,
) -> Result<serde_json::Value, LinearError> {
    let variables = serde_json::json!({ "url" : url });
    let response_parts: Vec<String> = vec!["url".to_string(), "success".to_string()];
    let query = String::from(
        "mutation ImageUploadFromUrl($url: String!) { imageUploadFromUrl(url: $url) { ",
    ) + &response_parts.join(" ")
        + " } }";
    client
        .execute::<serde_json::Value>(&query, variables, "imageUploadFromUrl")
        .await
}
/// Creates a new project.
///
/// Full type: [`Project`](super::types::Project)
pub async fn project_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
>(
    client: &Client,
    slack_channel_name: Option<String>,
    input: ProjectCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "slackChannelName" : slack_channel_name, "input" : input }
    );
    let query = String::from(
        "mutation ProjectCreate($slackChannelName: String, $input: ProjectCreateInput!) { projectCreate(slackChannelName: $slackChannelName, input: $input) { success project { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "projectCreate", "project")
        .await
}
/// Updates a project.
///
/// Full type: [`Project`](super::types::Project)
pub async fn project_update<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
>(
    client: &Client,
    input: ProjectUpdateInput,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input, "id" : id });
    let query = String::from(
        "mutation ProjectUpdate($input: ProjectUpdateInput!, $id: String!) { projectUpdate(input: $input, id: $id) { success project { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "projectUpdate", "project")
        .await
}
/// Deletes (trashes) a project. The project can be restored later with projectUnarchive.
///
/// Full type: [`Project`](super::types::Project)
pub async fn project_delete<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
>(
    client: &Client,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let query = String::from(
        "mutation ProjectDelete($id: String!) { projectDelete(id: $id) { success entity { ",
    ) + &T::selection()
        + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "projectDelete", "entity")
        .await
}
/// 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.
///
/// Full type: [`Team`](super::types::Team)
pub async fn team_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Team>,
>(
    client: &Client,
    copy_settings_from_team_id: Option<String>,
    input: TeamCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "copySettingsFromTeamId" : copy_settings_from_team_id, "input" : input }
    );
    let query = String::from(
        "mutation TeamCreate($copySettingsFromTeamId: String, $input: TeamCreateInput!) { teamCreate(copySettingsFromTeamId: $copySettingsFromTeamId, input: $input) { success team { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "teamCreate", "team")
        .await
}
/// Updates a team's settings, properties, or configuration. Requires team owner or workspace admin permissions for most changes.
///
/// Full type: [`Team`](super::types::Team)
pub async fn team_update<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Team>,
>(
    client: &Client,
    mapping: Option<InheritanceEntityMapping>,
    input: TeamUpdateInput,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "mapping" : mapping, "input" : input, "id" : id }
    );
    let query = String::from(
        "mutation TeamUpdate($mapping: InheritanceEntityMapping, $input: TeamUpdateInput!, $id: String!) { teamUpdate(mapping: $mapping, input: $input, id: $id) { success team { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "teamUpdate", "team")
        .await
}
/// Archives a team and schedules its data for deletion. Requires team owner or workspace admin permissions.
pub async fn team_delete(client: &Client, id: String) -> Result<serde_json::Value, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let response_parts: Vec<String> = vec!["success".to_string(), "entityId".to_string()];
    let query = String::from("mutation TeamDelete($id: String!) { teamDelete(id: $id) { ")
        + &response_parts.join(" ")
        + " } }";
    client
        .execute::<serde_json::Value>(&query, variables, "teamDelete")
        .await
}
/// 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.
///
/// Full type: [`TeamMembership`](super::types::TeamMembership)
pub async fn team_membership_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::TeamMembership>,
>(
    client: &Client,
    input: TeamMembershipCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input });
    let query = String::from(
        "mutation TeamMembershipCreate($input: TeamMembershipCreateInput!) { teamMembershipCreate(input: $input) { success teamMembership { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "teamMembershipCreate", "teamMembership")
        .await
}
/// 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.
pub async fn team_membership_delete(
    client: &Client,
    also_leave_parent_teams: Option<bool>,
    id: String,
) -> Result<serde_json::Value, LinearError> {
    let variables = serde_json::json!(
        { "alsoLeaveParentTeams" : also_leave_parent_teams, "id" : id }
    );
    let response_parts: Vec<String> = vec!["success".to_string(), "entityId".to_string()];
    let query = String::from(
        "mutation TeamMembershipDelete($alsoLeaveParentTeams: Boolean, $id: String!) { teamMembershipDelete(alsoLeaveParentTeams: $alsoLeaveParentTeams, id: $id) { ",
    ) + &response_parts.join(" ") + " } }";
    client
        .execute::<serde_json::Value>(&query, variables, "teamMembershipDelete")
        .await
}
/// Creates a new project milestone.
///
/// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
pub async fn project_milestone_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
>(
    client: &Client,
    input: ProjectMilestoneCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input });
    let query = String::from(
        "mutation ProjectMilestoneCreate($input: ProjectMilestoneCreateInput!) { projectMilestoneCreate(input: $input) { success projectMilestone { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(
            &query,
            variables,
            "projectMilestoneCreate",
            "projectMilestone",
        )
        .await
}
/// Updates a project milestone.
///
/// Full type: [`ProjectMilestone`](super::types::ProjectMilestone)
pub async fn project_milestone_update<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
>(
    client: &Client,
    input: ProjectMilestoneUpdateInput,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input, "id" : id });
    let query = String::from(
        "mutation ProjectMilestoneUpdate($input: ProjectMilestoneUpdateInput!, $id: String!) { projectMilestoneUpdate(input: $input, id: $id) { success projectMilestone { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(
            &query,
            variables,
            "projectMilestoneUpdate",
            "projectMilestone",
        )
        .await
}
/// Deletes a project milestone.
pub async fn project_milestone_delete(
    client: &Client,
    id: String,
) -> Result<serde_json::Value, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let response_parts: Vec<String> = vec!["success".to_string(), "entityId".to_string()];
    let query = String::from(
        "mutation ProjectMilestoneDelete($id: String!) { projectMilestoneDelete(id: $id) { ",
    ) + &response_parts.join(" ")
        + " } }";
    client
        .execute::<serde_json::Value>(&query, variables, "projectMilestoneDelete")
        .await
}
/// Creates a new issue.
///
/// Full type: [`Issue`](super::types::Issue)
pub async fn issue_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
    client: &Client,
    input: IssueCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input });
    let query = String::from(
        "mutation IssueCreate($input: IssueCreateInput!) { issueCreate(input: $input) { success issue { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "issueCreate", "issue")
        .await
}
/// Updates an issue.
///
/// Full type: [`Issue`](super::types::Issue)
pub async fn issue_update<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
    client: &Client,
    input: IssueUpdateInput,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input, "id" : id });
    let query = String::from(
        "mutation IssueUpdate($input: IssueUpdateInput!, $id: String!) { issueUpdate(input: $input, id: $id) { success issue { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "issueUpdate", "issue")
        .await
}
/// Updates multiple issues at once.
///
/// Full type: [`Issue`](super::types::Issue)
pub async fn issue_batch_update<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
    client: &Client,
    input: IssueUpdateInput,
    ids: Vec<String>,
) -> Result<Vec<T>, LinearError> {
    let variables = serde_json::json!({ "input" : input, "ids" : ids });
    let query = String::from(
        "mutation IssueBatchUpdate($input: IssueUpdateInput!, $ids: [UUID!]!) { issueBatchUpdate(input: $input, ids: $ids) { success issues { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<Vec<T>>(&query, variables, "issueBatchUpdate", "issues")
        .await
}
/// Archives an issue.
///
/// Full type: [`Issue`](super::types::Issue)
pub async fn issue_archive<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
    client: &Client,
    trash: Option<bool>,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "trash" : trash, "id" : id });
    let query = String::from(
        "mutation IssueArchive($trash: Boolean, $id: String!) { issueArchive(trash: $trash, id: $id) { success entity { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "issueArchive", "entity")
        .await
}
/// Unarchives an issue.
///
/// Full type: [`Issue`](super::types::Issue)
pub async fn issue_unarchive<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
    client: &Client,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let query = String::from(
        "mutation IssueUnarchive($id: String!) { issueUnarchive(id: $id) { success entity { ",
    ) + &T::selection()
        + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "issueUnarchive", "entity")
        .await
}
/// Deletes (trashes) an issue.
///
/// Full type: [`Issue`](super::types::Issue)
pub async fn issue_delete<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
    client: &Client,
    permanently_delete: Option<bool>,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "permanentlyDelete" : permanently_delete, "id" : id }
    );
    let query = String::from(
        "mutation IssueDelete($permanentlyDelete: Boolean, $id: String!) { issueDelete(permanentlyDelete: $permanentlyDelete, id: $id) { success entity { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "issueDelete", "entity")
        .await
}
/// Creates a new issue relation.
///
/// Full type: [`IssueRelation`](super::types::IssueRelation)
pub async fn issue_relation_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::IssueRelation>,
>(
    client: &Client,
    override_created_at: Option<serde_json::Value>,
    input: IssueRelationCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "overrideCreatedAt" : override_created_at, "input" : input }
    );
    let query = String::from(
        "mutation IssueRelationCreate($overrideCreatedAt: DateTime, $input: IssueRelationCreateInput!) { issueRelationCreate(overrideCreatedAt: $overrideCreatedAt, input: $input) { success issueRelation { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "issueRelationCreate", "issueRelation")
        .await
}
/// Deletes an issue relation.
pub async fn issue_relation_delete(
    client: &Client,
    id: String,
) -> Result<serde_json::Value, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let response_parts: Vec<String> = vec!["success".to_string(), "entityId".to_string()];
    let query = String::from(
        "mutation IssueRelationDelete($id: String!) { issueRelationDelete(id: $id) { ",
    ) + &response_parts.join(" ")
        + " } }";
    client
        .execute::<serde_json::Value>(&query, variables, "issueRelationDelete")
        .await
}
/// Creates a new label.
///
/// Full type: [`IssueLabel`](super::types::IssueLabel)
pub async fn issue_label_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::IssueLabel>,
>(
    client: &Client,
    replace_team_labels: Option<bool>,
    input: IssueLabelCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "replaceTeamLabels" : replace_team_labels, "input" : input }
    );
    let query = String::from(
        "mutation IssueLabelCreate($replaceTeamLabels: Boolean, $input: IssueLabelCreateInput!) { issueLabelCreate(replaceTeamLabels: $replaceTeamLabels, input: $input) { success issueLabel { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "issueLabelCreate", "issueLabel")
        .await
}
/// Updates a label.
///
/// Full type: [`IssueLabel`](super::types::IssueLabel)
pub async fn issue_label_update<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::IssueLabel>,
>(
    client: &Client,
    replace_team_labels: Option<bool>,
    input: IssueLabelUpdateInput,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "replaceTeamLabels" : replace_team_labels, "input" : input, "id" : id }
    );
    let query = String::from(
        "mutation IssueLabelUpdate($replaceTeamLabels: Boolean, $input: IssueLabelUpdateInput!, $id: String!) { issueLabelUpdate(replaceTeamLabels: $replaceTeamLabels, input: $input, id: $id) { success issueLabel { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "issueLabelUpdate", "issueLabel")
        .await
}
/// Deletes an issue label.
pub async fn issue_label_delete(
    client: &Client,
    id: String,
) -> Result<serde_json::Value, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let response_parts: Vec<String> = vec!["success".to_string(), "entityId".to_string()];
    let query =
        String::from("mutation IssueLabelDelete($id: String!) { issueLabelDelete(id: $id) { ")
            + &response_parts.join(" ")
            + " } }";
    client
        .execute::<serde_json::Value>(&query, variables, "issueLabelDelete")
        .await
}
/// Creates a new document.
///
/// Full type: [`Document`](super::types::Document)
pub async fn document_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
>(
    client: &Client,
    input: DocumentCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input });
    let query = String::from(
        "mutation DocumentCreate($input: DocumentCreateInput!) { documentCreate(input: $input) { success document { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "documentCreate", "document")
        .await
}
/// Updates a document.
///
/// Full type: [`Document`](super::types::Document)
pub async fn document_update<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
>(
    client: &Client,
    input: DocumentUpdateInput,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input, "id" : id });
    let query = String::from(
        "mutation DocumentUpdate($input: DocumentUpdateInput!, $id: String!) { documentUpdate(input: $input, id: $id) { success document { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "documentUpdate", "document")
        .await
}
/// Deletes (trashes) a document. The document is marked as trashed and archived, but not permanently removed.
///
/// Full type: [`Document`](super::types::Document)
pub async fn document_delete<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
>(
    client: &Client,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let query = String::from(
        "mutation DocumentDelete($id: String!) { documentDelete(id: $id) { success entity { ",
    ) + &T::selection()
        + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "documentDelete", "entity")
        .await
}
/// Creates a new comment.
///
/// Full type: [`Comment`](super::types::Comment)
pub async fn comment_create<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
>(
    client: &Client,
    input: CommentCreateInput,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "input" : input });
    let query = String::from(
        "mutation CommentCreate($input: CommentCreateInput!) { commentCreate(input: $input) { success comment { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "commentCreate", "comment")
        .await
}
/// Updates a comment.
///
/// Full type: [`Comment`](super::types::Comment)
pub async fn comment_update<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
>(
    client: &Client,
    skip_edited_at: Option<bool>,
    input: CommentUpdateInput,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "skipEditedAt" : skip_edited_at, "input" : input, "id" : id }
    );
    let query = String::from(
        "mutation CommentUpdate($skipEditedAt: Boolean, $input: CommentUpdateInput!, $id: String!) { commentUpdate(skipEditedAt: $skipEditedAt, input: $input, id: $id) { success comment { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "commentUpdate", "comment")
        .await
}
/// Deletes a comment.
pub async fn comment_delete(client: &Client, id: String) -> Result<serde_json::Value, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let response_parts: Vec<String> = vec!["success".to_string(), "entityId".to_string()];
    let query = String::from("mutation CommentDelete($id: String!) { commentDelete(id: $id) { ")
        + &response_parts.join(" ")
        + " } }";
    client
        .execute::<serde_json::Value>(&query, variables, "commentDelete")
        .await
}
/// Resolves a comment thread. Marks the root comment as resolved by the current user.
///
/// Full type: [`Comment`](super::types::Comment)
pub async fn comment_resolve<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
>(
    client: &Client,
    resolving_comment_id: Option<String>,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!(
        { "resolvingCommentId" : resolving_comment_id, "id" : id }
    );
    let query = String::from(
        "mutation CommentResolve($resolvingCommentId: String, $id: String!) { commentResolve(resolvingCommentId: $resolvingCommentId, id: $id) { success comment { ",
    ) + &T::selection() + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "commentResolve", "comment")
        .await
}
/// Unresolves a previously resolved comment thread. Clears the resolved state on the root comment.
///
/// Full type: [`Comment`](super::types::Comment)
pub async fn comment_unresolve<
    T: serde::de::DeserializeOwned
        + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
>(
    client: &Client,
    id: String,
) -> Result<T, LinearError> {
    let variables = serde_json::json!({ "id" : id });
    let query = String::from(
        "mutation CommentUnresolve($id: String!) { commentUnresolve(id: $id) { success comment { ",
    ) + &T::selection()
        + " } } }";
    client
        .execute_mutation::<T>(&query, variables, "commentUnresolve", "comment")
        .await
}