openapi_github/apis/
projects_api.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`projects_slash_add_collaborator`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ProjectsSlashAddCollaboratorError {
22    Status401(models::BasicError),
23    Status403(models::BasicError),
24    Status404(models::BasicError),
25    Status422(models::ValidationError),
26    UnknownValue(serde_json::Value),
27}
28
29/// struct for typed errors of method [`projects_slash_create_card`]
30#[derive(Debug, Clone, Serialize, Deserialize)]
31#[serde(untagged)]
32pub enum ProjectsSlashCreateCardError {
33    Status401(models::BasicError),
34    Status403(models::BasicError),
35    Status422(models::OrgsUpdate422Response),
36    Status503(models::ProjectsMoveCard503Response),
37    UnknownValue(serde_json::Value),
38}
39
40/// struct for typed errors of method [`projects_slash_create_column`]
41#[derive(Debug, Clone, Serialize, Deserialize)]
42#[serde(untagged)]
43pub enum ProjectsSlashCreateColumnError {
44    Status401(models::BasicError),
45    Status403(models::BasicError),
46    Status422(models::ValidationErrorSimple),
47    UnknownValue(serde_json::Value),
48}
49
50/// struct for typed errors of method [`projects_slash_create_for_authenticated_user`]
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum ProjectsSlashCreateForAuthenticatedUserError {
54    Status401(models::BasicError),
55    Status403(models::BasicError),
56    Status422(models::ValidationErrorSimple),
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`projects_slash_create_for_org`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ProjectsSlashCreateForOrgError {
64    Status401(models::BasicError),
65    Status403(models::BasicError),
66    Status404(models::BasicError),
67    Status410(models::BasicError),
68    Status422(models::ValidationErrorSimple),
69    UnknownValue(serde_json::Value),
70}
71
72/// struct for typed errors of method [`projects_slash_create_for_repo`]
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum ProjectsSlashCreateForRepoError {
76    Status401(models::BasicError),
77    Status403(models::BasicError),
78    Status404(models::BasicError),
79    Status410(models::BasicError),
80    Status422(models::ValidationErrorSimple),
81    UnknownValue(serde_json::Value),
82}
83
84/// struct for typed errors of method [`projects_slash_delete`]
85#[derive(Debug, Clone, Serialize, Deserialize)]
86#[serde(untagged)]
87pub enum ProjectsSlashDeleteError {
88    Status401(models::BasicError),
89    Status403(models::ProjectsDeleteCard403Response),
90    Status404(models::BasicError),
91    Status410(models::BasicError),
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`projects_slash_delete_card`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ProjectsSlashDeleteCardError {
99    Status401(models::BasicError),
100    Status403(models::ProjectsDeleteCard403Response),
101    Status404(models::BasicError),
102    UnknownValue(serde_json::Value),
103}
104
105/// struct for typed errors of method [`projects_slash_delete_column`]
106#[derive(Debug, Clone, Serialize, Deserialize)]
107#[serde(untagged)]
108pub enum ProjectsSlashDeleteColumnError {
109    Status401(models::BasicError),
110    Status403(models::BasicError),
111    UnknownValue(serde_json::Value),
112}
113
114/// struct for typed errors of method [`projects_slash_get`]
115#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum ProjectsSlashGetError {
118    Status401(models::BasicError),
119    Status403(models::BasicError),
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`projects_slash_get_card`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum ProjectsSlashGetCardError {
127    Status401(models::BasicError),
128    Status403(models::BasicError),
129    Status404(models::BasicError),
130    UnknownValue(serde_json::Value),
131}
132
133/// struct for typed errors of method [`projects_slash_get_column`]
134#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum ProjectsSlashGetColumnError {
137    Status401(models::BasicError),
138    Status403(models::BasicError),
139    Status404(models::BasicError),
140    UnknownValue(serde_json::Value),
141}
142
143/// struct for typed errors of method [`projects_slash_get_permission_for_user`]
144#[derive(Debug, Clone, Serialize, Deserialize)]
145#[serde(untagged)]
146pub enum ProjectsSlashGetPermissionForUserError {
147    Status401(models::BasicError),
148    Status403(models::BasicError),
149    Status404(models::BasicError),
150    Status422(models::ValidationError),
151    UnknownValue(serde_json::Value),
152}
153
154/// struct for typed errors of method [`projects_slash_list_cards`]
155#[derive(Debug, Clone, Serialize, Deserialize)]
156#[serde(untagged)]
157pub enum ProjectsSlashListCardsError {
158    Status401(models::BasicError),
159    Status403(models::BasicError),
160    UnknownValue(serde_json::Value),
161}
162
163/// struct for typed errors of method [`projects_slash_list_collaborators`]
164#[derive(Debug, Clone, Serialize, Deserialize)]
165#[serde(untagged)]
166pub enum ProjectsSlashListCollaboratorsError {
167    Status401(models::BasicError),
168    Status403(models::BasicError),
169    Status404(models::BasicError),
170    Status422(models::ValidationError),
171    UnknownValue(serde_json::Value),
172}
173
174/// struct for typed errors of method [`projects_slash_list_columns`]
175#[derive(Debug, Clone, Serialize, Deserialize)]
176#[serde(untagged)]
177pub enum ProjectsSlashListColumnsError {
178    Status401(models::BasicError),
179    Status403(models::BasicError),
180    UnknownValue(serde_json::Value),
181}
182
183/// struct for typed errors of method [`projects_slash_list_for_org`]
184#[derive(Debug, Clone, Serialize, Deserialize)]
185#[serde(untagged)]
186pub enum ProjectsSlashListForOrgError {
187    Status422(models::ValidationErrorSimple),
188    UnknownValue(serde_json::Value),
189}
190
191/// struct for typed errors of method [`projects_slash_list_for_repo`]
192#[derive(Debug, Clone, Serialize, Deserialize)]
193#[serde(untagged)]
194pub enum ProjectsSlashListForRepoError {
195    Status401(models::BasicError),
196    Status403(models::BasicError),
197    Status404(models::BasicError),
198    Status410(models::BasicError),
199    Status422(models::ValidationErrorSimple),
200    UnknownValue(serde_json::Value),
201}
202
203/// struct for typed errors of method [`projects_slash_list_for_user`]
204#[derive(Debug, Clone, Serialize, Deserialize)]
205#[serde(untagged)]
206pub enum ProjectsSlashListForUserError {
207    Status422(models::ValidationError),
208    UnknownValue(serde_json::Value),
209}
210
211/// struct for typed errors of method [`projects_slash_move_card`]
212#[derive(Debug, Clone, Serialize, Deserialize)]
213#[serde(untagged)]
214pub enum ProjectsSlashMoveCardError {
215    Status401(models::BasicError),
216    Status403(models::ProjectsMoveCard403Response),
217    Status422(models::ValidationError),
218    Status503(models::ProjectsMoveCard503Response),
219    UnknownValue(serde_json::Value),
220}
221
222/// struct for typed errors of method [`projects_slash_move_column`]
223#[derive(Debug, Clone, Serialize, Deserialize)]
224#[serde(untagged)]
225pub enum ProjectsSlashMoveColumnError {
226    Status401(models::BasicError),
227    Status403(models::BasicError),
228    Status422(models::ValidationErrorSimple),
229    UnknownValue(serde_json::Value),
230}
231
232/// struct for typed errors of method [`projects_slash_remove_collaborator`]
233#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum ProjectsSlashRemoveCollaboratorError {
236    Status401(models::BasicError),
237    Status403(models::BasicError),
238    Status404(models::BasicError),
239    Status422(models::ValidationError),
240    UnknownValue(serde_json::Value),
241}
242
243/// struct for typed errors of method [`projects_slash_update`]
244#[derive(Debug, Clone, Serialize, Deserialize)]
245#[serde(untagged)]
246pub enum ProjectsSlashUpdateError {
247    Status401(models::BasicError),
248    Status403(models::ProjectsDeleteCard403Response),
249    Status404(),
250    Status410(models::BasicError),
251    Status422(models::ValidationErrorSimple),
252    UnknownValue(serde_json::Value),
253}
254
255/// struct for typed errors of method [`projects_slash_update_card`]
256#[derive(Debug, Clone, Serialize, Deserialize)]
257#[serde(untagged)]
258pub enum ProjectsSlashUpdateCardError {
259    Status401(models::BasicError),
260    Status403(models::BasicError),
261    Status404(models::BasicError),
262    Status422(models::ValidationErrorSimple),
263    UnknownValue(serde_json::Value),
264}
265
266/// struct for typed errors of method [`projects_slash_update_column`]
267#[derive(Debug, Clone, Serialize, Deserialize)]
268#[serde(untagged)]
269pub enum ProjectsSlashUpdateColumnError {
270    Status401(models::BasicError),
271    Status403(models::BasicError),
272    UnknownValue(serde_json::Value),
273}
274
275
276/// Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator.
277pub async fn projects_slash_add_collaborator(configuration: &configuration::Configuration, project_id: i32, username: &str, projects_add_collaborator_request: Option<models::ProjectsAddCollaboratorRequest>) -> Result<(), Error<ProjectsSlashAddCollaboratorError>> {
278    let local_var_configuration = configuration;
279
280    let local_var_client = &local_var_configuration.client;
281
282    let local_var_uri_str = format!("{}/projects/{project_id}/collaborators/{username}", local_var_configuration.base_path, project_id=project_id, username=crate::apis::urlencode(username));
283    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
284
285    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
286        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
287    }
288    local_var_req_builder = local_var_req_builder.json(&projects_add_collaborator_request);
289
290    let local_var_req = local_var_req_builder.build()?;
291    let local_var_resp = local_var_client.execute(local_var_req).await?;
292
293    let local_var_status = local_var_resp.status();
294    let local_var_content = local_var_resp.text().await?;
295
296    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
297        Ok(())
298    } else {
299        let local_var_entity: Option<ProjectsSlashAddCollaboratorError> = serde_json::from_str(&local_var_content).ok();
300        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
301        Err(Error::ResponseError(local_var_error))
302    }
303}
304
305/// 
306pub async fn projects_slash_create_card(configuration: &configuration::Configuration, column_id: i32, projects_create_card_request: models::ProjectsCreateCardRequest) -> Result<models::ProjectCard, Error<ProjectsSlashCreateCardError>> {
307    let local_var_configuration = configuration;
308
309    let local_var_client = &local_var_configuration.client;
310
311    let local_var_uri_str = format!("{}/projects/columns/{column_id}/cards", local_var_configuration.base_path, column_id=column_id);
312    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
313
314    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
315        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
316    }
317    local_var_req_builder = local_var_req_builder.json(&projects_create_card_request);
318
319    let local_var_req = local_var_req_builder.build()?;
320    let local_var_resp = local_var_client.execute(local_var_req).await?;
321
322    let local_var_status = local_var_resp.status();
323    let local_var_content = local_var_resp.text().await?;
324
325    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
326        serde_json::from_str(&local_var_content).map_err(Error::from)
327    } else {
328        let local_var_entity: Option<ProjectsSlashCreateCardError> = serde_json::from_str(&local_var_content).ok();
329        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
330        Err(Error::ResponseError(local_var_error))
331    }
332}
333
334/// Creates a new project column.
335pub async fn projects_slash_create_column(configuration: &configuration::Configuration, project_id: i32, projects_update_column_request: models::ProjectsUpdateColumnRequest) -> Result<models::ProjectColumn, Error<ProjectsSlashCreateColumnError>> {
336    let local_var_configuration = configuration;
337
338    let local_var_client = &local_var_configuration.client;
339
340    let local_var_uri_str = format!("{}/projects/{project_id}/columns", local_var_configuration.base_path, project_id=project_id);
341    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
342
343    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
344        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
345    }
346    local_var_req_builder = local_var_req_builder.json(&projects_update_column_request);
347
348    let local_var_req = local_var_req_builder.build()?;
349    let local_var_resp = local_var_client.execute(local_var_req).await?;
350
351    let local_var_status = local_var_resp.status();
352    let local_var_content = local_var_resp.text().await?;
353
354    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
355        serde_json::from_str(&local_var_content).map_err(Error::from)
356    } else {
357        let local_var_entity: Option<ProjectsSlashCreateColumnError> = serde_json::from_str(&local_var_content).ok();
358        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
359        Err(Error::ResponseError(local_var_error))
360    }
361}
362
363/// Creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
364pub async fn projects_slash_create_for_authenticated_user(configuration: &configuration::Configuration, projects_create_for_authenticated_user_request: models::ProjectsCreateForAuthenticatedUserRequest) -> Result<models::Project, Error<ProjectsSlashCreateForAuthenticatedUserError>> {
365    let local_var_configuration = configuration;
366
367    let local_var_client = &local_var_configuration.client;
368
369    let local_var_uri_str = format!("{}/user/projects", local_var_configuration.base_path);
370    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
371
372    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
373        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
374    }
375    local_var_req_builder = local_var_req_builder.json(&projects_create_for_authenticated_user_request);
376
377    let local_var_req = local_var_req_builder.build()?;
378    let local_var_resp = local_var_client.execute(local_var_req).await?;
379
380    let local_var_status = local_var_resp.status();
381    let local_var_content = local_var_resp.text().await?;
382
383    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
384        serde_json::from_str(&local_var_content).map_err(Error::from)
385    } else {
386        let local_var_entity: Option<ProjectsSlashCreateForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
387        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
388        Err(Error::ResponseError(local_var_error))
389    }
390}
391
392/// Creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
393pub async fn projects_slash_create_for_org(configuration: &configuration::Configuration, org: &str, projects_create_for_org_request: models::ProjectsCreateForOrgRequest) -> Result<models::Project, Error<ProjectsSlashCreateForOrgError>> {
394    let local_var_configuration = configuration;
395
396    let local_var_client = &local_var_configuration.client;
397
398    let local_var_uri_str = format!("{}/orgs/{org}/projects", local_var_configuration.base_path, org=crate::apis::urlencode(org));
399    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
400
401    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
402        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
403    }
404    local_var_req_builder = local_var_req_builder.json(&projects_create_for_org_request);
405
406    let local_var_req = local_var_req_builder.build()?;
407    let local_var_resp = local_var_client.execute(local_var_req).await?;
408
409    let local_var_status = local_var_resp.status();
410    let local_var_content = local_var_resp.text().await?;
411
412    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
413        serde_json::from_str(&local_var_content).map_err(Error::from)
414    } else {
415        let local_var_entity: Option<ProjectsSlashCreateForOrgError> = serde_json::from_str(&local_var_content).ok();
416        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
417        Err(Error::ResponseError(local_var_error))
418    }
419}
420
421/// Creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
422pub async fn projects_slash_create_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, projects_create_for_org_request: models::ProjectsCreateForOrgRequest) -> Result<models::Project, Error<ProjectsSlashCreateForRepoError>> {
423    let local_var_configuration = configuration;
424
425    let local_var_client = &local_var_configuration.client;
426
427    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/projects", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
428    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
429
430    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
431        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
432    }
433    local_var_req_builder = local_var_req_builder.json(&projects_create_for_org_request);
434
435    let local_var_req = local_var_req_builder.build()?;
436    let local_var_resp = local_var_client.execute(local_var_req).await?;
437
438    let local_var_status = local_var_resp.status();
439    let local_var_content = local_var_resp.text().await?;
440
441    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
442        serde_json::from_str(&local_var_content).map_err(Error::from)
443    } else {
444        let local_var_entity: Option<ProjectsSlashCreateForRepoError> = serde_json::from_str(&local_var_content).ok();
445        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
446        Err(Error::ResponseError(local_var_error))
447    }
448}
449
450/// Deletes a project board. Returns a `404 Not Found` status if projects are disabled.
451pub async fn projects_slash_delete(configuration: &configuration::Configuration, project_id: i32) -> Result<(), Error<ProjectsSlashDeleteError>> {
452    let local_var_configuration = configuration;
453
454    let local_var_client = &local_var_configuration.client;
455
456    let local_var_uri_str = format!("{}/projects/{project_id}", local_var_configuration.base_path, project_id=project_id);
457    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
458
459    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
460        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
461    }
462
463    let local_var_req = local_var_req_builder.build()?;
464    let local_var_resp = local_var_client.execute(local_var_req).await?;
465
466    let local_var_status = local_var_resp.status();
467    let local_var_content = local_var_resp.text().await?;
468
469    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
470        Ok(())
471    } else {
472        let local_var_entity: Option<ProjectsSlashDeleteError> = serde_json::from_str(&local_var_content).ok();
473        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
474        Err(Error::ResponseError(local_var_error))
475    }
476}
477
478/// Deletes a project card
479pub async fn projects_slash_delete_card(configuration: &configuration::Configuration, card_id: i32) -> Result<(), Error<ProjectsSlashDeleteCardError>> {
480    let local_var_configuration = configuration;
481
482    let local_var_client = &local_var_configuration.client;
483
484    let local_var_uri_str = format!("{}/projects/columns/cards/{card_id}", local_var_configuration.base_path, card_id=card_id);
485    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
486
487    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
488        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
489    }
490
491    let local_var_req = local_var_req_builder.build()?;
492    let local_var_resp = local_var_client.execute(local_var_req).await?;
493
494    let local_var_status = local_var_resp.status();
495    let local_var_content = local_var_resp.text().await?;
496
497    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
498        Ok(())
499    } else {
500        let local_var_entity: Option<ProjectsSlashDeleteCardError> = serde_json::from_str(&local_var_content).ok();
501        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
502        Err(Error::ResponseError(local_var_error))
503    }
504}
505
506/// Deletes a project column.
507pub async fn projects_slash_delete_column(configuration: &configuration::Configuration, column_id: i32) -> Result<(), Error<ProjectsSlashDeleteColumnError>> {
508    let local_var_configuration = configuration;
509
510    let local_var_client = &local_var_configuration.client;
511
512    let local_var_uri_str = format!("{}/projects/columns/{column_id}", local_var_configuration.base_path, column_id=column_id);
513    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
514
515    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
516        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
517    }
518
519    let local_var_req = local_var_req_builder.build()?;
520    let local_var_resp = local_var_client.execute(local_var_req).await?;
521
522    let local_var_status = local_var_resp.status();
523    let local_var_content = local_var_resp.text().await?;
524
525    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
526        Ok(())
527    } else {
528        let local_var_entity: Option<ProjectsSlashDeleteColumnError> = serde_json::from_str(&local_var_content).ok();
529        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
530        Err(Error::ResponseError(local_var_error))
531    }
532}
533
534/// Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
535pub async fn projects_slash_get(configuration: &configuration::Configuration, project_id: i32) -> Result<models::Project, Error<ProjectsSlashGetError>> {
536    let local_var_configuration = configuration;
537
538    let local_var_client = &local_var_configuration.client;
539
540    let local_var_uri_str = format!("{}/projects/{project_id}", local_var_configuration.base_path, project_id=project_id);
541    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
542
543    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
544        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
545    }
546
547    let local_var_req = local_var_req_builder.build()?;
548    let local_var_resp = local_var_client.execute(local_var_req).await?;
549
550    let local_var_status = local_var_resp.status();
551    let local_var_content = local_var_resp.text().await?;
552
553    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
554        serde_json::from_str(&local_var_content).map_err(Error::from)
555    } else {
556        let local_var_entity: Option<ProjectsSlashGetError> = serde_json::from_str(&local_var_content).ok();
557        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
558        Err(Error::ResponseError(local_var_error))
559    }
560}
561
562/// Gets information about a project card.
563pub async fn projects_slash_get_card(configuration: &configuration::Configuration, card_id: i32) -> Result<models::ProjectCard, Error<ProjectsSlashGetCardError>> {
564    let local_var_configuration = configuration;
565
566    let local_var_client = &local_var_configuration.client;
567
568    let local_var_uri_str = format!("{}/projects/columns/cards/{card_id}", local_var_configuration.base_path, card_id=card_id);
569    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
570
571    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
572        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
573    }
574
575    let local_var_req = local_var_req_builder.build()?;
576    let local_var_resp = local_var_client.execute(local_var_req).await?;
577
578    let local_var_status = local_var_resp.status();
579    let local_var_content = local_var_resp.text().await?;
580
581    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
582        serde_json::from_str(&local_var_content).map_err(Error::from)
583    } else {
584        let local_var_entity: Option<ProjectsSlashGetCardError> = serde_json::from_str(&local_var_content).ok();
585        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
586        Err(Error::ResponseError(local_var_error))
587    }
588}
589
590/// Gets information about a project column.
591pub async fn projects_slash_get_column(configuration: &configuration::Configuration, column_id: i32) -> Result<models::ProjectColumn, Error<ProjectsSlashGetColumnError>> {
592    let local_var_configuration = configuration;
593
594    let local_var_client = &local_var_configuration.client;
595
596    let local_var_uri_str = format!("{}/projects/columns/{column_id}", local_var_configuration.base_path, column_id=column_id);
597    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
598
599    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
600        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
601    }
602
603    let local_var_req = local_var_req_builder.build()?;
604    let local_var_resp = local_var_client.execute(local_var_req).await?;
605
606    let local_var_status = local_var_resp.status();
607    let local_var_content = local_var_resp.text().await?;
608
609    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
610        serde_json::from_str(&local_var_content).map_err(Error::from)
611    } else {
612        let local_var_entity: Option<ProjectsSlashGetColumnError> = serde_json::from_str(&local_var_content).ok();
613        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
614        Err(Error::ResponseError(local_var_error))
615    }
616}
617
618/// Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level.
619pub async fn projects_slash_get_permission_for_user(configuration: &configuration::Configuration, project_id: i32, username: &str) -> Result<models::ProjectCollaboratorPermission, Error<ProjectsSlashGetPermissionForUserError>> {
620    let local_var_configuration = configuration;
621
622    let local_var_client = &local_var_configuration.client;
623
624    let local_var_uri_str = format!("{}/projects/{project_id}/collaborators/{username}/permission", local_var_configuration.base_path, project_id=project_id, username=crate::apis::urlencode(username));
625    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
626
627    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
628        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
629    }
630
631    let local_var_req = local_var_req_builder.build()?;
632    let local_var_resp = local_var_client.execute(local_var_req).await?;
633
634    let local_var_status = local_var_resp.status();
635    let local_var_content = local_var_resp.text().await?;
636
637    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
638        serde_json::from_str(&local_var_content).map_err(Error::from)
639    } else {
640        let local_var_entity: Option<ProjectsSlashGetPermissionForUserError> = serde_json::from_str(&local_var_content).ok();
641        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
642        Err(Error::ResponseError(local_var_error))
643    }
644}
645
646/// Lists the project cards in a project.
647pub async fn projects_slash_list_cards(configuration: &configuration::Configuration, column_id: i32, archived_state: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::ProjectCard>, Error<ProjectsSlashListCardsError>> {
648    let local_var_configuration = configuration;
649
650    let local_var_client = &local_var_configuration.client;
651
652    let local_var_uri_str = format!("{}/projects/columns/{column_id}/cards", local_var_configuration.base_path, column_id=column_id);
653    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
654
655    if let Some(ref local_var_str) = archived_state {
656        local_var_req_builder = local_var_req_builder.query(&[("archived_state", &local_var_str.to_string())]);
657    }
658    if let Some(ref local_var_str) = per_page {
659        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
660    }
661    if let Some(ref local_var_str) = page {
662        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
663    }
664    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
665        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
666    }
667
668    let local_var_req = local_var_req_builder.build()?;
669    let local_var_resp = local_var_client.execute(local_var_req).await?;
670
671    let local_var_status = local_var_resp.status();
672    let local_var_content = local_var_resp.text().await?;
673
674    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
675        serde_json::from_str(&local_var_content).map_err(Error::from)
676    } else {
677        let local_var_entity: Option<ProjectsSlashListCardsError> = serde_json::from_str(&local_var_content).ok();
678        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
679        Err(Error::ResponseError(local_var_error))
680    }
681}
682
683/// Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators.
684pub async fn projects_slash_list_collaborators(configuration: &configuration::Configuration, project_id: i32, affiliation: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::SimpleUser>, Error<ProjectsSlashListCollaboratorsError>> {
685    let local_var_configuration = configuration;
686
687    let local_var_client = &local_var_configuration.client;
688
689    let local_var_uri_str = format!("{}/projects/{project_id}/collaborators", local_var_configuration.base_path, project_id=project_id);
690    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
691
692    if let Some(ref local_var_str) = affiliation {
693        local_var_req_builder = local_var_req_builder.query(&[("affiliation", &local_var_str.to_string())]);
694    }
695    if let Some(ref local_var_str) = per_page {
696        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
697    }
698    if let Some(ref local_var_str) = page {
699        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
700    }
701    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
702        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
703    }
704
705    let local_var_req = local_var_req_builder.build()?;
706    let local_var_resp = local_var_client.execute(local_var_req).await?;
707
708    let local_var_status = local_var_resp.status();
709    let local_var_content = local_var_resp.text().await?;
710
711    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
712        serde_json::from_str(&local_var_content).map_err(Error::from)
713    } else {
714        let local_var_entity: Option<ProjectsSlashListCollaboratorsError> = serde_json::from_str(&local_var_content).ok();
715        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
716        Err(Error::ResponseError(local_var_error))
717    }
718}
719
720/// Lists the project columns in a project.
721pub async fn projects_slash_list_columns(configuration: &configuration::Configuration, project_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::ProjectColumn>, Error<ProjectsSlashListColumnsError>> {
722    let local_var_configuration = configuration;
723
724    let local_var_client = &local_var_configuration.client;
725
726    let local_var_uri_str = format!("{}/projects/{project_id}/columns", local_var_configuration.base_path, project_id=project_id);
727    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
728
729    if let Some(ref local_var_str) = per_page {
730        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
731    }
732    if let Some(ref local_var_str) = page {
733        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
734    }
735    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
736        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
737    }
738
739    let local_var_req = local_var_req_builder.build()?;
740    let local_var_resp = local_var_client.execute(local_var_req).await?;
741
742    let local_var_status = local_var_resp.status();
743    let local_var_content = local_var_resp.text().await?;
744
745    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
746        serde_json::from_str(&local_var_content).map_err(Error::from)
747    } else {
748        let local_var_entity: Option<ProjectsSlashListColumnsError> = serde_json::from_str(&local_var_content).ok();
749        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
750        Err(Error::ResponseError(local_var_error))
751    }
752}
753
754/// Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
755pub async fn projects_slash_list_for_org(configuration: &configuration::Configuration, org: &str, state: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Project>, Error<ProjectsSlashListForOrgError>> {
756    let local_var_configuration = configuration;
757
758    let local_var_client = &local_var_configuration.client;
759
760    let local_var_uri_str = format!("{}/orgs/{org}/projects", local_var_configuration.base_path, org=crate::apis::urlencode(org));
761    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
762
763    if let Some(ref local_var_str) = state {
764        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
765    }
766    if let Some(ref local_var_str) = per_page {
767        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
768    }
769    if let Some(ref local_var_str) = page {
770        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
771    }
772    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
773        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
774    }
775
776    let local_var_req = local_var_req_builder.build()?;
777    let local_var_resp = local_var_client.execute(local_var_req).await?;
778
779    let local_var_status = local_var_resp.status();
780    let local_var_content = local_var_resp.text().await?;
781
782    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
783        serde_json::from_str(&local_var_content).map_err(Error::from)
784    } else {
785        let local_var_entity: Option<ProjectsSlashListForOrgError> = serde_json::from_str(&local_var_content).ok();
786        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
787        Err(Error::ResponseError(local_var_error))
788    }
789}
790
791/// Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
792pub async fn projects_slash_list_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, state: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Project>, Error<ProjectsSlashListForRepoError>> {
793    let local_var_configuration = configuration;
794
795    let local_var_client = &local_var_configuration.client;
796
797    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/projects", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
798    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
799
800    if let Some(ref local_var_str) = state {
801        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
802    }
803    if let Some(ref local_var_str) = per_page {
804        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
805    }
806    if let Some(ref local_var_str) = page {
807        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
808    }
809    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
810        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
811    }
812
813    let local_var_req = local_var_req_builder.build()?;
814    let local_var_resp = local_var_client.execute(local_var_req).await?;
815
816    let local_var_status = local_var_resp.status();
817    let local_var_content = local_var_resp.text().await?;
818
819    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
820        serde_json::from_str(&local_var_content).map_err(Error::from)
821    } else {
822        let local_var_entity: Option<ProjectsSlashListForRepoError> = serde_json::from_str(&local_var_content).ok();
823        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
824        Err(Error::ResponseError(local_var_error))
825    }
826}
827
828/// Lists projects for a user.
829pub async fn projects_slash_list_for_user(configuration: &configuration::Configuration, username: &str, state: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Project>, Error<ProjectsSlashListForUserError>> {
830    let local_var_configuration = configuration;
831
832    let local_var_client = &local_var_configuration.client;
833
834    let local_var_uri_str = format!("{}/users/{username}/projects", local_var_configuration.base_path, username=crate::apis::urlencode(username));
835    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
836
837    if let Some(ref local_var_str) = state {
838        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
839    }
840    if let Some(ref local_var_str) = per_page {
841        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
842    }
843    if let Some(ref local_var_str) = page {
844        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
845    }
846    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
847        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
848    }
849
850    let local_var_req = local_var_req_builder.build()?;
851    let local_var_resp = local_var_client.execute(local_var_req).await?;
852
853    let local_var_status = local_var_resp.status();
854    let local_var_content = local_var_resp.text().await?;
855
856    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
857        serde_json::from_str(&local_var_content).map_err(Error::from)
858    } else {
859        let local_var_entity: Option<ProjectsSlashListForUserError> = serde_json::from_str(&local_var_content).ok();
860        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
861        Err(Error::ResponseError(local_var_error))
862    }
863}
864
865/// 
866pub async fn projects_slash_move_card(configuration: &configuration::Configuration, card_id: i32, projects_move_card_request: models::ProjectsMoveCardRequest) -> Result<serde_json::Value, Error<ProjectsSlashMoveCardError>> {
867    let local_var_configuration = configuration;
868
869    let local_var_client = &local_var_configuration.client;
870
871    let local_var_uri_str = format!("{}/projects/columns/cards/{card_id}/moves", local_var_configuration.base_path, card_id=card_id);
872    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
873
874    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
875        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
876    }
877    local_var_req_builder = local_var_req_builder.json(&projects_move_card_request);
878
879    let local_var_req = local_var_req_builder.build()?;
880    let local_var_resp = local_var_client.execute(local_var_req).await?;
881
882    let local_var_status = local_var_resp.status();
883    let local_var_content = local_var_resp.text().await?;
884
885    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
886        serde_json::from_str(&local_var_content).map_err(Error::from)
887    } else {
888        let local_var_entity: Option<ProjectsSlashMoveCardError> = serde_json::from_str(&local_var_content).ok();
889        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
890        Err(Error::ResponseError(local_var_error))
891    }
892}
893
894/// 
895pub async fn projects_slash_move_column(configuration: &configuration::Configuration, column_id: i32, projects_move_column_request: models::ProjectsMoveColumnRequest) -> Result<serde_json::Value, Error<ProjectsSlashMoveColumnError>> {
896    let local_var_configuration = configuration;
897
898    let local_var_client = &local_var_configuration.client;
899
900    let local_var_uri_str = format!("{}/projects/columns/{column_id}/moves", local_var_configuration.base_path, column_id=column_id);
901    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
902
903    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
904        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
905    }
906    local_var_req_builder = local_var_req_builder.json(&projects_move_column_request);
907
908    let local_var_req = local_var_req_builder.build()?;
909    let local_var_resp = local_var_client.execute(local_var_req).await?;
910
911    let local_var_status = local_var_resp.status();
912    let local_var_content = local_var_resp.text().await?;
913
914    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
915        serde_json::from_str(&local_var_content).map_err(Error::from)
916    } else {
917        let local_var_entity: Option<ProjectsSlashMoveColumnError> = serde_json::from_str(&local_var_content).ok();
918        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
919        Err(Error::ResponseError(local_var_error))
920    }
921}
922
923/// Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator.
924pub async fn projects_slash_remove_collaborator(configuration: &configuration::Configuration, project_id: i32, username: &str) -> Result<(), Error<ProjectsSlashRemoveCollaboratorError>> {
925    let local_var_configuration = configuration;
926
927    let local_var_client = &local_var_configuration.client;
928
929    let local_var_uri_str = format!("{}/projects/{project_id}/collaborators/{username}", local_var_configuration.base_path, project_id=project_id, username=crate::apis::urlencode(username));
930    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
931
932    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
933        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
934    }
935
936    let local_var_req = local_var_req_builder.build()?;
937    let local_var_resp = local_var_client.execute(local_var_req).await?;
938
939    let local_var_status = local_var_resp.status();
940    let local_var_content = local_var_resp.text().await?;
941
942    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
943        Ok(())
944    } else {
945        let local_var_entity: Option<ProjectsSlashRemoveCollaboratorError> = serde_json::from_str(&local_var_content).ok();
946        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
947        Err(Error::ResponseError(local_var_error))
948    }
949}
950
951/// Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.
952pub async fn projects_slash_update(configuration: &configuration::Configuration, project_id: i32, projects_update_request: Option<models::ProjectsUpdateRequest>) -> Result<models::Project, Error<ProjectsSlashUpdateError>> {
953    let local_var_configuration = configuration;
954
955    let local_var_client = &local_var_configuration.client;
956
957    let local_var_uri_str = format!("{}/projects/{project_id}", local_var_configuration.base_path, project_id=project_id);
958    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
959
960    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
961        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
962    }
963    local_var_req_builder = local_var_req_builder.json(&projects_update_request);
964
965    let local_var_req = local_var_req_builder.build()?;
966    let local_var_resp = local_var_client.execute(local_var_req).await?;
967
968    let local_var_status = local_var_resp.status();
969    let local_var_content = local_var_resp.text().await?;
970
971    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
972        serde_json::from_str(&local_var_content).map_err(Error::from)
973    } else {
974        let local_var_entity: Option<ProjectsSlashUpdateError> = serde_json::from_str(&local_var_content).ok();
975        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
976        Err(Error::ResponseError(local_var_error))
977    }
978}
979
980/// 
981pub async fn projects_slash_update_card(configuration: &configuration::Configuration, card_id: i32, projects_update_card_request: Option<models::ProjectsUpdateCardRequest>) -> Result<models::ProjectCard, Error<ProjectsSlashUpdateCardError>> {
982    let local_var_configuration = configuration;
983
984    let local_var_client = &local_var_configuration.client;
985
986    let local_var_uri_str = format!("{}/projects/columns/cards/{card_id}", local_var_configuration.base_path, card_id=card_id);
987    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
988
989    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
990        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
991    }
992    local_var_req_builder = local_var_req_builder.json(&projects_update_card_request);
993
994    let local_var_req = local_var_req_builder.build()?;
995    let local_var_resp = local_var_client.execute(local_var_req).await?;
996
997    let local_var_status = local_var_resp.status();
998    let local_var_content = local_var_resp.text().await?;
999
1000    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1001        serde_json::from_str(&local_var_content).map_err(Error::from)
1002    } else {
1003        let local_var_entity: Option<ProjectsSlashUpdateCardError> = serde_json::from_str(&local_var_content).ok();
1004        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1005        Err(Error::ResponseError(local_var_error))
1006    }
1007}
1008
1009/// 
1010pub async fn projects_slash_update_column(configuration: &configuration::Configuration, column_id: i32, projects_update_column_request: models::ProjectsUpdateColumnRequest) -> Result<models::ProjectColumn, Error<ProjectsSlashUpdateColumnError>> {
1011    let local_var_configuration = configuration;
1012
1013    let local_var_client = &local_var_configuration.client;
1014
1015    let local_var_uri_str = format!("{}/projects/columns/{column_id}", local_var_configuration.base_path, column_id=column_id);
1016    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1017
1018    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1019        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1020    }
1021    local_var_req_builder = local_var_req_builder.json(&projects_update_column_request);
1022
1023    let local_var_req = local_var_req_builder.build()?;
1024    let local_var_resp = local_var_client.execute(local_var_req).await?;
1025
1026    let local_var_status = local_var_resp.status();
1027    let local_var_content = local_var_resp.text().await?;
1028
1029    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1030        serde_json::from_str(&local_var_content).map_err(Error::from)
1031    } else {
1032        let local_var_entity: Option<ProjectsSlashUpdateColumnError> = serde_json::from_str(&local_var_content).ok();
1033        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1034        Err(Error::ResponseError(local_var_error))
1035    }
1036}
1037