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 fn issue_relations<T>(&self) -> IssueRelationsQueryBuilder<'_, T> {
108 crate::generated::queries::issue_relations(self)
109 }
110 pub async fn issue_relation<
114 T: DeserializeOwned + GraphQLFields<FullType = super::types::IssueRelation>,
115 >(
116 &self,
117 id: String,
118 ) -> Result<T, LinearError> {
119 crate::generated::queries::issue_relation::<T>(self, id).await
120 }
121 pub fn issue_labels<T>(&self) -> IssueLabelsQueryBuilder<'_, T> {
125 crate::generated::queries::issue_labels(self)
126 }
127 pub fn documents<T>(&self) -> DocumentsQueryBuilder<'_, T> {
131 crate::generated::queries::documents(self)
132 }
133 pub async fn document<
137 T: DeserializeOwned + GraphQLFields<FullType = super::types::Document>,
138 >(
139 &self,
140 id: String,
141 ) -> Result<T, LinearError> {
142 crate::generated::queries::document::<T>(self, id).await
143 }
144 pub fn cycles<T>(&self) -> CyclesQueryBuilder<'_, T> {
148 crate::generated::queries::cycles(self)
149 }
150 pub async fn cycle<T: DeserializeOwned + GraphQLFields<FullType = super::types::Cycle>>(
154 &self,
155 id: String,
156 ) -> Result<T, LinearError> {
157 crate::generated::queries::cycle::<T>(self, id).await
158 }
159 pub async fn file_upload(
161 &self,
162 meta_data: Option<serde_json::Value>,
163 make_public: Option<bool>,
164 size: i64,
165 content_type: String,
166 filename: String,
167 ) -> Result<serde_json::Value, LinearError> {
168 crate::generated::mutations::file_upload(
169 self,
170 meta_data,
171 make_public,
172 size,
173 content_type,
174 filename,
175 )
176 .await
177 }
178 pub async fn image_upload_from_url(
180 &self,
181 url: String,
182 ) -> Result<serde_json::Value, LinearError> {
183 crate::generated::mutations::image_upload_from_url(self, url).await
184 }
185 pub async fn comment_create<
189 T: serde::de::DeserializeOwned
190 + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
191 >(
192 &self,
193 input: CommentCreateInput,
194 ) -> Result<T, LinearError> {
195 crate::generated::mutations::comment_create::<T>(self, input).await
196 }
197 pub async fn comment_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
199 crate::generated::mutations::comment_delete(self, id).await
200 }
201 pub async fn project_create<
205 T: serde::de::DeserializeOwned
206 + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
207 >(
208 &self,
209 slack_channel_name: Option<String>,
210 input: ProjectCreateInput,
211 ) -> Result<T, LinearError> {
212 crate::generated::mutations::project_create::<T>(self, slack_channel_name, input).await
213 }
214 pub async fn project_update<
218 T: serde::de::DeserializeOwned
219 + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
220 >(
221 &self,
222 input: ProjectUpdateInput,
223 id: String,
224 ) -> Result<T, LinearError> {
225 crate::generated::mutations::project_update::<T>(self, input, id).await
226 }
227 pub async fn project_delete<
231 T: serde::de::DeserializeOwned
232 + crate::field_selection::GraphQLFields<FullType = super::types::Project>,
233 >(
234 &self,
235 id: String,
236 ) -> Result<T, LinearError> {
237 crate::generated::mutations::project_delete::<T>(self, id).await
238 }
239 pub async fn team_create<
243 T: serde::de::DeserializeOwned
244 + crate::field_selection::GraphQLFields<FullType = super::types::Team>,
245 >(
246 &self,
247 copy_settings_from_team_id: Option<String>,
248 input: TeamCreateInput,
249 ) -> Result<T, LinearError> {
250 crate::generated::mutations::team_create::<T>(self, copy_settings_from_team_id, input).await
251 }
252 pub async fn team_update<
256 T: serde::de::DeserializeOwned
257 + crate::field_selection::GraphQLFields<FullType = super::types::Team>,
258 >(
259 &self,
260 mapping: Option<InheritanceEntityMapping>,
261 input: TeamUpdateInput,
262 id: String,
263 ) -> Result<T, LinearError> {
264 crate::generated::mutations::team_update::<T>(self, mapping, input, id).await
265 }
266 pub async fn team_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
268 crate::generated::mutations::team_delete(self, id).await
269 }
270 pub async fn team_membership_create<
274 T: serde::de::DeserializeOwned
275 + crate::field_selection::GraphQLFields<FullType = super::types::TeamMembership>,
276 >(
277 &self,
278 input: TeamMembershipCreateInput,
279 ) -> Result<T, LinearError> {
280 crate::generated::mutations::team_membership_create::<T>(self, input).await
281 }
282 pub async fn team_membership_delete(
284 &self,
285 also_leave_parent_teams: Option<bool>,
286 id: String,
287 ) -> Result<serde_json::Value, LinearError> {
288 crate::generated::mutations::team_membership_delete(self, also_leave_parent_teams, id).await
289 }
290 pub async fn project_milestone_create<
294 T: serde::de::DeserializeOwned
295 + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
296 >(
297 &self,
298 input: ProjectMilestoneCreateInput,
299 ) -> Result<T, LinearError> {
300 crate::generated::mutations::project_milestone_create::<T>(self, input).await
301 }
302 pub async fn project_milestone_update<
306 T: serde::de::DeserializeOwned
307 + crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
308 >(
309 &self,
310 input: ProjectMilestoneUpdateInput,
311 id: String,
312 ) -> Result<T, LinearError> {
313 crate::generated::mutations::project_milestone_update::<T>(self, input, id).await
314 }
315 pub async fn project_milestone_delete(
317 &self,
318 id: String,
319 ) -> Result<serde_json::Value, LinearError> {
320 crate::generated::mutations::project_milestone_delete(self, id).await
321 }
322 pub async fn issue_create<
326 T: serde::de::DeserializeOwned
327 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
328 >(
329 &self,
330 input: IssueCreateInput,
331 ) -> Result<T, LinearError> {
332 crate::generated::mutations::issue_create::<T>(self, input).await
333 }
334 pub async fn issue_update<
338 T: serde::de::DeserializeOwned
339 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
340 >(
341 &self,
342 input: IssueUpdateInput,
343 id: String,
344 ) -> Result<T, LinearError> {
345 crate::generated::mutations::issue_update::<T>(self, input, id).await
346 }
347 pub async fn issue_archive<
351 T: serde::de::DeserializeOwned
352 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
353 >(
354 &self,
355 trash: Option<bool>,
356 id: String,
357 ) -> Result<T, LinearError> {
358 crate::generated::mutations::issue_archive::<T>(self, trash, id).await
359 }
360 pub async fn issue_unarchive<
364 T: serde::de::DeserializeOwned
365 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
366 >(
367 &self,
368 id: String,
369 ) -> Result<T, LinearError> {
370 crate::generated::mutations::issue_unarchive::<T>(self, id).await
371 }
372 pub async fn issue_delete<
376 T: serde::de::DeserializeOwned
377 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
378 >(
379 &self,
380 permanently_delete: Option<bool>,
381 id: String,
382 ) -> Result<T, LinearError> {
383 crate::generated::mutations::issue_delete::<T>(self, permanently_delete, id).await
384 }
385 pub async fn issue_relation_create<
389 T: serde::de::DeserializeOwned
390 + crate::field_selection::GraphQLFields<FullType = super::types::IssueRelation>,
391 >(
392 &self,
393 override_created_at: Option<serde_json::Value>,
394 input: IssueRelationCreateInput,
395 ) -> Result<T, LinearError> {
396 crate::generated::mutations::issue_relation_create::<T>(self, override_created_at, input)
397 .await
398 }
399 pub async fn document_create<
403 T: serde::de::DeserializeOwned
404 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
405 >(
406 &self,
407 input: DocumentCreateInput,
408 ) -> Result<T, LinearError> {
409 crate::generated::mutations::document_create::<T>(self, input).await
410 }
411 pub async fn document_update<
415 T: serde::de::DeserializeOwned
416 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
417 >(
418 &self,
419 input: DocumentUpdateInput,
420 id: String,
421 ) -> Result<T, LinearError> {
422 crate::generated::mutations::document_update::<T>(self, input, id).await
423 }
424 pub async fn document_delete<
428 T: serde::de::DeserializeOwned
429 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
430 >(
431 &self,
432 id: String,
433 ) -> Result<T, LinearError> {
434 crate::generated::mutations::document_delete::<T>(self, id).await
435 }
436}