1#![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 pub fn workflow_states<T>(&self) -> WorkflowStatesQueryBuilder<'_, T> {
20 crate::generated::queries::workflow_states(self)
21 }
22 pub fn users<T>(&self) -> UsersQueryBuilder<'_, T> {
26 crate::generated::queries::users(self)
27 }
28 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 pub fn projects<T>(&self) -> ProjectsQueryBuilder<'_, T> {
40 crate::generated::queries::projects(self)
41 }
42 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 pub fn teams<T>(&self) -> TeamsQueryBuilder<'_, T> {
55 crate::generated::queries::teams(self)
56 }
57 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 pub fn search_issues<T>(&self, term: impl Into<String>) -> SearchIssuesQueryBuilder<'_, T> {
70 crate::generated::queries::search_issues(self, term)
71 }
72 pub fn project_milestones<T>(&self) -> ProjectMilestonesQueryBuilder<'_, T> {
76 crate::generated::queries::project_milestones(self)
77 }
78 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 pub fn issues<T>(&self) -> IssuesQueryBuilder<'_, T> {
93 crate::generated::queries::issues(self)
94 }
95 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 pub async fn issue_vcs_branch_search<
108 T: DeserializeOwned + GraphQLFields<FullType = super::types::Issue>,
109 >(
110 &self,
111 branch_name: String,
112 ) -> Result<Option<T>, LinearError> {
113 crate::generated::queries::issue_vcs_branch_search::<T>(self, branch_name).await
114 }
115 pub fn issue_relations<T>(&self) -> IssueRelationsQueryBuilder<'_, T> {
119 crate::generated::queries::issue_relations(self)
120 }
121 pub async fn issue_relation<
125 T: DeserializeOwned + GraphQLFields<FullType = super::types::IssueRelation>,
126 >(
127 &self,
128 id: String,
129 ) -> Result<T, LinearError> {
130 crate::generated::queries::issue_relation::<T>(self, id).await
131 }
132 pub fn issue_labels<T>(&self) -> IssueLabelsQueryBuilder<'_, T> {
136 crate::generated::queries::issue_labels(self)
137 }
138 pub fn documents<T>(&self) -> DocumentsQueryBuilder<'_, T> {
142 crate::generated::queries::documents(self)
143 }
144 pub async fn document<
148 T: DeserializeOwned + GraphQLFields<FullType = super::types::Document>,
149 >(
150 &self,
151 id: String,
152 ) -> Result<T, LinearError> {
153 crate::generated::queries::document::<T>(self, id).await
154 }
155 pub fn cycles<T>(&self) -> CyclesQueryBuilder<'_, T> {
159 crate::generated::queries::cycles(self)
160 }
161 pub async fn cycle<T: DeserializeOwned + GraphQLFields<FullType = super::types::Cycle>>(
165 &self,
166 id: String,
167 ) -> Result<T, LinearError> {
168 crate::generated::queries::cycle::<T>(self, id).await
169 }
170 pub async fn file_upload(
172 &self,
173 meta_data: Option<serde_json::Value>,
174 make_public: Option<bool>,
175 size: i64,
176 content_type: String,
177 filename: String,
178 ) -> Result<serde_json::Value, LinearError> {
179 crate::generated::mutations::file_upload(
180 self,
181 meta_data,
182 make_public,
183 size,
184 content_type,
185 filename,
186 )
187 .await
188 }
189 pub async fn image_upload_from_url(
191 &self,
192 url: String,
193 ) -> Result<serde_json::Value, LinearError> {
194 crate::generated::mutations::image_upload_from_url(self, url).await
195 }
196 pub async fn comment_create<
200 T: serde::de::DeserializeOwned
201 + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
202 >(
203 &self,
204 input: CommentCreateInput,
205 ) -> Result<T, LinearError> {
206 crate::generated::mutations::comment_create::<T>(self, input).await
207 }
208 pub async fn comment_update<
212 T: serde::de::DeserializeOwned
213 + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
214 >(
215 &self,
216 skip_edited_at: Option<bool>,
217 input: CommentUpdateInput,
218 id: String,
219 ) -> Result<T, LinearError> {
220 crate::generated::mutations::comment_update::<T>(self, skip_edited_at, input, id).await
221 }
222 pub async fn comment_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
224 crate::generated::mutations::comment_delete(self, id).await
225 }
226 pub async fn comment_resolve<
230 T: serde::de::DeserializeOwned
231 + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
232 >(
233 &self,
234 resolving_comment_id: Option<String>,
235 id: String,
236 ) -> Result<T, LinearError> {
237 crate::generated::mutations::comment_resolve::<T>(self, resolving_comment_id, id).await
238 }
239 pub async fn comment_unresolve<
243 T: serde::de::DeserializeOwned
244 + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
245 >(
246 &self,
247 id: String,
248 ) -> Result<T, LinearError> {
249 crate::generated::mutations::comment_unresolve::<T>(self, id).await
250 }
251 pub async fn project_create<
255 T: serde::de::DeserializeOwned
256 + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
257 >(
258 &self,
259 slack_channel_name: Option<String>,
260 input: ProjectCreateInput,
261 ) -> Result<T, LinearError> {
262 crate::generated::mutations::project_create::<T>(self, slack_channel_name, input).await
263 }
264 pub async fn project_update<
268 T: serde::de::DeserializeOwned
269 + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
270 >(
271 &self,
272 input: ProjectUpdateInput,
273 id: String,
274 ) -> Result<T, LinearError> {
275 crate::generated::mutations::project_update::<T>(self, input, id).await
276 }
277 pub async fn project_delete<
281 T: serde::de::DeserializeOwned
282 + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
283 >(
284 &self,
285 id: String,
286 ) -> Result<T, LinearError> {
287 crate::generated::mutations::project_delete::<T>(self, id).await
288 }
289 pub async fn team_create<
293 T: serde::de::DeserializeOwned
294 + crate::field_selection::GraphQLFields<FullType = super::types::Team>,
295 >(
296 &self,
297 copy_settings_from_team_id: Option<String>,
298 input: TeamCreateInput,
299 ) -> Result<T, LinearError> {
300 crate::generated::mutations::team_create::<T>(self, copy_settings_from_team_id, input).await
301 }
302 pub async fn team_update<
306 T: serde::de::DeserializeOwned
307 + crate::field_selection::GraphQLFields<FullType = super::types::Team>,
308 >(
309 &self,
310 mapping: Option<InheritanceEntityMapping>,
311 input: TeamUpdateInput,
312 id: String,
313 ) -> Result<T, LinearError> {
314 crate::generated::mutations::team_update::<T>(self, mapping, input, id).await
315 }
316 pub async fn team_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
318 crate::generated::mutations::team_delete(self, id).await
319 }
320 pub async fn team_membership_create<
324 T: serde::de::DeserializeOwned
325 + crate::field_selection::GraphQLFields<FullType = super::types::TeamMembership>,
326 >(
327 &self,
328 input: TeamMembershipCreateInput,
329 ) -> Result<T, LinearError> {
330 crate::generated::mutations::team_membership_create::<T>(self, input).await
331 }
332 pub async fn team_membership_delete(
334 &self,
335 also_leave_parent_teams: Option<bool>,
336 id: String,
337 ) -> Result<serde_json::Value, LinearError> {
338 crate::generated::mutations::team_membership_delete(self, also_leave_parent_teams, id).await
339 }
340 pub async fn project_milestone_create<
344 T: serde::de::DeserializeOwned
345 + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
346 >(
347 &self,
348 input: ProjectMilestoneCreateInput,
349 ) -> Result<T, LinearError> {
350 crate::generated::mutations::project_milestone_create::<T>(self, input).await
351 }
352 pub async fn project_milestone_update<
356 T: serde::de::DeserializeOwned
357 + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
358 >(
359 &self,
360 input: ProjectMilestoneUpdateInput,
361 id: String,
362 ) -> Result<T, LinearError> {
363 crate::generated::mutations::project_milestone_update::<T>(self, input, id).await
364 }
365 pub async fn project_milestone_delete(
367 &self,
368 id: String,
369 ) -> Result<serde_json::Value, LinearError> {
370 crate::generated::mutations::project_milestone_delete(self, id).await
371 }
372 pub async fn issue_create<
376 T: serde::de::DeserializeOwned
377 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
378 >(
379 &self,
380 input: IssueCreateInput,
381 ) -> Result<T, LinearError> {
382 crate::generated::mutations::issue_create::<T>(self, input).await
383 }
384 pub async fn issue_update<
388 T: serde::de::DeserializeOwned
389 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
390 >(
391 &self,
392 input: IssueUpdateInput,
393 id: String,
394 ) -> Result<T, LinearError> {
395 crate::generated::mutations::issue_update::<T>(self, input, id).await
396 }
397 pub async fn issue_batch_update<
401 T: serde::de::DeserializeOwned
402 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
403 >(
404 &self,
405 input: IssueUpdateInput,
406 ids: Vec<String>,
407 ) -> Result<Vec<T>, LinearError> {
408 crate::generated::mutations::issue_batch_update::<T>(self, input, ids).await
409 }
410 pub async fn issue_archive<
414 T: serde::de::DeserializeOwned
415 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
416 >(
417 &self,
418 trash: Option<bool>,
419 id: String,
420 ) -> Result<T, LinearError> {
421 crate::generated::mutations::issue_archive::<T>(self, trash, id).await
422 }
423 pub async fn issue_unarchive<
427 T: serde::de::DeserializeOwned
428 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
429 >(
430 &self,
431 id: String,
432 ) -> Result<T, LinearError> {
433 crate::generated::mutations::issue_unarchive::<T>(self, id).await
434 }
435 pub async fn issue_delete<
439 T: serde::de::DeserializeOwned
440 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
441 >(
442 &self,
443 permanently_delete: Option<bool>,
444 id: String,
445 ) -> Result<T, LinearError> {
446 crate::generated::mutations::issue_delete::<T>(self, permanently_delete, id).await
447 }
448 pub async fn issue_relation_create<
452 T: serde::de::DeserializeOwned
453 + crate::field_selection::GraphQLFields<FullType = super::types::IssueRelation>,
454 >(
455 &self,
456 override_created_at: Option<serde_json::Value>,
457 input: IssueRelationCreateInput,
458 ) -> Result<T, LinearError> {
459 crate::generated::mutations::issue_relation_create::<T>(self, override_created_at, input)
460 .await
461 }
462 pub async fn issue_relation_delete(
464 &self,
465 id: String,
466 ) -> Result<serde_json::Value, LinearError> {
467 crate::generated::mutations::issue_relation_delete(self, id).await
468 }
469 pub async fn issue_label_create<
473 T: serde::de::DeserializeOwned
474 + crate::field_selection::GraphQLFields<FullType = super::types::IssueLabel>,
475 >(
476 &self,
477 replace_team_labels: Option<bool>,
478 input: IssueLabelCreateInput,
479 ) -> Result<T, LinearError> {
480 crate::generated::mutations::issue_label_create::<T>(self, replace_team_labels, input).await
481 }
482 pub async fn issue_label_update<
486 T: serde::de::DeserializeOwned
487 + crate::field_selection::GraphQLFields<FullType = super::types::IssueLabel>,
488 >(
489 &self,
490 replace_team_labels: Option<bool>,
491 input: IssueLabelUpdateInput,
492 id: String,
493 ) -> Result<T, LinearError> {
494 crate::generated::mutations::issue_label_update::<T>(self, replace_team_labels, input, id)
495 .await
496 }
497 pub async fn issue_label_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
499 crate::generated::mutations::issue_label_delete(self, id).await
500 }
501 pub async fn document_create<
505 T: serde::de::DeserializeOwned
506 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
507 >(
508 &self,
509 input: DocumentCreateInput,
510 ) -> Result<T, LinearError> {
511 crate::generated::mutations::document_create::<T>(self, input).await
512 }
513 pub async fn document_update<
517 T: serde::de::DeserializeOwned
518 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
519 >(
520 &self,
521 input: DocumentUpdateInput,
522 id: String,
523 ) -> Result<T, LinearError> {
524 crate::generated::mutations::document_update::<T>(self, input, id).await
525 }
526 pub async fn document_delete<
530 T: serde::de::DeserializeOwned
531 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
532 >(
533 &self,
534 id: String,
535 ) -> Result<T, LinearError> {
536 crate::generated::mutations::document_delete::<T>(self, id).await
537 }
538}