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_statuses<T>(&self) -> ProjectStatusesQueryBuilder<'_, T> {
76 crate::generated::queries::project_statuses(self)
77 }
78 pub fn project_milestones<T>(&self) -> ProjectMilestonesQueryBuilder<'_, T> {
82 crate::generated::queries::project_milestones(self)
83 }
84 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 pub fn project_labels<T>(&self) -> ProjectLabelsQueryBuilder<'_, T> {
99 crate::generated::queries::project_labels(self)
100 }
101 pub fn issues<T>(&self) -> IssuesQueryBuilder<'_, T> {
105 crate::generated::queries::issues(self)
106 }
107 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 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 pub fn issue_relations<T>(&self) -> IssueRelationsQueryBuilder<'_, T> {
131 crate::generated::queries::issue_relations(self)
132 }
133 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 pub fn issue_labels<T>(&self) -> IssueLabelsQueryBuilder<'_, T> {
148 crate::generated::queries::issue_labels(self)
149 }
150 pub fn documents<T>(&self) -> DocumentsQueryBuilder<'_, T> {
154 crate::generated::queries::documents(self)
155 }
156 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 pub fn cycles<T>(&self) -> CyclesQueryBuilder<'_, T> {
171 crate::generated::queries::cycles(self)
172 }
173 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 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 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 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 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 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 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 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 pub async fn team_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
275 crate::generated::mutations::team_delete(self, id).await
276 }
277 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 pub async fn comment_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
523 crate::generated::mutations::comment_delete(self, id).await
524 }
525 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 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}