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 issues<T>(&self) -> IssuesQueryBuilder<'_, T> {
76 crate::generated::queries::issues(self)
77 }
78 pub async fn issue<T: DeserializeOwned + GraphQLFields<FullType = super::types::Issue>>(
82 &self,
83 id: String,
84 ) -> Result<T, LinearError> {
85 crate::generated::queries::issue::<T>(self, id).await
86 }
87 pub fn issue_relations<T>(&self) -> IssueRelationsQueryBuilder<'_, T> {
91 crate::generated::queries::issue_relations(self)
92 }
93 pub async fn issue_relation<
97 T: DeserializeOwned + GraphQLFields<FullType = super::types::IssueRelation>,
98 >(
99 &self,
100 id: String,
101 ) -> Result<T, LinearError> {
102 crate::generated::queries::issue_relation::<T>(self, id).await
103 }
104 pub fn issue_labels<T>(&self) -> IssueLabelsQueryBuilder<'_, T> {
108 crate::generated::queries::issue_labels(self)
109 }
110 pub fn documents<T>(&self) -> DocumentsQueryBuilder<'_, T> {
114 crate::generated::queries::documents(self)
115 }
116 pub async fn document<
120 T: DeserializeOwned + GraphQLFields<FullType = super::types::Document>,
121 >(
122 &self,
123 id: String,
124 ) -> Result<T, LinearError> {
125 crate::generated::queries::document::<T>(self, id).await
126 }
127 pub fn cycles<T>(&self) -> CyclesQueryBuilder<'_, T> {
131 crate::generated::queries::cycles(self)
132 }
133 pub async fn cycle<T: DeserializeOwned + GraphQLFields<FullType = super::types::Cycle>>(
137 &self,
138 id: String,
139 ) -> Result<T, LinearError> {
140 crate::generated::queries::cycle::<T>(self, id).await
141 }
142 pub async fn file_upload(
144 &self,
145 meta_data: Option<serde_json::Value>,
146 make_public: Option<bool>,
147 size: i64,
148 content_type: String,
149 filename: String,
150 ) -> Result<serde_json::Value, LinearError> {
151 crate::generated::mutations::file_upload(
152 self,
153 meta_data,
154 make_public,
155 size,
156 content_type,
157 filename,
158 )
159 .await
160 }
161 pub async fn image_upload_from_url(
163 &self,
164 url: String,
165 ) -> Result<serde_json::Value, LinearError> {
166 crate::generated::mutations::image_upload_from_url(self, url).await
167 }
168 pub async fn issue_create<
172 T: serde::de::DeserializeOwned
173 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
174 >(
175 &self,
176 input: IssueCreateInput,
177 ) -> Result<T, LinearError> {
178 crate::generated::mutations::issue_create::<T>(self, input).await
179 }
180 pub async fn issue_update<
184 T: serde::de::DeserializeOwned
185 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
186 >(
187 &self,
188 input: IssueUpdateInput,
189 id: String,
190 ) -> Result<T, LinearError> {
191 crate::generated::mutations::issue_update::<T>(self, input, id).await
192 }
193 pub async fn issue_archive<
197 T: serde::de::DeserializeOwned
198 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
199 >(
200 &self,
201 trash: Option<bool>,
202 id: String,
203 ) -> Result<T, LinearError> {
204 crate::generated::mutations::issue_archive::<T>(self, trash, id).await
205 }
206 pub async fn issue_unarchive<
210 T: serde::de::DeserializeOwned
211 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
212 >(
213 &self,
214 id: String,
215 ) -> Result<T, LinearError> {
216 crate::generated::mutations::issue_unarchive::<T>(self, id).await
217 }
218 pub async fn issue_delete<
222 T: serde::de::DeserializeOwned
223 + crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
224 >(
225 &self,
226 permanently_delete: Option<bool>,
227 id: String,
228 ) -> Result<T, LinearError> {
229 crate::generated::mutations::issue_delete::<T>(self, permanently_delete, id).await
230 }
231 pub async fn issue_relation_create<
235 T: serde::de::DeserializeOwned
236 + crate::field_selection::GraphQLFields<FullType = super::types::IssueRelation>,
237 >(
238 &self,
239 override_created_at: Option<serde_json::Value>,
240 input: IssueRelationCreateInput,
241 ) -> Result<T, LinearError> {
242 crate::generated::mutations::issue_relation_create::<T>(self, override_created_at, input)
243 .await
244 }
245 pub async fn document_create<
249 T: serde::de::DeserializeOwned
250 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
251 >(
252 &self,
253 input: DocumentCreateInput,
254 ) -> Result<T, LinearError> {
255 crate::generated::mutations::document_create::<T>(self, input).await
256 }
257 pub async fn document_update<
261 T: serde::de::DeserializeOwned
262 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
263 >(
264 &self,
265 input: DocumentUpdateInput,
266 id: String,
267 ) -> Result<T, LinearError> {
268 crate::generated::mutations::document_update::<T>(self, input, id).await
269 }
270 pub async fn document_delete<
274 T: serde::de::DeserializeOwned
275 + crate::field_selection::GraphQLFields<FullType = super::types::Document>,
276 >(
277 &self,
278 id: String,
279 ) -> Result<T, LinearError> {
280 crate::generated::mutations::document_delete::<T>(self, id).await
281 }
282 pub async fn comment_create<
286 T: serde::de::DeserializeOwned
287 + crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
288 >(
289 &self,
290 input: CommentCreateInput,
291 ) -> Result<T, LinearError> {
292 crate::generated::mutations::comment_create::<T>(self, input).await
293 }
294}