openapi_github/apis/
issues_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 [`issues_slash_add_assignees`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum IssuesSlashAddAssigneesError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`issues_slash_add_labels`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum IssuesSlashAddLabelsError {
29    Status404(models::BasicError),
30    Status410(models::BasicError),
31    Status422(models::ValidationError),
32    UnknownValue(serde_json::Value),
33}
34
35/// struct for typed errors of method [`issues_slash_check_user_can_be_assigned`]
36#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(untagged)]
38pub enum IssuesSlashCheckUserCanBeAssignedError {
39    Status404(models::BasicError),
40    UnknownValue(serde_json::Value),
41}
42
43/// struct for typed errors of method [`issues_slash_check_user_can_be_assigned_to_issue`]
44#[derive(Debug, Clone, Serialize, Deserialize)]
45#[serde(untagged)]
46pub enum IssuesSlashCheckUserCanBeAssignedToIssueError {
47    Status404(models::BasicError),
48    UnknownValue(serde_json::Value),
49}
50
51/// struct for typed errors of method [`issues_slash_create`]
52#[derive(Debug, Clone, Serialize, Deserialize)]
53#[serde(untagged)]
54pub enum IssuesSlashCreateError {
55    Status400(models::BasicError),
56    Status403(models::BasicError),
57    Status404(models::BasicError),
58    Status410(models::BasicError),
59    Status422(models::ValidationError),
60    Status503(models::SecretScanningListAlertsForEnterprise503Response),
61    UnknownValue(serde_json::Value),
62}
63
64/// struct for typed errors of method [`issues_slash_create_comment`]
65#[derive(Debug, Clone, Serialize, Deserialize)]
66#[serde(untagged)]
67pub enum IssuesSlashCreateCommentError {
68    Status403(models::BasicError),
69    Status404(models::BasicError),
70    Status410(models::BasicError),
71    Status422(models::ValidationError),
72    UnknownValue(serde_json::Value),
73}
74
75/// struct for typed errors of method [`issues_slash_create_label`]
76#[derive(Debug, Clone, Serialize, Deserialize)]
77#[serde(untagged)]
78pub enum IssuesSlashCreateLabelError {
79    Status404(models::BasicError),
80    Status422(models::ValidationError),
81    UnknownValue(serde_json::Value),
82}
83
84/// struct for typed errors of method [`issues_slash_create_milestone`]
85#[derive(Debug, Clone, Serialize, Deserialize)]
86#[serde(untagged)]
87pub enum IssuesSlashCreateMilestoneError {
88    Status404(models::BasicError),
89    Status422(models::ValidationError),
90    UnknownValue(serde_json::Value),
91}
92
93/// struct for typed errors of method [`issues_slash_delete_comment`]
94#[derive(Debug, Clone, Serialize, Deserialize)]
95#[serde(untagged)]
96pub enum IssuesSlashDeleteCommentError {
97    UnknownValue(serde_json::Value),
98}
99
100/// struct for typed errors of method [`issues_slash_delete_label`]
101#[derive(Debug, Clone, Serialize, Deserialize)]
102#[serde(untagged)]
103pub enum IssuesSlashDeleteLabelError {
104    UnknownValue(serde_json::Value),
105}
106
107/// struct for typed errors of method [`issues_slash_delete_milestone`]
108#[derive(Debug, Clone, Serialize, Deserialize)]
109#[serde(untagged)]
110pub enum IssuesSlashDeleteMilestoneError {
111    Status404(models::BasicError),
112    UnknownValue(serde_json::Value),
113}
114
115/// struct for typed errors of method [`issues_slash_get`]
116#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum IssuesSlashGetError {
119    Status404(models::BasicError),
120    Status410(models::BasicError),
121    UnknownValue(serde_json::Value),
122}
123
124/// struct for typed errors of method [`issues_slash_get_comment`]
125#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum IssuesSlashGetCommentError {
128    Status404(models::BasicError),
129    UnknownValue(serde_json::Value),
130}
131
132/// struct for typed errors of method [`issues_slash_get_event`]
133#[derive(Debug, Clone, Serialize, Deserialize)]
134#[serde(untagged)]
135pub enum IssuesSlashGetEventError {
136    Status403(models::BasicError),
137    Status404(models::BasicError),
138    Status410(models::BasicError),
139    UnknownValue(serde_json::Value),
140}
141
142/// struct for typed errors of method [`issues_slash_get_label`]
143#[derive(Debug, Clone, Serialize, Deserialize)]
144#[serde(untagged)]
145pub enum IssuesSlashGetLabelError {
146    Status404(models::BasicError),
147    UnknownValue(serde_json::Value),
148}
149
150/// struct for typed errors of method [`issues_slash_get_milestone`]
151#[derive(Debug, Clone, Serialize, Deserialize)]
152#[serde(untagged)]
153pub enum IssuesSlashGetMilestoneError {
154    Status404(models::BasicError),
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`issues_slash_list`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum IssuesSlashListError {
162    Status404(models::BasicError),
163    Status422(models::ValidationError),
164    UnknownValue(serde_json::Value),
165}
166
167/// struct for typed errors of method [`issues_slash_list_assignees`]
168#[derive(Debug, Clone, Serialize, Deserialize)]
169#[serde(untagged)]
170pub enum IssuesSlashListAssigneesError {
171    Status404(models::BasicError),
172    UnknownValue(serde_json::Value),
173}
174
175/// struct for typed errors of method [`issues_slash_list_comments`]
176#[derive(Debug, Clone, Serialize, Deserialize)]
177#[serde(untagged)]
178pub enum IssuesSlashListCommentsError {
179    Status404(models::BasicError),
180    Status410(models::BasicError),
181    UnknownValue(serde_json::Value),
182}
183
184/// struct for typed errors of method [`issues_slash_list_comments_for_repo`]
185#[derive(Debug, Clone, Serialize, Deserialize)]
186#[serde(untagged)]
187pub enum IssuesSlashListCommentsForRepoError {
188    Status404(models::BasicError),
189    Status422(models::ValidationError),
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`issues_slash_list_events`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum IssuesSlashListEventsError {
197    Status410(models::BasicError),
198    UnknownValue(serde_json::Value),
199}
200
201/// struct for typed errors of method [`issues_slash_list_events_for_repo`]
202#[derive(Debug, Clone, Serialize, Deserialize)]
203#[serde(untagged)]
204pub enum IssuesSlashListEventsForRepoError {
205    Status422(models::ValidationError),
206    UnknownValue(serde_json::Value),
207}
208
209/// struct for typed errors of method [`issues_slash_list_events_for_timeline`]
210#[derive(Debug, Clone, Serialize, Deserialize)]
211#[serde(untagged)]
212pub enum IssuesSlashListEventsForTimelineError {
213    Status404(models::BasicError),
214    Status410(models::BasicError),
215    UnknownValue(serde_json::Value),
216}
217
218/// struct for typed errors of method [`issues_slash_list_for_authenticated_user`]
219#[derive(Debug, Clone, Serialize, Deserialize)]
220#[serde(untagged)]
221pub enum IssuesSlashListForAuthenticatedUserError {
222    Status404(models::BasicError),
223    UnknownValue(serde_json::Value),
224}
225
226/// struct for typed errors of method [`issues_slash_list_for_org`]
227#[derive(Debug, Clone, Serialize, Deserialize)]
228#[serde(untagged)]
229pub enum IssuesSlashListForOrgError {
230    Status404(models::BasicError),
231    UnknownValue(serde_json::Value),
232}
233
234/// struct for typed errors of method [`issues_slash_list_for_repo`]
235#[derive(Debug, Clone, Serialize, Deserialize)]
236#[serde(untagged)]
237pub enum IssuesSlashListForRepoError {
238    Status404(models::BasicError),
239    Status422(models::ValidationError),
240    UnknownValue(serde_json::Value),
241}
242
243/// struct for typed errors of method [`issues_slash_list_labels_for_milestone`]
244#[derive(Debug, Clone, Serialize, Deserialize)]
245#[serde(untagged)]
246pub enum IssuesSlashListLabelsForMilestoneError {
247    UnknownValue(serde_json::Value),
248}
249
250/// struct for typed errors of method [`issues_slash_list_labels_for_repo`]
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum IssuesSlashListLabelsForRepoError {
254    Status404(models::BasicError),
255    UnknownValue(serde_json::Value),
256}
257
258/// struct for typed errors of method [`issues_slash_list_labels_on_issue`]
259#[derive(Debug, Clone, Serialize, Deserialize)]
260#[serde(untagged)]
261pub enum IssuesSlashListLabelsOnIssueError {
262    Status404(models::BasicError),
263    Status410(models::BasicError),
264    UnknownValue(serde_json::Value),
265}
266
267/// struct for typed errors of method [`issues_slash_list_milestones`]
268#[derive(Debug, Clone, Serialize, Deserialize)]
269#[serde(untagged)]
270pub enum IssuesSlashListMilestonesError {
271    Status404(models::BasicError),
272    UnknownValue(serde_json::Value),
273}
274
275/// struct for typed errors of method [`issues_slash_lock`]
276#[derive(Debug, Clone, Serialize, Deserialize)]
277#[serde(untagged)]
278pub enum IssuesSlashLockError {
279    Status403(models::BasicError),
280    Status404(models::BasicError),
281    Status410(models::BasicError),
282    Status422(models::ValidationError),
283    UnknownValue(serde_json::Value),
284}
285
286/// struct for typed errors of method [`issues_slash_remove_all_labels`]
287#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(untagged)]
289pub enum IssuesSlashRemoveAllLabelsError {
290    Status404(models::BasicError),
291    Status410(models::BasicError),
292    UnknownValue(serde_json::Value),
293}
294
295/// struct for typed errors of method [`issues_slash_remove_assignees`]
296#[derive(Debug, Clone, Serialize, Deserialize)]
297#[serde(untagged)]
298pub enum IssuesSlashRemoveAssigneesError {
299    UnknownValue(serde_json::Value),
300}
301
302/// struct for typed errors of method [`issues_slash_remove_label`]
303#[derive(Debug, Clone, Serialize, Deserialize)]
304#[serde(untagged)]
305pub enum IssuesSlashRemoveLabelError {
306    Status404(models::BasicError),
307    Status410(models::BasicError),
308    UnknownValue(serde_json::Value),
309}
310
311/// struct for typed errors of method [`issues_slash_set_labels`]
312#[derive(Debug, Clone, Serialize, Deserialize)]
313#[serde(untagged)]
314pub enum IssuesSlashSetLabelsError {
315    Status404(models::BasicError),
316    Status410(models::BasicError),
317    Status422(models::ValidationError),
318    UnknownValue(serde_json::Value),
319}
320
321/// struct for typed errors of method [`issues_slash_unlock`]
322#[derive(Debug, Clone, Serialize, Deserialize)]
323#[serde(untagged)]
324pub enum IssuesSlashUnlockError {
325    Status403(models::BasicError),
326    Status404(models::BasicError),
327    UnknownValue(serde_json::Value),
328}
329
330/// struct for typed errors of method [`issues_slash_update`]
331#[derive(Debug, Clone, Serialize, Deserialize)]
332#[serde(untagged)]
333pub enum IssuesSlashUpdateError {
334    Status403(models::BasicError),
335    Status404(models::BasicError),
336    Status410(models::BasicError),
337    Status422(models::ValidationError),
338    Status503(models::SecretScanningListAlertsForEnterprise503Response),
339    UnknownValue(serde_json::Value),
340}
341
342/// struct for typed errors of method [`issues_slash_update_comment`]
343#[derive(Debug, Clone, Serialize, Deserialize)]
344#[serde(untagged)]
345pub enum IssuesSlashUpdateCommentError {
346    Status422(models::ValidationError),
347    UnknownValue(serde_json::Value),
348}
349
350/// struct for typed errors of method [`issues_slash_update_label`]
351#[derive(Debug, Clone, Serialize, Deserialize)]
352#[serde(untagged)]
353pub enum IssuesSlashUpdateLabelError {
354    UnknownValue(serde_json::Value),
355}
356
357/// struct for typed errors of method [`issues_slash_update_milestone`]
358#[derive(Debug, Clone, Serialize, Deserialize)]
359#[serde(untagged)]
360pub enum IssuesSlashUpdateMilestoneError {
361    UnknownValue(serde_json::Value),
362}
363
364
365/// Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced.
366pub async fn issues_slash_add_assignees(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, issues_add_assignees_request: Option<models::IssuesAddAssigneesRequest>) -> Result<models::Issue, Error<IssuesSlashAddAssigneesError>> {
367    let local_var_configuration = configuration;
368
369    let local_var_client = &local_var_configuration.client;
370
371    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/assignees", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
372    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
373
374    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
375        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
376    }
377    local_var_req_builder = local_var_req_builder.json(&issues_add_assignees_request);
378
379    let local_var_req = local_var_req_builder.build()?;
380    let local_var_resp = local_var_client.execute(local_var_req).await?;
381
382    let local_var_status = local_var_resp.status();
383    let local_var_content = local_var_resp.text().await?;
384
385    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
386        serde_json::from_str(&local_var_content).map_err(Error::from)
387    } else {
388        let local_var_entity: Option<IssuesSlashAddAssigneesError> = serde_json::from_str(&local_var_content).ok();
389        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
390        Err(Error::ResponseError(local_var_error))
391    }
392}
393
394/// Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. 
395pub async fn issues_slash_add_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, issues_add_labels_request: Option<models::IssuesAddLabelsRequest>) -> Result<Vec<models::Label>, Error<IssuesSlashAddLabelsError>> {
396    let local_var_configuration = configuration;
397
398    let local_var_client = &local_var_configuration.client;
399
400    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
401    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
402
403    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
404        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
405    }
406    local_var_req_builder = local_var_req_builder.json(&issues_add_labels_request);
407
408    let local_var_req = local_var_req_builder.build()?;
409    let local_var_resp = local_var_client.execute(local_var_req).await?;
410
411    let local_var_status = local_var_resp.status();
412    let local_var_content = local_var_resp.text().await?;
413
414    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
415        serde_json::from_str(&local_var_content).map_err(Error::from)
416    } else {
417        let local_var_entity: Option<IssuesSlashAddLabelsError> = serde_json::from_str(&local_var_content).ok();
418        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
419        Err(Error::ResponseError(local_var_error))
420    }
421}
422
423/// Checks if a user has permission to be assigned to an issue in this repository.  If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.  Otherwise a `404` status code is returned.
424pub async fn issues_slash_check_user_can_be_assigned(configuration: &configuration::Configuration, owner: &str, repo: &str, assignee: &str) -> Result<(), Error<IssuesSlashCheckUserCanBeAssignedError>> {
425    let local_var_configuration = configuration;
426
427    let local_var_client = &local_var_configuration.client;
428
429    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/assignees/{assignee}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), assignee=crate::apis::urlencode(assignee));
430    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
431
432    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
433        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
434    }
435
436    let local_var_req = local_var_req_builder.build()?;
437    let local_var_resp = local_var_client.execute(local_var_req).await?;
438
439    let local_var_status = local_var_resp.status();
440    let local_var_content = local_var_resp.text().await?;
441
442    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
443        Ok(())
444    } else {
445        let local_var_entity: Option<IssuesSlashCheckUserCanBeAssignedError> = serde_json::from_str(&local_var_content).ok();
446        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
447        Err(Error::ResponseError(local_var_error))
448    }
449}
450
451/// Checks if a user has permission to be assigned to a specific issue.  If the `assignee` can be assigned to this issue, a `204` status code with no content is returned.  Otherwise a `404` status code is returned.
452pub async fn issues_slash_check_user_can_be_assigned_to_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, assignee: &str) -> Result<(), Error<IssuesSlashCheckUserCanBeAssignedToIssueError>> {
453    let local_var_configuration = configuration;
454
455    let local_var_client = &local_var_configuration.client;
456
457    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number, assignee=crate::apis::urlencode(assignee));
458    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
459
460    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
461        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
462    }
463
464    let local_var_req = local_var_req_builder.build()?;
465    let local_var_resp = local_var_client.execute(local_var_req).await?;
466
467    let local_var_status = local_var_resp.status();
468    let local_var_content = local_var_resp.text().await?;
469
470    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
471        Ok(())
472    } else {
473        let local_var_entity: Option<IssuesSlashCheckUserCanBeAssignedToIssueError> = serde_json::from_str(&local_var_content).ok();
474        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
475        Err(Error::ResponseError(local_var_error))
476    }
477}
478
479/// Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status.  This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see \"[Rate limits for the API](https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits)\" and \"[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).\"  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
480pub async fn issues_slash_create(configuration: &configuration::Configuration, owner: &str, repo: &str, issues_create_request: models::IssuesCreateRequest) -> Result<models::Issue, Error<IssuesSlashCreateError>> {
481    let local_var_configuration = configuration;
482
483    let local_var_client = &local_var_configuration.client;
484
485    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
486    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
487
488    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
489        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
490    }
491    local_var_req_builder = local_var_req_builder.json(&issues_create_request);
492
493    let local_var_req = local_var_req_builder.build()?;
494    let local_var_resp = local_var_client.execute(local_var_req).await?;
495
496    let local_var_status = local_var_resp.status();
497    let local_var_content = local_var_resp.text().await?;
498
499    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
500        serde_json::from_str(&local_var_content).map_err(Error::from)
501    } else {
502        let local_var_entity: Option<IssuesSlashCreateError> = serde_json::from_str(&local_var_content).ok();
503        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
504        Err(Error::ResponseError(local_var_error))
505    }
506}
507
508/// You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.  This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see \"[Rate limits for the API](https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits)\" and \"[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api).\"  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
509pub async fn issues_slash_create_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, issues_update_comment_request: models::IssuesUpdateCommentRequest) -> Result<models::IssueComment, Error<IssuesSlashCreateCommentError>> {
510    let local_var_configuration = configuration;
511
512    let local_var_client = &local_var_configuration.client;
513
514    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
515    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
516
517    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
518        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
519    }
520    local_var_req_builder = local_var_req_builder.json(&issues_update_comment_request);
521
522    let local_var_req = local_var_req_builder.build()?;
523    let local_var_resp = local_var_client.execute(local_var_req).await?;
524
525    let local_var_status = local_var_resp.status();
526    let local_var_content = local_var_resp.text().await?;
527
528    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
529        serde_json::from_str(&local_var_content).map_err(Error::from)
530    } else {
531        let local_var_entity: Option<IssuesSlashCreateCommentError> = serde_json::from_str(&local_var_content).ok();
532        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
533        Err(Error::ResponseError(local_var_error))
534    }
535}
536
537/// Creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/).
538pub async fn issues_slash_create_label(configuration: &configuration::Configuration, owner: &str, repo: &str, issues_create_label_request: models::IssuesCreateLabelRequest) -> Result<models::Label, Error<IssuesSlashCreateLabelError>> {
539    let local_var_configuration = configuration;
540
541    let local_var_client = &local_var_configuration.client;
542
543    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
544    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
545
546    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
547        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
548    }
549    local_var_req_builder = local_var_req_builder.json(&issues_create_label_request);
550
551    let local_var_req = local_var_req_builder.build()?;
552    let local_var_resp = local_var_client.execute(local_var_req).await?;
553
554    let local_var_status = local_var_resp.status();
555    let local_var_content = local_var_resp.text().await?;
556
557    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
558        serde_json::from_str(&local_var_content).map_err(Error::from)
559    } else {
560        let local_var_entity: Option<IssuesSlashCreateLabelError> = serde_json::from_str(&local_var_content).ok();
561        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
562        Err(Error::ResponseError(local_var_error))
563    }
564}
565
566/// Creates a milestone.
567pub async fn issues_slash_create_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, issues_create_milestone_request: models::IssuesCreateMilestoneRequest) -> Result<models::Milestone, Error<IssuesSlashCreateMilestoneError>> {
568    let local_var_configuration = configuration;
569
570    let local_var_client = &local_var_configuration.client;
571
572    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
573    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
574
575    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
576        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
577    }
578    local_var_req_builder = local_var_req_builder.json(&issues_create_milestone_request);
579
580    let local_var_req = local_var_req_builder.build()?;
581    let local_var_resp = local_var_client.execute(local_var_req).await?;
582
583    let local_var_status = local_var_resp.status();
584    let local_var_content = local_var_resp.text().await?;
585
586    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
587        serde_json::from_str(&local_var_content).map_err(Error::from)
588    } else {
589        let local_var_entity: Option<IssuesSlashCreateMilestoneError> = serde_json::from_str(&local_var_content).ok();
590        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
591        Err(Error::ResponseError(local_var_error))
592    }
593}
594
595/// You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.
596pub async fn issues_slash_delete_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32) -> Result<(), Error<IssuesSlashDeleteCommentError>> {
597    let local_var_configuration = configuration;
598
599    let local_var_client = &local_var_configuration.client;
600
601    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
602    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
603
604    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
605        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
606    }
607
608    let local_var_req = local_var_req_builder.build()?;
609    let local_var_resp = local_var_client.execute(local_var_req).await?;
610
611    let local_var_status = local_var_resp.status();
612    let local_var_content = local_var_resp.text().await?;
613
614    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
615        Ok(())
616    } else {
617        let local_var_entity: Option<IssuesSlashDeleteCommentError> = serde_json::from_str(&local_var_content).ok();
618        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
619        Err(Error::ResponseError(local_var_error))
620    }
621}
622
623/// Deletes a label using the given label name.
624pub async fn issues_slash_delete_label(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str) -> Result<(), Error<IssuesSlashDeleteLabelError>> {
625    let local_var_configuration = configuration;
626
627    let local_var_client = &local_var_configuration.client;
628
629    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name));
630    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
631
632    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
633        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
634    }
635
636    let local_var_req = local_var_req_builder.build()?;
637    let local_var_resp = local_var_client.execute(local_var_req).await?;
638
639    let local_var_status = local_var_resp.status();
640    let local_var_content = local_var_resp.text().await?;
641
642    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
643        Ok(())
644    } else {
645        let local_var_entity: Option<IssuesSlashDeleteLabelError> = serde_json::from_str(&local_var_content).ok();
646        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
647        Err(Error::ResponseError(local_var_error))
648    }
649}
650
651/// Deletes a milestone using the given milestone number.
652pub async fn issues_slash_delete_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, milestone_number: i32) -> Result<(), Error<IssuesSlashDeleteMilestoneError>> {
653    let local_var_configuration = configuration;
654
655    let local_var_client = &local_var_configuration.client;
656
657    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{milestone_number}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), milestone_number=milestone_number);
658    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
659
660    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
661        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
662    }
663
664    let local_var_req = local_var_req_builder.build()?;
665    let local_var_resp = local_var_client.execute(local_var_req).await?;
666
667    let local_var_status = local_var_resp.status();
668    let local_var_content = local_var_resp.text().await?;
669
670    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
671        Ok(())
672    } else {
673        let local_var_entity: Option<IssuesSlashDeleteMilestoneError> = serde_json::from_str(&local_var_content).ok();
674        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
675        Err(Error::ResponseError(local_var_error))
676    }
677}
678
679/// The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook.  **Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull request id, use the \"[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)\" endpoint.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
680pub async fn issues_slash_get(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32) -> Result<models::Issue, Error<IssuesSlashGetError>> {
681    let local_var_configuration = configuration;
682
683    let local_var_client = &local_var_configuration.client;
684
685    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
686    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
687
688    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
689        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
690    }
691
692    let local_var_req = local_var_req_builder.build()?;
693    let local_var_resp = local_var_client.execute(local_var_req).await?;
694
695    let local_var_status = local_var_resp.status();
696    let local_var_content = local_var_resp.text().await?;
697
698    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
699        serde_json::from_str(&local_var_content).map_err(Error::from)
700    } else {
701        let local_var_entity: Option<IssuesSlashGetError> = serde_json::from_str(&local_var_content).ok();
702        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
703        Err(Error::ResponseError(local_var_error))
704    }
705}
706
707/// You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
708pub async fn issues_slash_get_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32) -> Result<models::IssueComment, Error<IssuesSlashGetCommentError>> {
709    let local_var_configuration = configuration;
710
711    let local_var_client = &local_var_configuration.client;
712
713    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
714    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
715
716    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
717        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
718    }
719
720    let local_var_req = local_var_req_builder.build()?;
721    let local_var_resp = local_var_client.execute(local_var_req).await?;
722
723    let local_var_status = local_var_resp.status();
724    let local_var_content = local_var_resp.text().await?;
725
726    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
727        serde_json::from_str(&local_var_content).map_err(Error::from)
728    } else {
729        let local_var_entity: Option<IssuesSlashGetCommentError> = serde_json::from_str(&local_var_content).ok();
730        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
731        Err(Error::ResponseError(local_var_error))
732    }
733}
734
735/// Gets a single event by the event id.
736pub async fn issues_slash_get_event(configuration: &configuration::Configuration, owner: &str, repo: &str, event_id: i32) -> Result<models::IssueEvent, Error<IssuesSlashGetEventError>> {
737    let local_var_configuration = configuration;
738
739    let local_var_client = &local_var_configuration.client;
740
741    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/events/{event_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), event_id=event_id);
742    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
743
744    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
745        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
746    }
747
748    let local_var_req = local_var_req_builder.build()?;
749    let local_var_resp = local_var_client.execute(local_var_req).await?;
750
751    let local_var_status = local_var_resp.status();
752    let local_var_content = local_var_resp.text().await?;
753
754    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
755        serde_json::from_str(&local_var_content).map_err(Error::from)
756    } else {
757        let local_var_entity: Option<IssuesSlashGetEventError> = serde_json::from_str(&local_var_content).ok();
758        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
759        Err(Error::ResponseError(local_var_error))
760    }
761}
762
763/// Gets a label using the given name.
764pub async fn issues_slash_get_label(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str) -> Result<models::Label, Error<IssuesSlashGetLabelError>> {
765    let local_var_configuration = configuration;
766
767    let local_var_client = &local_var_configuration.client;
768
769    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name));
770    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
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<IssuesSlashGetLabelError> = 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/// Gets a milestone using the given milestone number.
792pub async fn issues_slash_get_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, milestone_number: i32) -> Result<models::Milestone, Error<IssuesSlashGetMilestoneError>> {
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}/milestones/{milestone_number}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), milestone_number=milestone_number);
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_user_agent) = local_var_configuration.user_agent {
801        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
802    }
803
804    let local_var_req = local_var_req_builder.build()?;
805    let local_var_resp = local_var_client.execute(local_var_req).await?;
806
807    let local_var_status = local_var_resp.status();
808    let local_var_content = local_var_resp.text().await?;
809
810    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
811        serde_json::from_str(&local_var_content).map_err(Error::from)
812    } else {
813        let local_var_entity: Option<IssuesSlashGetMilestoneError> = serde_json::from_str(&local_var_content).ok();
814        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
815        Err(Error::ResponseError(local_var_error))
816    }
817}
818
819/// List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not necessarily assigned to you.  **Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull request id, use the \"[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)\" endpoint.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
820pub async fn issues_slash_list(configuration: &configuration::Configuration, filter: Option<&str>, state: Option<&str>, labels: Option<&str>, sort: Option<&str>, direction: Option<&str>, since: Option<String>, collab: Option<bool>, orgs: Option<bool>, owned: Option<bool>, pulls: Option<bool>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Issue>, Error<IssuesSlashListError>> {
821    let local_var_configuration = configuration;
822
823    let local_var_client = &local_var_configuration.client;
824
825    let local_var_uri_str = format!("{}/issues", local_var_configuration.base_path);
826    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
827
828    if let Some(ref local_var_str) = filter {
829        local_var_req_builder = local_var_req_builder.query(&[("filter", &local_var_str.to_string())]);
830    }
831    if let Some(ref local_var_str) = state {
832        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
833    }
834    if let Some(ref local_var_str) = labels {
835        local_var_req_builder = local_var_req_builder.query(&[("labels", &local_var_str.to_string())]);
836    }
837    if let Some(ref local_var_str) = sort {
838        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
839    }
840    if let Some(ref local_var_str) = direction {
841        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
842    }
843    if let Some(ref local_var_str) = since {
844        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
845    }
846    if let Some(ref local_var_str) = collab {
847        local_var_req_builder = local_var_req_builder.query(&[("collab", &local_var_str.to_string())]);
848    }
849    if let Some(ref local_var_str) = orgs {
850        local_var_req_builder = local_var_req_builder.query(&[("orgs", &local_var_str.to_string())]);
851    }
852    if let Some(ref local_var_str) = owned {
853        local_var_req_builder = local_var_req_builder.query(&[("owned", &local_var_str.to_string())]);
854    }
855    if let Some(ref local_var_str) = pulls {
856        local_var_req_builder = local_var_req_builder.query(&[("pulls", &local_var_str.to_string())]);
857    }
858    if let Some(ref local_var_str) = per_page {
859        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
860    }
861    if let Some(ref local_var_str) = page {
862        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
863    }
864    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
865        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
866    }
867
868    let local_var_req = local_var_req_builder.build()?;
869    let local_var_resp = local_var_client.execute(local_var_req).await?;
870
871    let local_var_status = local_var_resp.status();
872    let local_var_content = local_var_resp.text().await?;
873
874    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
875        serde_json::from_str(&local_var_content).map_err(Error::from)
876    } else {
877        let local_var_entity: Option<IssuesSlashListError> = serde_json::from_str(&local_var_content).ok();
878        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
879        Err(Error::ResponseError(local_var_error))
880    }
881}
882
883/// Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository.
884pub async fn issues_slash_list_assignees(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::SimpleUser>, Error<IssuesSlashListAssigneesError>> {
885    let local_var_configuration = configuration;
886
887    let local_var_client = &local_var_configuration.client;
888
889    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/assignees", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
890    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
891
892    if let Some(ref local_var_str) = per_page {
893        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
894    }
895    if let Some(ref local_var_str) = page {
896        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
897    }
898    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
899        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
900    }
901
902    let local_var_req = local_var_req_builder.build()?;
903    let local_var_resp = local_var_client.execute(local_var_req).await?;
904
905    let local_var_status = local_var_resp.status();
906    let local_var_content = local_var_resp.text().await?;
907
908    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
909        serde_json::from_str(&local_var_content).map_err(Error::from)
910    } else {
911        let local_var_entity: Option<IssuesSlashListAssigneesError> = serde_json::from_str(&local_var_content).ok();
912        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
913        Err(Error::ResponseError(local_var_error))
914    }
915}
916
917/// You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.  Issue comments are ordered by ascending ID.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
918pub async fn issues_slash_list_comments(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, since: Option<String>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::IssueComment>, Error<IssuesSlashListCommentsError>> {
919    let local_var_configuration = configuration;
920
921    let local_var_client = &local_var_configuration.client;
922
923    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
924    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
925
926    if let Some(ref local_var_str) = since {
927        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
928    }
929    if let Some(ref local_var_str) = per_page {
930        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
931    }
932    if let Some(ref local_var_str) = page {
933        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
934    }
935    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
936        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
937    }
938
939    let local_var_req = local_var_req_builder.build()?;
940    let local_var_resp = local_var_client.execute(local_var_req).await?;
941
942    let local_var_status = local_var_resp.status();
943    let local_var_content = local_var_resp.text().await?;
944
945    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
946        serde_json::from_str(&local_var_content).map_err(Error::from)
947    } else {
948        let local_var_entity: Option<IssuesSlashListCommentsError> = serde_json::from_str(&local_var_content).ok();
949        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
950        Err(Error::ResponseError(local_var_error))
951    }
952}
953
954/// You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.  By default, issue comments are ordered by ascending ID.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
955pub async fn issues_slash_list_comments_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, sort: Option<&str>, direction: Option<&str>, since: Option<String>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::IssueComment>, Error<IssuesSlashListCommentsForRepoError>> {
956    let local_var_configuration = configuration;
957
958    let local_var_client = &local_var_configuration.client;
959
960    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
961    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
962
963    if let Some(ref local_var_str) = sort {
964        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
965    }
966    if let Some(ref local_var_str) = direction {
967        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
968    }
969    if let Some(ref local_var_str) = since {
970        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
971    }
972    if let Some(ref local_var_str) = per_page {
973        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
974    }
975    if let Some(ref local_var_str) = page {
976        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
977    }
978    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
979        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
980    }
981
982    let local_var_req = local_var_req_builder.build()?;
983    let local_var_resp = local_var_client.execute(local_var_req).await?;
984
985    let local_var_status = local_var_resp.status();
986    let local_var_content = local_var_resp.text().await?;
987
988    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
989        serde_json::from_str(&local_var_content).map_err(Error::from)
990    } else {
991        let local_var_entity: Option<IssuesSlashListCommentsForRepoError> = serde_json::from_str(&local_var_content).ok();
992        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
993        Err(Error::ResponseError(local_var_error))
994    }
995}
996
997/// Lists all events for an issue.
998pub async fn issues_slash_list_events(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::IssueEventForIssue>, Error<IssuesSlashListEventsError>> {
999    let local_var_configuration = configuration;
1000
1001    let local_var_client = &local_var_configuration.client;
1002
1003    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/events", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1004    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1005
1006    if let Some(ref local_var_str) = per_page {
1007        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1008    }
1009    if let Some(ref local_var_str) = page {
1010        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1011    }
1012    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1013        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1014    }
1015
1016    let local_var_req = local_var_req_builder.build()?;
1017    let local_var_resp = local_var_client.execute(local_var_req).await?;
1018
1019    let local_var_status = local_var_resp.status();
1020    let local_var_content = local_var_resp.text().await?;
1021
1022    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1023        serde_json::from_str(&local_var_content).map_err(Error::from)
1024    } else {
1025        let local_var_entity: Option<IssuesSlashListEventsError> = serde_json::from_str(&local_var_content).ok();
1026        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1027        Err(Error::ResponseError(local_var_error))
1028    }
1029}
1030
1031/// Lists events for a repository.
1032pub async fn issues_slash_list_events_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::IssueEvent>, Error<IssuesSlashListEventsForRepoError>> {
1033    let local_var_configuration = configuration;
1034
1035    let local_var_client = &local_var_configuration.client;
1036
1037    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/events", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1038    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1039
1040    if let Some(ref local_var_str) = per_page {
1041        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1042    }
1043    if let Some(ref local_var_str) = page {
1044        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1045    }
1046    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1047        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1048    }
1049
1050    let local_var_req = local_var_req_builder.build()?;
1051    let local_var_resp = local_var_client.execute(local_var_req).await?;
1052
1053    let local_var_status = local_var_resp.status();
1054    let local_var_content = local_var_resp.text().await?;
1055
1056    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1057        serde_json::from_str(&local_var_content).map_err(Error::from)
1058    } else {
1059        let local_var_entity: Option<IssuesSlashListEventsForRepoError> = serde_json::from_str(&local_var_content).ok();
1060        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1061        Err(Error::ResponseError(local_var_error))
1062    }
1063}
1064
1065/// List all timeline events for an issue.
1066pub async fn issues_slash_list_events_for_timeline(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::TimelineIssueEvents>, Error<IssuesSlashListEventsForTimelineError>> {
1067    let local_var_configuration = configuration;
1068
1069    let local_var_client = &local_var_configuration.client;
1070
1071    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/timeline", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1072    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1073
1074    if let Some(ref local_var_str) = per_page {
1075        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1076    }
1077    if let Some(ref local_var_str) = page {
1078        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1079    }
1080    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1081        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1082    }
1083
1084    let local_var_req = local_var_req_builder.build()?;
1085    let local_var_resp = local_var_client.execute(local_var_req).await?;
1086
1087    let local_var_status = local_var_resp.status();
1088    let local_var_content = local_var_resp.text().await?;
1089
1090    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1091        serde_json::from_str(&local_var_content).map_err(Error::from)
1092    } else {
1093        let local_var_entity: Option<IssuesSlashListEventsForTimelineError> = serde_json::from_str(&local_var_content).ok();
1094        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1095        Err(Error::ResponseError(local_var_error))
1096    }
1097}
1098
1099/// List issues across owned and member repositories assigned to the authenticated user.  **Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull request id, use the \"[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)\" endpoint.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
1100pub async fn issues_slash_list_for_authenticated_user(configuration: &configuration::Configuration, filter: Option<&str>, state: Option<&str>, labels: Option<&str>, sort: Option<&str>, direction: Option<&str>, since: Option<String>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Issue>, Error<IssuesSlashListForAuthenticatedUserError>> {
1101    let local_var_configuration = configuration;
1102
1103    let local_var_client = &local_var_configuration.client;
1104
1105    let local_var_uri_str = format!("{}/user/issues", local_var_configuration.base_path);
1106    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1107
1108    if let Some(ref local_var_str) = filter {
1109        local_var_req_builder = local_var_req_builder.query(&[("filter", &local_var_str.to_string())]);
1110    }
1111    if let Some(ref local_var_str) = state {
1112        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
1113    }
1114    if let Some(ref local_var_str) = labels {
1115        local_var_req_builder = local_var_req_builder.query(&[("labels", &local_var_str.to_string())]);
1116    }
1117    if let Some(ref local_var_str) = sort {
1118        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
1119    }
1120    if let Some(ref local_var_str) = direction {
1121        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
1122    }
1123    if let Some(ref local_var_str) = since {
1124        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
1125    }
1126    if let Some(ref local_var_str) = per_page {
1127        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1128    }
1129    if let Some(ref local_var_str) = page {
1130        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1131    }
1132    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1133        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1134    }
1135
1136    let local_var_req = local_var_req_builder.build()?;
1137    let local_var_resp = local_var_client.execute(local_var_req).await?;
1138
1139    let local_var_status = local_var_resp.status();
1140    let local_var_content = local_var_resp.text().await?;
1141
1142    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1143        serde_json::from_str(&local_var_content).map_err(Error::from)
1144    } else {
1145        let local_var_entity: Option<IssuesSlashListForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
1146        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1147        Err(Error::ResponseError(local_var_error))
1148    }
1149}
1150
1151/// List issues in an organization assigned to the authenticated user.  **Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull request id, use the \"[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)\" endpoint.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
1152pub async fn issues_slash_list_for_org(configuration: &configuration::Configuration, org: &str, filter: Option<&str>, state: Option<&str>, labels: Option<&str>, sort: Option<&str>, direction: Option<&str>, since: Option<String>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Issue>, Error<IssuesSlashListForOrgError>> {
1153    let local_var_configuration = configuration;
1154
1155    let local_var_client = &local_var_configuration.client;
1156
1157    let local_var_uri_str = format!("{}/orgs/{org}/issues", local_var_configuration.base_path, org=crate::apis::urlencode(org));
1158    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1159
1160    if let Some(ref local_var_str) = filter {
1161        local_var_req_builder = local_var_req_builder.query(&[("filter", &local_var_str.to_string())]);
1162    }
1163    if let Some(ref local_var_str) = state {
1164        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
1165    }
1166    if let Some(ref local_var_str) = labels {
1167        local_var_req_builder = local_var_req_builder.query(&[("labels", &local_var_str.to_string())]);
1168    }
1169    if let Some(ref local_var_str) = sort {
1170        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
1171    }
1172    if let Some(ref local_var_str) = direction {
1173        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
1174    }
1175    if let Some(ref local_var_str) = since {
1176        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
1177    }
1178    if let Some(ref local_var_str) = per_page {
1179        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1180    }
1181    if let Some(ref local_var_str) = page {
1182        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1183    }
1184    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1185        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1186    }
1187
1188    let local_var_req = local_var_req_builder.build()?;
1189    let local_var_resp = local_var_client.execute(local_var_req).await?;
1190
1191    let local_var_status = local_var_resp.status();
1192    let local_var_content = local_var_resp.text().await?;
1193
1194    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1195        serde_json::from_str(&local_var_content).map_err(Error::from)
1196    } else {
1197        let local_var_entity: Option<IssuesSlashListForOrgError> = serde_json::from_str(&local_var_content).ok();
1198        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1199        Err(Error::ResponseError(local_var_error))
1200    }
1201}
1202
1203/// List issues in a repository. Only open issues will be listed.  **Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull request id, use the \"[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)\" endpoint.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
1204pub async fn issues_slash_list_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, milestone: Option<&str>, state: Option<&str>, assignee: Option<&str>, creator: Option<&str>, mentioned: Option<&str>, labels: Option<&str>, sort: Option<&str>, direction: Option<&str>, since: Option<String>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Issue>, Error<IssuesSlashListForRepoError>> {
1205    let local_var_configuration = configuration;
1206
1207    let local_var_client = &local_var_configuration.client;
1208
1209    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1210    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1211
1212    if let Some(ref local_var_str) = milestone {
1213        local_var_req_builder = local_var_req_builder.query(&[("milestone", &local_var_str.to_string())]);
1214    }
1215    if let Some(ref local_var_str) = state {
1216        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
1217    }
1218    if let Some(ref local_var_str) = assignee {
1219        local_var_req_builder = local_var_req_builder.query(&[("assignee", &local_var_str.to_string())]);
1220    }
1221    if let Some(ref local_var_str) = creator {
1222        local_var_req_builder = local_var_req_builder.query(&[("creator", &local_var_str.to_string())]);
1223    }
1224    if let Some(ref local_var_str) = mentioned {
1225        local_var_req_builder = local_var_req_builder.query(&[("mentioned", &local_var_str.to_string())]);
1226    }
1227    if let Some(ref local_var_str) = labels {
1228        local_var_req_builder = local_var_req_builder.query(&[("labels", &local_var_str.to_string())]);
1229    }
1230    if let Some(ref local_var_str) = sort {
1231        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
1232    }
1233    if let Some(ref local_var_str) = direction {
1234        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
1235    }
1236    if let Some(ref local_var_str) = since {
1237        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
1238    }
1239    if let Some(ref local_var_str) = per_page {
1240        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1241    }
1242    if let Some(ref local_var_str) = page {
1243        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1244    }
1245    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1246        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1247    }
1248
1249    let local_var_req = local_var_req_builder.build()?;
1250    let local_var_resp = local_var_client.execute(local_var_req).await?;
1251
1252    let local_var_status = local_var_resp.status();
1253    let local_var_content = local_var_resp.text().await?;
1254
1255    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1256        serde_json::from_str(&local_var_content).map_err(Error::from)
1257    } else {
1258        let local_var_entity: Option<IssuesSlashListForRepoError> = serde_json::from_str(&local_var_content).ok();
1259        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1260        Err(Error::ResponseError(local_var_error))
1261    }
1262}
1263
1264/// Lists labels for issues in a milestone.
1265pub async fn issues_slash_list_labels_for_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, milestone_number: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Label>, Error<IssuesSlashListLabelsForMilestoneError>> {
1266    let local_var_configuration = configuration;
1267
1268    let local_var_client = &local_var_configuration.client;
1269
1270    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{milestone_number}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), milestone_number=milestone_number);
1271    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1272
1273    if let Some(ref local_var_str) = per_page {
1274        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1275    }
1276    if let Some(ref local_var_str) = page {
1277        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1278    }
1279    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1280        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1281    }
1282
1283    let local_var_req = local_var_req_builder.build()?;
1284    let local_var_resp = local_var_client.execute(local_var_req).await?;
1285
1286    let local_var_status = local_var_resp.status();
1287    let local_var_content = local_var_resp.text().await?;
1288
1289    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1290        serde_json::from_str(&local_var_content).map_err(Error::from)
1291    } else {
1292        let local_var_entity: Option<IssuesSlashListLabelsForMilestoneError> = serde_json::from_str(&local_var_content).ok();
1293        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1294        Err(Error::ResponseError(local_var_error))
1295    }
1296}
1297
1298/// Lists all labels for a repository.
1299pub async fn issues_slash_list_labels_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Label>, Error<IssuesSlashListLabelsForRepoError>> {
1300    let local_var_configuration = configuration;
1301
1302    let local_var_client = &local_var_configuration.client;
1303
1304    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1305    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1306
1307    if let Some(ref local_var_str) = per_page {
1308        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1309    }
1310    if let Some(ref local_var_str) = page {
1311        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1312    }
1313    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1314        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1315    }
1316
1317    let local_var_req = local_var_req_builder.build()?;
1318    let local_var_resp = local_var_client.execute(local_var_req).await?;
1319
1320    let local_var_status = local_var_resp.status();
1321    let local_var_content = local_var_resp.text().await?;
1322
1323    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1324        serde_json::from_str(&local_var_content).map_err(Error::from)
1325    } else {
1326        let local_var_entity: Option<IssuesSlashListLabelsForRepoError> = serde_json::from_str(&local_var_content).ok();
1327        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1328        Err(Error::ResponseError(local_var_error))
1329    }
1330}
1331
1332/// Lists all labels for an issue.
1333pub async fn issues_slash_list_labels_on_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Label>, Error<IssuesSlashListLabelsOnIssueError>> {
1334    let local_var_configuration = configuration;
1335
1336    let local_var_client = &local_var_configuration.client;
1337
1338    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1339    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1340
1341    if let Some(ref local_var_str) = per_page {
1342        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1343    }
1344    if let Some(ref local_var_str) = page {
1345        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1346    }
1347    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1348        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1349    }
1350
1351    let local_var_req = local_var_req_builder.build()?;
1352    let local_var_resp = local_var_client.execute(local_var_req).await?;
1353
1354    let local_var_status = local_var_resp.status();
1355    let local_var_content = local_var_resp.text().await?;
1356
1357    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1358        serde_json::from_str(&local_var_content).map_err(Error::from)
1359    } else {
1360        let local_var_entity: Option<IssuesSlashListLabelsOnIssueError> = serde_json::from_str(&local_var_content).ok();
1361        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1362        Err(Error::ResponseError(local_var_error))
1363    }
1364}
1365
1366/// Lists milestones for a repository.
1367pub async fn issues_slash_list_milestones(configuration: &configuration::Configuration, owner: &str, repo: &str, state: Option<&str>, sort: Option<&str>, direction: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Milestone>, Error<IssuesSlashListMilestonesError>> {
1368    let local_var_configuration = configuration;
1369
1370    let local_var_client = &local_var_configuration.client;
1371
1372    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1373    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1374
1375    if let Some(ref local_var_str) = state {
1376        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
1377    }
1378    if let Some(ref local_var_str) = sort {
1379        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
1380    }
1381    if let Some(ref local_var_str) = direction {
1382        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
1383    }
1384    if let Some(ref local_var_str) = per_page {
1385        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1386    }
1387    if let Some(ref local_var_str) = page {
1388        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1389    }
1390    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1391        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1392    }
1393
1394    let local_var_req = local_var_req_builder.build()?;
1395    let local_var_resp = local_var_client.execute(local_var_req).await?;
1396
1397    let local_var_status = local_var_resp.status();
1398    let local_var_content = local_var_resp.text().await?;
1399
1400    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1401        serde_json::from_str(&local_var_content).map_err(Error::from)
1402    } else {
1403        let local_var_entity: Option<IssuesSlashListMilestonesError> = serde_json::from_str(&local_var_content).ok();
1404        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1405        Err(Error::ResponseError(local_var_error))
1406    }
1407}
1408
1409/// Users with push access can lock an issue or pull request's conversation.  Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).\"
1410pub async fn issues_slash_lock(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, issues_lock_request: Option<models::IssuesLockRequest>) -> Result<(), Error<IssuesSlashLockError>> {
1411    let local_var_configuration = configuration;
1412
1413    let local_var_client = &local_var_configuration.client;
1414
1415    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/lock", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1416    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1417
1418    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1419        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1420    }
1421    local_var_req_builder = local_var_req_builder.json(&issues_lock_request);
1422
1423    let local_var_req = local_var_req_builder.build()?;
1424    let local_var_resp = local_var_client.execute(local_var_req).await?;
1425
1426    let local_var_status = local_var_resp.status();
1427    let local_var_content = local_var_resp.text().await?;
1428
1429    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1430        Ok(())
1431    } else {
1432        let local_var_entity: Option<IssuesSlashLockError> = serde_json::from_str(&local_var_content).ok();
1433        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1434        Err(Error::ResponseError(local_var_error))
1435    }
1436}
1437
1438/// Removes all labels from an issue.
1439pub async fn issues_slash_remove_all_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32) -> Result<(), Error<IssuesSlashRemoveAllLabelsError>> {
1440    let local_var_configuration = configuration;
1441
1442    let local_var_client = &local_var_configuration.client;
1443
1444    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1445    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1446
1447    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1448        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1449    }
1450
1451    let local_var_req = local_var_req_builder.build()?;
1452    let local_var_resp = local_var_client.execute(local_var_req).await?;
1453
1454    let local_var_status = local_var_resp.status();
1455    let local_var_content = local_var_resp.text().await?;
1456
1457    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1458        Ok(())
1459    } else {
1460        let local_var_entity: Option<IssuesSlashRemoveAllLabelsError> = serde_json::from_str(&local_var_content).ok();
1461        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1462        Err(Error::ResponseError(local_var_error))
1463    }
1464}
1465
1466/// Removes one or more assignees from an issue.
1467pub async fn issues_slash_remove_assignees(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, issues_remove_assignees_request: models::IssuesRemoveAssigneesRequest) -> Result<models::Issue, Error<IssuesSlashRemoveAssigneesError>> {
1468    let local_var_configuration = configuration;
1469
1470    let local_var_client = &local_var_configuration.client;
1471
1472    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/assignees", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1473    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1474
1475    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1476        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1477    }
1478    local_var_req_builder = local_var_req_builder.json(&issues_remove_assignees_request);
1479
1480    let local_var_req = local_var_req_builder.build()?;
1481    let local_var_resp = local_var_client.execute(local_var_req).await?;
1482
1483    let local_var_status = local_var_resp.status();
1484    let local_var_content = local_var_resp.text().await?;
1485
1486    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1487        serde_json::from_str(&local_var_content).map_err(Error::from)
1488    } else {
1489        let local_var_entity: Option<IssuesSlashRemoveAssigneesError> = serde_json::from_str(&local_var_content).ok();
1490        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1491        Err(Error::ResponseError(local_var_error))
1492    }
1493}
1494
1495/// Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist.
1496pub async fn issues_slash_remove_label(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, name: &str) -> Result<Vec<models::Label>, Error<IssuesSlashRemoveLabelError>> {
1497    let local_var_configuration = configuration;
1498
1499    let local_var_client = &local_var_configuration.client;
1500
1501    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number, name=crate::apis::urlencode(name));
1502    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1503
1504    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1505        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1506    }
1507
1508    let local_var_req = local_var_req_builder.build()?;
1509    let local_var_resp = local_var_client.execute(local_var_req).await?;
1510
1511    let local_var_status = local_var_resp.status();
1512    let local_var_content = local_var_resp.text().await?;
1513
1514    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1515        serde_json::from_str(&local_var_content).map_err(Error::from)
1516    } else {
1517        let local_var_entity: Option<IssuesSlashRemoveLabelError> = serde_json::from_str(&local_var_content).ok();
1518        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1519        Err(Error::ResponseError(local_var_error))
1520    }
1521}
1522
1523/// Removes any previous labels and sets the new labels for an issue.
1524pub async fn issues_slash_set_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, issues_set_labels_request: Option<models::IssuesSetLabelsRequest>) -> Result<Vec<models::Label>, Error<IssuesSlashSetLabelsError>> {
1525    let local_var_configuration = configuration;
1526
1527    let local_var_client = &local_var_configuration.client;
1528
1529    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1530    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1531
1532    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1533        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1534    }
1535    local_var_req_builder = local_var_req_builder.json(&issues_set_labels_request);
1536
1537    let local_var_req = local_var_req_builder.build()?;
1538    let local_var_resp = local_var_client.execute(local_var_req).await?;
1539
1540    let local_var_status = local_var_resp.status();
1541    let local_var_content = local_var_resp.text().await?;
1542
1543    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1544        serde_json::from_str(&local_var_content).map_err(Error::from)
1545    } else {
1546        let local_var_entity: Option<IssuesSlashSetLabelsError> = serde_json::from_str(&local_var_content).ok();
1547        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1548        Err(Error::ResponseError(local_var_error))
1549    }
1550}
1551
1552/// Users with push access can unlock an issue's conversation.
1553pub async fn issues_slash_unlock(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32) -> Result<(), Error<IssuesSlashUnlockError>> {
1554    let local_var_configuration = configuration;
1555
1556    let local_var_client = &local_var_configuration.client;
1557
1558    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}/lock", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1559    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1560
1561    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1562        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1563    }
1564
1565    let local_var_req = local_var_req_builder.build()?;
1566    let local_var_resp = local_var_client.execute(local_var_req).await?;
1567
1568    let local_var_status = local_var_resp.status();
1569    let local_var_content = local_var_resp.text().await?;
1570
1571    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1572        Ok(())
1573    } else {
1574        let local_var_entity: Option<IssuesSlashUnlockError> = serde_json::from_str(&local_var_content).ok();
1575        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1576        Err(Error::ResponseError(local_var_error))
1577    }
1578}
1579
1580/// Issue owners and users with push access can edit an issue.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
1581pub async fn issues_slash_update(configuration: &configuration::Configuration, owner: &str, repo: &str, issue_number: i32, issues_update_request: Option<models::IssuesUpdateRequest>) -> Result<models::Issue, Error<IssuesSlashUpdateError>> {
1582    let local_var_configuration = configuration;
1583
1584    let local_var_client = &local_var_configuration.client;
1585
1586    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{issue_number}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), issue_number=issue_number);
1587    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1588
1589    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1590        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1591    }
1592    local_var_req_builder = local_var_req_builder.json(&issues_update_request);
1593
1594    let local_var_req = local_var_req_builder.build()?;
1595    let local_var_resp = local_var_client.execute(local_var_req).await?;
1596
1597    let local_var_status = local_var_resp.status();
1598    let local_var_content = local_var_resp.text().await?;
1599
1600    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1601        serde_json::from_str(&local_var_content).map_err(Error::from)
1602    } else {
1603        let local_var_entity: Option<IssuesSlashUpdateError> = serde_json::from_str(&local_var_content).ok();
1604        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1605        Err(Error::ResponseError(local_var_error))
1606    }
1607}
1608
1609/// You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type. - **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
1610pub async fn issues_slash_update_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, issues_update_comment_request: models::IssuesUpdateCommentRequest) -> Result<models::IssueComment, Error<IssuesSlashUpdateCommentError>> {
1611    let local_var_configuration = configuration;
1612
1613    let local_var_client = &local_var_configuration.client;
1614
1615    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
1616    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1617
1618    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1619        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1620    }
1621    local_var_req_builder = local_var_req_builder.json(&issues_update_comment_request);
1622
1623    let local_var_req = local_var_req_builder.build()?;
1624    let local_var_resp = local_var_client.execute(local_var_req).await?;
1625
1626    let local_var_status = local_var_resp.status();
1627    let local_var_content = local_var_resp.text().await?;
1628
1629    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1630        serde_json::from_str(&local_var_content).map_err(Error::from)
1631    } else {
1632        let local_var_entity: Option<IssuesSlashUpdateCommentError> = serde_json::from_str(&local_var_content).ok();
1633        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1634        Err(Error::ResponseError(local_var_error))
1635    }
1636}
1637
1638/// Updates a label using the given label name.
1639pub async fn issues_slash_update_label(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str, issues_update_label_request: Option<models::IssuesUpdateLabelRequest>) -> Result<models::Label, Error<IssuesSlashUpdateLabelError>> {
1640    let local_var_configuration = configuration;
1641
1642    let local_var_client = &local_var_configuration.client;
1643
1644    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name));
1645    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1646
1647    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1648        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1649    }
1650    local_var_req_builder = local_var_req_builder.json(&issues_update_label_request);
1651
1652    let local_var_req = local_var_req_builder.build()?;
1653    let local_var_resp = local_var_client.execute(local_var_req).await?;
1654
1655    let local_var_status = local_var_resp.status();
1656    let local_var_content = local_var_resp.text().await?;
1657
1658    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1659        serde_json::from_str(&local_var_content).map_err(Error::from)
1660    } else {
1661        let local_var_entity: Option<IssuesSlashUpdateLabelError> = serde_json::from_str(&local_var_content).ok();
1662        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1663        Err(Error::ResponseError(local_var_error))
1664    }
1665}
1666
1667/// 
1668pub async fn issues_slash_update_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, milestone_number: i32, issues_update_milestone_request: Option<models::IssuesUpdateMilestoneRequest>) -> Result<models::Milestone, Error<IssuesSlashUpdateMilestoneError>> {
1669    let local_var_configuration = configuration;
1670
1671    let local_var_client = &local_var_configuration.client;
1672
1673    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{milestone_number}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), milestone_number=milestone_number);
1674    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1675
1676    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1677        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1678    }
1679    local_var_req_builder = local_var_req_builder.json(&issues_update_milestone_request);
1680
1681    let local_var_req = local_var_req_builder.build()?;
1682    let local_var_resp = local_var_client.execute(local_var_req).await?;
1683
1684    let local_var_status = local_var_resp.status();
1685    let local_var_content = local_var_resp.text().await?;
1686
1687    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1688        serde_json::from_str(&local_var_content).map_err(Error::from)
1689    } else {
1690        let local_var_entity: Option<IssuesSlashUpdateMilestoneError> = serde_json::from_str(&local_var_content).ok();
1691        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1692        Err(Error::ResponseError(local_var_error))
1693    }
1694}
1695