openapi_github/apis/
pulls_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 [`pulls_slash_check_if_merged`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum PullsSlashCheckIfMergedError {
22    Status404(),
23    UnknownValue(serde_json::Value),
24}
25
26/// struct for typed errors of method [`pulls_slash_create`]
27#[derive(Debug, Clone, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum PullsSlashCreateError {
30    Status403(models::BasicError),
31    Status422(models::ValidationError),
32    UnknownValue(serde_json::Value),
33}
34
35/// struct for typed errors of method [`pulls_slash_create_reply_for_review_comment`]
36#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(untagged)]
38pub enum PullsSlashCreateReplyForReviewCommentError {
39    Status404(models::BasicError),
40    UnknownValue(serde_json::Value),
41}
42
43/// struct for typed errors of method [`pulls_slash_create_review`]
44#[derive(Debug, Clone, Serialize, Deserialize)]
45#[serde(untagged)]
46pub enum PullsSlashCreateReviewError {
47    Status403(models::BasicError),
48    Status422(models::ValidationErrorSimple),
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`pulls_slash_create_review_comment`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum PullsSlashCreateReviewCommentError {
56    Status403(models::BasicError),
57    Status422(models::ValidationError),
58    UnknownValue(serde_json::Value),
59}
60
61/// struct for typed errors of method [`pulls_slash_delete_pending_review`]
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum PullsSlashDeletePendingReviewError {
65    Status404(models::BasicError),
66    Status422(models::ValidationErrorSimple),
67    UnknownValue(serde_json::Value),
68}
69
70/// struct for typed errors of method [`pulls_slash_delete_review_comment`]
71#[derive(Debug, Clone, Serialize, Deserialize)]
72#[serde(untagged)]
73pub enum PullsSlashDeleteReviewCommentError {
74    Status404(models::BasicError),
75    UnknownValue(serde_json::Value),
76}
77
78/// struct for typed errors of method [`pulls_slash_dismiss_review`]
79#[derive(Debug, Clone, Serialize, Deserialize)]
80#[serde(untagged)]
81pub enum PullsSlashDismissReviewError {
82    Status404(models::BasicError),
83    Status422(models::ValidationErrorSimple),
84    UnknownValue(serde_json::Value),
85}
86
87/// struct for typed errors of method [`pulls_slash_get`]
88#[derive(Debug, Clone, Serialize, Deserialize)]
89#[serde(untagged)]
90pub enum PullsSlashGetError {
91    Status404(models::BasicError),
92    Status406(models::BasicError),
93    Status500(models::BasicError),
94    Status503(models::SecretScanningListAlertsForEnterprise503Response),
95    UnknownValue(serde_json::Value),
96}
97
98/// struct for typed errors of method [`pulls_slash_get_review`]
99#[derive(Debug, Clone, Serialize, Deserialize)]
100#[serde(untagged)]
101pub enum PullsSlashGetReviewError {
102    Status404(models::BasicError),
103    UnknownValue(serde_json::Value),
104}
105
106/// struct for typed errors of method [`pulls_slash_get_review_comment`]
107#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum PullsSlashGetReviewCommentError {
110    Status404(models::BasicError),
111    UnknownValue(serde_json::Value),
112}
113
114/// struct for typed errors of method [`pulls_slash_list`]
115#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum PullsSlashListError {
118    Status422(models::ValidationError),
119    UnknownValue(serde_json::Value),
120}
121
122/// struct for typed errors of method [`pulls_slash_list_comments_for_review`]
123#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum PullsSlashListCommentsForReviewError {
126    Status404(models::BasicError),
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`pulls_slash_list_commits`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PullsSlashListCommitsError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`pulls_slash_list_files`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum PullsSlashListFilesError {
141    Status422(models::ValidationError),
142    Status500(models::BasicError),
143    Status503(models::SecretScanningListAlertsForEnterprise503Response),
144    UnknownValue(serde_json::Value),
145}
146
147/// struct for typed errors of method [`pulls_slash_list_requested_reviewers`]
148#[derive(Debug, Clone, Serialize, Deserialize)]
149#[serde(untagged)]
150pub enum PullsSlashListRequestedReviewersError {
151    UnknownValue(serde_json::Value),
152}
153
154/// struct for typed errors of method [`pulls_slash_list_review_comments`]
155#[derive(Debug, Clone, Serialize, Deserialize)]
156#[serde(untagged)]
157pub enum PullsSlashListReviewCommentsError {
158    UnknownValue(serde_json::Value),
159}
160
161/// struct for typed errors of method [`pulls_slash_list_review_comments_for_repo`]
162#[derive(Debug, Clone, Serialize, Deserialize)]
163#[serde(untagged)]
164pub enum PullsSlashListReviewCommentsForRepoError {
165    UnknownValue(serde_json::Value),
166}
167
168/// struct for typed errors of method [`pulls_slash_list_reviews`]
169#[derive(Debug, Clone, Serialize, Deserialize)]
170#[serde(untagged)]
171pub enum PullsSlashListReviewsError {
172    UnknownValue(serde_json::Value),
173}
174
175/// struct for typed errors of method [`pulls_slash_merge`]
176#[derive(Debug, Clone, Serialize, Deserialize)]
177#[serde(untagged)]
178pub enum PullsSlashMergeError {
179    Status403(models::BasicError),
180    Status404(models::BasicError),
181    Status405(models::OrgsRemoveOutsideCollaborator422Response),
182    Status409(models::OrgsRemoveOutsideCollaborator422Response),
183    Status422(models::ValidationError),
184    UnknownValue(serde_json::Value),
185}
186
187/// struct for typed errors of method [`pulls_slash_remove_requested_reviewers`]
188#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum PullsSlashRemoveRequestedReviewersError {
191    Status422(models::ValidationError),
192    UnknownValue(serde_json::Value),
193}
194
195/// struct for typed errors of method [`pulls_slash_request_reviewers`]
196#[derive(Debug, Clone, Serialize, Deserialize)]
197#[serde(untagged)]
198pub enum PullsSlashRequestReviewersError {
199    Status403(models::BasicError),
200    Status422(),
201    UnknownValue(serde_json::Value),
202}
203
204/// struct for typed errors of method [`pulls_slash_submit_review`]
205#[derive(Debug, Clone, Serialize, Deserialize)]
206#[serde(untagged)]
207pub enum PullsSlashSubmitReviewError {
208    Status403(models::BasicError),
209    Status404(models::BasicError),
210    Status422(models::ValidationErrorSimple),
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`pulls_slash_update`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum PullsSlashUpdateError {
218    Status403(models::BasicError),
219    Status422(models::ValidationError),
220    UnknownValue(serde_json::Value),
221}
222
223/// struct for typed errors of method [`pulls_slash_update_branch`]
224#[derive(Debug, Clone, Serialize, Deserialize)]
225#[serde(untagged)]
226pub enum PullsSlashUpdateBranchError {
227    Status403(models::BasicError),
228    Status422(models::ValidationError),
229    UnknownValue(serde_json::Value),
230}
231
232/// struct for typed errors of method [`pulls_slash_update_review`]
233#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum PullsSlashUpdateReviewError {
236    Status422(models::ValidationErrorSimple),
237    UnknownValue(serde_json::Value),
238}
239
240/// struct for typed errors of method [`pulls_slash_update_review_comment`]
241#[derive(Debug, Clone, Serialize, Deserialize)]
242#[serde(untagged)]
243pub enum PullsSlashUpdateReviewCommentError {
244    UnknownValue(serde_json::Value),
245}
246
247
248/// Checks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty.
249pub async fn pulls_slash_check_if_merged(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32) -> Result<(), Error<PullsSlashCheckIfMergedError>> {
250    let local_var_configuration = configuration;
251
252    let local_var_client = &local_var_configuration.client;
253
254    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/merge", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
255    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
256
257    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
258        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
259    }
260
261    let local_var_req = local_var_req_builder.build()?;
262    let local_var_resp = local_var_client.execute(local_var_req).await?;
263
264    let local_var_status = local_var_resp.status();
265    let local_var_content = local_var_resp.text().await?;
266
267    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
268        Ok(())
269    } else {
270        let local_var_entity: Option<PullsSlashCheckIfMergedError> = serde_json::from_str(&local_var_content).ok();
271        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
272        Err(Error::ResponseError(local_var_error))
273    }
274}
275
276/// Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update 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`.
277pub async fn pulls_slash_create(configuration: &configuration::Configuration, owner: &str, repo: &str, pulls_create_request: models::PullsCreateRequest) -> Result<models::PullRequest, Error<PullsSlashCreateError>> {
278    let local_var_configuration = configuration;
279
280    let local_var_client = &local_var_configuration.client;
281
282    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
283    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
284
285    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
286        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
287    }
288    local_var_req_builder = local_var_req_builder.json(&pulls_create_request);
289
290    let local_var_req = local_var_req_builder.build()?;
291    let local_var_resp = local_var_client.execute(local_var_req).await?;
292
293    let local_var_status = local_var_resp.status();
294    let local_var_content = local_var_resp.text().await?;
295
296    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
297        serde_json::from_str(&local_var_content).map_err(Error::from)
298    } else {
299        let local_var_entity: Option<PullsSlashCreateError> = serde_json::from_str(&local_var_content).ok();
300        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
301        Err(Error::ResponseError(local_var_error))
302    }
303}
304
305/// Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
306pub async fn pulls_slash_create_reply_for_review_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, comment_id: i32, pulls_create_reply_for_review_comment_request: models::PullsCreateReplyForReviewCommentRequest) -> Result<models::PullRequestReviewComment, Error<PullsSlashCreateReplyForReviewCommentError>> {
307    let local_var_configuration = configuration;
308
309    let local_var_client = &local_var_configuration.client;
310
311    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number, comment_id=comment_id);
312    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
313
314    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
315        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
316    }
317    local_var_req_builder = local_var_req_builder.json(&pulls_create_reply_for_review_comment_request);
318
319    let local_var_req = local_var_req_builder.build()?;
320    let local_var_resp = local_var_client.execute(local_var_req).await?;
321
322    let local_var_status = local_var_resp.status();
323    let local_var_content = local_var_resp.text().await?;
324
325    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
326        serde_json::from_str(&local_var_content).map_err(Error::from)
327    } else {
328        let local_var_entity: Option<PullsSlashCreateReplyForReviewCommentError> = serde_json::from_str(&local_var_content).ok();
329        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
330        Err(Error::ResponseError(local_var_error))
331    }
332}
333
334/// Creates a review on a specified 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).\"  Pull request reviews created in the `PENDING` state are not submitted and therefore do not include the `submitted_at` property in the response. To create a pending review for a pull request, leave the `event` parameter blank. For more information about submitting a `PENDING` review, see \"[Submit a review for a pull request](https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request).\"  **Note:** To comment on a specific line in a file, you need to first determine the position of that line in the diff. To see a pull request diff, add the `application/vnd.github.v3.diff` media type to the `Accept` header of a call to the [Get a pull request](https://docs.github.com/rest/pulls/pulls#get-a-pull-request) endpoint.  The `position` value equals the number of lines down from the first \"@@\" hunk header in the file you want to add a comment. The line just below the \"@@\" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
335pub async fn pulls_slash_create_review(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, pulls_create_review_request: Option<models::PullsCreateReviewRequest>) -> Result<models::PullRequestReview, Error<PullsSlashCreateReviewError>> {
336    let local_var_configuration = configuration;
337
338    let local_var_client = &local_var_configuration.client;
339
340    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/reviews", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
341    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
342
343    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
344        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
345    }
346    local_var_req_builder = local_var_req_builder.json(&pulls_create_review_request);
347
348    let local_var_req = local_var_req_builder.build()?;
349    let local_var_resp = local_var_client.execute(local_var_req).await?;
350
351    let local_var_status = local_var_resp.status();
352    let local_var_content = local_var_resp.text().await?;
353
354    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
355        serde_json::from_str(&local_var_content).map_err(Error::from)
356    } else {
357        let local_var_entity: Option<PullsSlashCreateReviewError> = serde_json::from_str(&local_var_content).ok();
358        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
359        Err(Error::ResponseError(local_var_error))
360    }
361}
362
363/// Creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see \"[Create an issue comment](https://docs.github.com/rest/issues/comments#create-an-issue-comment).\"  If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request.  The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
364pub async fn pulls_slash_create_review_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, pulls_create_review_comment_request: models::PullsCreateReviewCommentRequest) -> Result<models::PullRequestReviewComment, Error<PullsSlashCreateReviewCommentError>> {
365    let local_var_configuration = configuration;
366
367    let local_var_client = &local_var_configuration.client;
368
369    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
370    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
371
372    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
373        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
374    }
375    local_var_req_builder = local_var_req_builder.json(&pulls_create_review_comment_request);
376
377    let local_var_req = local_var_req_builder.build()?;
378    let local_var_resp = local_var_client.execute(local_var_req).await?;
379
380    let local_var_status = local_var_resp.status();
381    let local_var_content = local_var_resp.text().await?;
382
383    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
384        serde_json::from_str(&local_var_content).map_err(Error::from)
385    } else {
386        let local_var_entity: Option<PullsSlashCreateReviewCommentError> = serde_json::from_str(&local_var_content).ok();
387        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
388        Err(Error::ResponseError(local_var_error))
389    }
390}
391
392/// Deletes a pull request review that has not been submitted. Submitted reviews cannot be deleted.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
393pub async fn pulls_slash_delete_pending_review(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, review_id: i32) -> Result<models::PullRequestReview, Error<PullsSlashDeletePendingReviewError>> {
394    let local_var_configuration = configuration;
395
396    let local_var_client = &local_var_configuration.client;
397
398    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number, review_id=review_id);
399    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
400
401    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
402        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
403    }
404
405    let local_var_req = local_var_req_builder.build()?;
406    let local_var_resp = local_var_client.execute(local_var_req).await?;
407
408    let local_var_status = local_var_resp.status();
409    let local_var_content = local_var_resp.text().await?;
410
411    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
412        serde_json::from_str(&local_var_content).map_err(Error::from)
413    } else {
414        let local_var_entity: Option<PullsSlashDeletePendingReviewError> = serde_json::from_str(&local_var_content).ok();
415        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
416        Err(Error::ResponseError(local_var_error))
417    }
418}
419
420/// Deletes a review comment.
421pub async fn pulls_slash_delete_review_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32) -> Result<(), Error<PullsSlashDeleteReviewCommentError>> {
422    let local_var_configuration = configuration;
423
424    let local_var_client = &local_var_configuration.client;
425
426    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
427    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
428
429    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
430        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
431    }
432
433    let local_var_req = local_var_req_builder.build()?;
434    let local_var_resp = local_var_client.execute(local_var_req).await?;
435
436    let local_var_status = local_var_resp.status();
437    let local_var_content = local_var_resp.text().await?;
438
439    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
440        Ok(())
441    } else {
442        let local_var_entity: Option<PullsSlashDeleteReviewCommentError> = serde_json::from_str(&local_var_content).ok();
443        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
444        Err(Error::ResponseError(local_var_error))
445    }
446}
447
448/// Dismisses a specified review on a pull request.  **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/branches/branch-protection), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
449pub async fn pulls_slash_dismiss_review(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, review_id: i32, pulls_dismiss_review_request: models::PullsDismissReviewRequest) -> Result<models::PullRequestReview, Error<PullsSlashDismissReviewError>> {
450    let local_var_configuration = configuration;
451
452    let local_var_client = &local_var_configuration.client;
453
454    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number, review_id=review_id);
455    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
456
457    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
458        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
459    }
460    local_var_req_builder = local_var_req_builder.json(&pulls_dismiss_review_request);
461
462    let local_var_req = local_var_req_builder.build()?;
463    let local_var_resp = local_var_client.execute(local_var_req).await?;
464
465    let local_var_status = local_var_resp.status();
466    let local_var_content = local_var_resp.text().await?;
467
468    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
469        serde_json::from_str(&local_var_content).map_err(Error::from)
470    } else {
471        let local_var_entity: Option<PullsSlashDismissReviewError> = serde_json::from_str(&local_var_content).ok();
472        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
473        Err(Error::ResponseError(local_var_error))
474    }
475}
476
477/// Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  Lists details of a pull request by providing its number.  When you get, [create](https://docs.github.com/rest/pulls/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/pulls/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see \"[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)\".  The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit.  The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:  *   If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit. *   If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch. *   If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.  Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.  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`. - **`application/vnd.github.diff`**: For more information, see \"[git-diff](https://git-scm.com/docs/git-diff)\" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message.
478pub async fn pulls_slash_get(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32) -> Result<models::PullRequest, Error<PullsSlashGetError>> {
479    let local_var_configuration = configuration;
480
481    let local_var_client = &local_var_configuration.client;
482
483    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
484    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
485
486    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
487        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
488    }
489
490    let local_var_req = local_var_req_builder.build()?;
491    let local_var_resp = local_var_client.execute(local_var_req).await?;
492
493    let local_var_status = local_var_resp.status();
494    let local_var_content = local_var_resp.text().await?;
495
496    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
497        serde_json::from_str(&local_var_content).map_err(Error::from)
498    } else {
499        let local_var_entity: Option<PullsSlashGetError> = serde_json::from_str(&local_var_content).ok();
500        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
501        Err(Error::ResponseError(local_var_error))
502    }
503}
504
505/// Retrieves a pull request review by its 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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
506pub async fn pulls_slash_get_review(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, review_id: i32) -> Result<models::PullRequestReview, Error<PullsSlashGetReviewError>> {
507    let local_var_configuration = configuration;
508
509    let local_var_client = &local_var_configuration.client;
510
511    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number, review_id=review_id);
512    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
513
514    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
515        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
516    }
517
518    let local_var_req = local_var_req_builder.build()?;
519    let local_var_resp = local_var_client.execute(local_var_req).await?;
520
521    let local_var_status = local_var_resp.status();
522    let local_var_content = local_var_resp.text().await?;
523
524    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
525        serde_json::from_str(&local_var_content).map_err(Error::from)
526    } else {
527        let local_var_entity: Option<PullsSlashGetReviewError> = serde_json::from_str(&local_var_content).ok();
528        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
529        Err(Error::ResponseError(local_var_error))
530    }
531}
532
533/// Provides details for a specified review comment.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
534pub async fn pulls_slash_get_review_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32) -> Result<models::PullRequestReviewComment, Error<PullsSlashGetReviewCommentError>> {
535    let local_var_configuration = configuration;
536
537    let local_var_client = &local_var_configuration.client;
538
539    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
540    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
541
542    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
543        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
544    }
545
546    let local_var_req = local_var_req_builder.build()?;
547    let local_var_resp = local_var_client.execute(local_var_req).await?;
548
549    let local_var_status = local_var_resp.status();
550    let local_var_content = local_var_resp.text().await?;
551
552    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
553        serde_json::from_str(&local_var_content).map_err(Error::from)
554    } else {
555        let local_var_entity: Option<PullsSlashGetReviewCommentError> = serde_json::from_str(&local_var_content).ok();
556        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
557        Err(Error::ResponseError(local_var_error))
558    }
559}
560
561/// Lists pull requests in a specified repository.  Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  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`.
562pub async fn pulls_slash_list(configuration: &configuration::Configuration, owner: &str, repo: &str, state: Option<&str>, head: Option<&str>, base: Option<&str>, sort: Option<&str>, direction: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::PullRequestSimple>, Error<PullsSlashListError>> {
563    let local_var_configuration = configuration;
564
565    let local_var_client = &local_var_configuration.client;
566
567    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
568    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
569
570    if let Some(ref local_var_str) = state {
571        local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
572    }
573    if let Some(ref local_var_str) = head {
574        local_var_req_builder = local_var_req_builder.query(&[("head", &local_var_str.to_string())]);
575    }
576    if let Some(ref local_var_str) = base {
577        local_var_req_builder = local_var_req_builder.query(&[("base", &local_var_str.to_string())]);
578    }
579    if let Some(ref local_var_str) = sort {
580        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
581    }
582    if let Some(ref local_var_str) = direction {
583        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
584    }
585    if let Some(ref local_var_str) = per_page {
586        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
587    }
588    if let Some(ref local_var_str) = page {
589        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
590    }
591    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
592        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
593    }
594
595    let local_var_req = local_var_req_builder.build()?;
596    let local_var_resp = local_var_client.execute(local_var_req).await?;
597
598    let local_var_status = local_var_resp.status();
599    let local_var_content = local_var_resp.text().await?;
600
601    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
602        serde_json::from_str(&local_var_content).map_err(Error::from)
603    } else {
604        let local_var_entity: Option<PullsSlashListError> = serde_json::from_str(&local_var_content).ok();
605        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
606        Err(Error::ResponseError(local_var_error))
607    }
608}
609
610/// Lists comments for a specific pull request review.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
611pub async fn pulls_slash_list_comments_for_review(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, review_id: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::ReviewComment>, Error<PullsSlashListCommentsForReviewError>> {
612    let local_var_configuration = configuration;
613
614    let local_var_client = &local_var_configuration.client;
615
616    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number, review_id=review_id);
617    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
618
619    if let Some(ref local_var_str) = per_page {
620        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
621    }
622    if let Some(ref local_var_str) = page {
623        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
624    }
625    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
626        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
627    }
628
629    let local_var_req = local_var_req_builder.build()?;
630    let local_var_resp = local_var_client.execute(local_var_req).await?;
631
632    let local_var_status = local_var_resp.status();
633    let local_var_content = local_var_resp.text().await?;
634
635    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
636        serde_json::from_str(&local_var_content).map_err(Error::from)
637    } else {
638        let local_var_entity: Option<PullsSlashListCommentsForReviewError> = serde_json::from_str(&local_var_content).ok();
639        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
640        Err(Error::ResponseError(local_var_error))
641    }
642}
643
644/// Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/commits/commits#list-commits) 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`.
645pub async fn pulls_slash_list_commits(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Commit>, Error<PullsSlashListCommitsError>> {
646    let local_var_configuration = configuration;
647
648    let local_var_client = &local_var_configuration.client;
649
650    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/commits", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
651    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
652
653    if let Some(ref local_var_str) = per_page {
654        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
655    }
656    if let Some(ref local_var_str) = page {
657        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
658    }
659    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
660        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
661    }
662
663    let local_var_req = local_var_req_builder.build()?;
664    let local_var_resp = local_var_client.execute(local_var_req).await?;
665
666    let local_var_status = local_var_resp.status();
667    let local_var_content = local_var_resp.text().await?;
668
669    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
670        serde_json::from_str(&local_var_content).map_err(Error::from)
671    } else {
672        let local_var_entity: Option<PullsSlashListCommitsError> = serde_json::from_str(&local_var_content).ok();
673        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
674        Err(Error::ResponseError(local_var_error))
675    }
676}
677
678/// Lists the files in a specified pull request.  **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.  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`.
679pub async fn pulls_slash_list_files(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::DiffEntry>, Error<PullsSlashListFilesError>> {
680    let local_var_configuration = configuration;
681
682    let local_var_client = &local_var_configuration.client;
683
684    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/files", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
685    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
686
687    if let Some(ref local_var_str) = per_page {
688        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
689    }
690    if let Some(ref local_var_str) = page {
691        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
692    }
693    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
694        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
695    }
696
697    let local_var_req = local_var_req_builder.build()?;
698    let local_var_resp = local_var_client.execute(local_var_req).await?;
699
700    let local_var_status = local_var_resp.status();
701    let local_var_content = local_var_resp.text().await?;
702
703    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
704        serde_json::from_str(&local_var_content).map_err(Error::from)
705    } else {
706        let local_var_entity: Option<PullsSlashListFilesError> = serde_json::from_str(&local_var_content).ok();
707        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
708        Err(Error::ResponseError(local_var_error))
709    }
710}
711
712/// Gets the users or teams whose review is requested for a pull request. Once a requested reviewer submits a review, they are no longer considered a requested reviewer. Their review will instead be returned by the [List reviews for a pull request](https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request) operation.
713pub async fn pulls_slash_list_requested_reviewers(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32) -> Result<models::PullRequestReviewRequest, Error<PullsSlashListRequestedReviewersError>> {
714    let local_var_configuration = configuration;
715
716    let local_var_client = &local_var_configuration.client;
717
718    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
719    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
720
721    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
722        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
723    }
724
725    let local_var_req = local_var_req_builder.build()?;
726    let local_var_resp = local_var_client.execute(local_var_req).await?;
727
728    let local_var_status = local_var_resp.status();
729    let local_var_content = local_var_resp.text().await?;
730
731    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
732        serde_json::from_str(&local_var_content).map_err(Error::from)
733    } else {
734        let local_var_entity: Option<PullsSlashListRequestedReviewersError> = serde_json::from_str(&local_var_content).ok();
735        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
736        Err(Error::ResponseError(local_var_error))
737    }
738}
739
740/// Lists all review comments for a specified pull request. By default, review comments are in ascending order by 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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
741pub async fn pulls_slash_list_review_comments(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, sort: Option<&str>, direction: Option<&str>, since: Option<String>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::PullRequestReviewComment>, Error<PullsSlashListReviewCommentsError>> {
742    let local_var_configuration = configuration;
743
744    let local_var_client = &local_var_configuration.client;
745
746    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
747    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
748
749    if let Some(ref local_var_str) = sort {
750        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
751    }
752    if let Some(ref local_var_str) = direction {
753        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
754    }
755    if let Some(ref local_var_str) = since {
756        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
757    }
758    if let Some(ref local_var_str) = per_page {
759        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
760    }
761    if let Some(ref local_var_str) = page {
762        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
763    }
764    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
765        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
766    }
767
768    let local_var_req = local_var_req_builder.build()?;
769    let local_var_resp = local_var_client.execute(local_var_req).await?;
770
771    let local_var_status = local_var_resp.status();
772    let local_var_content = local_var_resp.text().await?;
773
774    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
775        serde_json::from_str(&local_var_content).map_err(Error::from)
776    } else {
777        let local_var_entity: Option<PullsSlashListReviewCommentsError> = serde_json::from_str(&local_var_content).ok();
778        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
779        Err(Error::ResponseError(local_var_error))
780    }
781}
782
783/// Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by 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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
784pub async fn pulls_slash_list_review_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::PullRequestReviewComment>, Error<PullsSlashListReviewCommentsForRepoError>> {
785    let local_var_configuration = configuration;
786
787    let local_var_client = &local_var_configuration.client;
788
789    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
790    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
791
792    if let Some(ref local_var_str) = sort {
793        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
794    }
795    if let Some(ref local_var_str) = direction {
796        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
797    }
798    if let Some(ref local_var_str) = since {
799        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
800    }
801    if let Some(ref local_var_str) = per_page {
802        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
803    }
804    if let Some(ref local_var_str) = page {
805        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
806    }
807    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
808        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
809    }
810
811    let local_var_req = local_var_req_builder.build()?;
812    let local_var_resp = local_var_client.execute(local_var_req).await?;
813
814    let local_var_status = local_var_resp.status();
815    let local_var_content = local_var_resp.text().await?;
816
817    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
818        serde_json::from_str(&local_var_content).map_err(Error::from)
819    } else {
820        let local_var_entity: Option<PullsSlashListReviewCommentsForRepoError> = serde_json::from_str(&local_var_content).ok();
821        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
822        Err(Error::ResponseError(local_var_error))
823    }
824}
825
826/// Lists all reviews for a specified pull request. The list of reviews returns in chronological order.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
827pub async fn pulls_slash_list_reviews(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::PullRequestReview>, Error<PullsSlashListReviewsError>> {
828    let local_var_configuration = configuration;
829
830    let local_var_client = &local_var_configuration.client;
831
832    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/reviews", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
833    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
834
835    if let Some(ref local_var_str) = per_page {
836        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
837    }
838    if let Some(ref local_var_str) = page {
839        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
840    }
841    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
842        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
843    }
844
845    let local_var_req = local_var_req_builder.build()?;
846    let local_var_resp = local_var_client.execute(local_var_req).await?;
847
848    let local_var_status = local_var_resp.status();
849    let local_var_content = local_var_resp.text().await?;
850
851    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
852        serde_json::from_str(&local_var_content).map_err(Error::from)
853    } else {
854        let local_var_entity: Option<PullsSlashListReviewsError> = serde_json::from_str(&local_var_content).ok();
855        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
856        Err(Error::ResponseError(local_var_error))
857    }
858}
859
860/// Merges a pull request into the base branch. 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).\"
861pub async fn pulls_slash_merge(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, pulls_merge_request: Option<models::PullsMergeRequest>) -> Result<models::PullRequestMergeResult, Error<PullsSlashMergeError>> {
862    let local_var_configuration = configuration;
863
864    let local_var_client = &local_var_configuration.client;
865
866    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/merge", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
867    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
868
869    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
870        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
871    }
872    local_var_req_builder = local_var_req_builder.json(&pulls_merge_request);
873
874    let local_var_req = local_var_req_builder.build()?;
875    let local_var_resp = local_var_client.execute(local_var_req).await?;
876
877    let local_var_status = local_var_resp.status();
878    let local_var_content = local_var_resp.text().await?;
879
880    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
881        serde_json::from_str(&local_var_content).map_err(Error::from)
882    } else {
883        let local_var_entity: Option<PullsSlashMergeError> = serde_json::from_str(&local_var_content).ok();
884        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
885        Err(Error::ResponseError(local_var_error))
886    }
887}
888
889/// Removes review requests from a pull request for a given set of users and/or teams.
890pub async fn pulls_slash_remove_requested_reviewers(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, pulls_remove_requested_reviewers_request: models::PullsRemoveRequestedReviewersRequest) -> Result<models::PullRequestSimple, Error<PullsSlashRemoveRequestedReviewersError>> {
891    let local_var_configuration = configuration;
892
893    let local_var_client = &local_var_configuration.client;
894
895    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
896    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
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    local_var_req_builder = local_var_req_builder.json(&pulls_remove_requested_reviewers_request);
902
903    let local_var_req = local_var_req_builder.build()?;
904    let local_var_resp = local_var_client.execute(local_var_req).await?;
905
906    let local_var_status = local_var_resp.status();
907    let local_var_content = local_var_resp.text().await?;
908
909    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
910        serde_json::from_str(&local_var_content).map_err(Error::from)
911    } else {
912        let local_var_entity: Option<PullsSlashRemoveRequestedReviewersError> = serde_json::from_str(&local_var_content).ok();
913        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
914        Err(Error::ResponseError(local_var_error))
915    }
916}
917
918/// 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. See \"[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.
919pub async fn pulls_slash_request_reviewers(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, pulls_request_reviewers_request: Option<models::PullsRequestReviewersRequest>) -> Result<models::PullRequestSimple, Error<PullsSlashRequestReviewersError>> {
920    let local_var_configuration = configuration;
921
922    let local_var_client = &local_var_configuration.client;
923
924    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
925    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
926
927    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
928        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
929    }
930    local_var_req_builder = local_var_req_builder.json(&pulls_request_reviewers_request);
931
932    let local_var_req = local_var_req_builder.build()?;
933    let local_var_resp = local_var_client.execute(local_var_req).await?;
934
935    let local_var_status = local_var_resp.status();
936    let local_var_content = local_var_resp.text().await?;
937
938    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
939        serde_json::from_str(&local_var_content).map_err(Error::from)
940    } else {
941        let local_var_entity: Option<PullsSlashRequestReviewersError> = serde_json::from_str(&local_var_content).ok();
942        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
943        Err(Error::ResponseError(local_var_error))
944    }
945}
946
947/// Submits a pending review for a pull request. For more information about creating a pending review for a pull request, see \"[Create a review for a pull request](https://docs.github.com/rest/pulls/reviews#create-a-review-for-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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
948pub async fn pulls_slash_submit_review(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, review_id: i32, pulls_submit_review_request: models::PullsSubmitReviewRequest) -> Result<models::PullRequestReview, Error<PullsSlashSubmitReviewError>> {
949    let local_var_configuration = configuration;
950
951    let local_var_client = &local_var_configuration.client;
952
953    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number, review_id=review_id);
954    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
955
956    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
957        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
958    }
959    local_var_req_builder = local_var_req_builder.json(&pulls_submit_review_request);
960
961    let local_var_req = local_var_req_builder.build()?;
962    let local_var_resp = local_var_client.execute(local_var_req).await?;
963
964    let local_var_status = local_var_resp.status();
965    let local_var_content = local_var_resp.text().await?;
966
967    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
968        serde_json::from_str(&local_var_content).map_err(Error::from)
969    } else {
970        let local_var_entity: Option<PullsSlashSubmitReviewError> = serde_json::from_str(&local_var_content).ok();
971        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
972        Err(Error::ResponseError(local_var_error))
973    }
974}
975
976/// Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.  To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update 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`.
977pub async fn pulls_slash_update(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, pulls_update_request: Option<models::PullsUpdateRequest>) -> Result<models::PullRequest, Error<PullsSlashUpdateError>> {
978    let local_var_configuration = configuration;
979
980    let local_var_client = &local_var_configuration.client;
981
982    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
983    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
984
985    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
986        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
987    }
988    local_var_req_builder = local_var_req_builder.json(&pulls_update_request);
989
990    let local_var_req = local_var_req_builder.build()?;
991    let local_var_resp = local_var_client.execute(local_var_req).await?;
992
993    let local_var_status = local_var_resp.status();
994    let local_var_content = local_var_resp.text().await?;
995
996    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
997        serde_json::from_str(&local_var_content).map_err(Error::from)
998    } else {
999        let local_var_entity: Option<PullsSlashUpdateError> = serde_json::from_str(&local_var_content).ok();
1000        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1001        Err(Error::ResponseError(local_var_error))
1002    }
1003}
1004
1005/// Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.
1006pub async fn pulls_slash_update_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, pulls_update_branch_request: Option<models::PullsUpdateBranchRequest>) -> Result<models::ActivityMarkRepoNotificationsAsRead202Response, Error<PullsSlashUpdateBranchError>> {
1007    let local_var_configuration = configuration;
1008
1009    let local_var_client = &local_var_configuration.client;
1010
1011    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/update-branch", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number);
1012    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1013
1014    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1015        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1016    }
1017    local_var_req_builder = local_var_req_builder.json(&pulls_update_branch_request);
1018
1019    let local_var_req = local_var_req_builder.build()?;
1020    let local_var_resp = local_var_client.execute(local_var_req).await?;
1021
1022    let local_var_status = local_var_resp.status();
1023    let local_var_content = local_var_resp.text().await?;
1024
1025    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1026        serde_json::from_str(&local_var_content).map_err(Error::from)
1027    } else {
1028        let local_var_entity: Option<PullsSlashUpdateBranchError> = serde_json::from_str(&local_var_content).ok();
1029        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1030        Err(Error::ResponseError(local_var_error))
1031    }
1032}
1033
1034/// Updates the contents of a specified review summary comment.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
1035pub async fn pulls_slash_update_review(configuration: &configuration::Configuration, owner: &str, repo: &str, pull_number: i32, review_id: i32, pulls_update_review_request: models::PullsUpdateReviewRequest) -> Result<models::PullRequestReview, Error<PullsSlashUpdateReviewError>> {
1036    let local_var_configuration = configuration;
1037
1038    let local_var_client = &local_var_configuration.client;
1039
1040    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pull_number=pull_number, review_id=review_id);
1041    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1042
1043    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1044        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1045    }
1046    local_var_req_builder = local_var_req_builder.json(&pulls_update_review_request);
1047
1048    let local_var_req = local_var_req_builder.build()?;
1049    let local_var_resp = local_var_client.execute(local_var_req).await?;
1050
1051    let local_var_status = local_var_resp.status();
1052    let local_var_content = local_var_resp.text().await?;
1053
1054    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1055        serde_json::from_str(&local_var_content).map_err(Error::from)
1056    } else {
1057        let local_var_entity: Option<PullsSlashUpdateReviewError> = serde_json::from_str(&local_var_content).ok();
1058        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1059        Err(Error::ResponseError(local_var_error))
1060    }
1061}
1062
1063/// Edits the content of a specified review comment.  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-commitcomment.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-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`. - **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`. - **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.
1064pub async fn pulls_slash_update_review_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, comment_id: i32, pulls_update_review_comment_request: models::PullsUpdateReviewCommentRequest) -> Result<models::PullRequestReviewComment, Error<PullsSlashUpdateReviewCommentError>> {
1065    let local_var_configuration = configuration;
1066
1067    let local_var_client = &local_var_configuration.client;
1068
1069    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/comments/{comment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), comment_id=comment_id);
1070    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1071
1072    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1073        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1074    }
1075    local_var_req_builder = local_var_req_builder.json(&pulls_update_review_comment_request);
1076
1077    let local_var_req = local_var_req_builder.build()?;
1078    let local_var_resp = local_var_client.execute(local_var_req).await?;
1079
1080    let local_var_status = local_var_resp.status();
1081    let local_var_content = local_var_resp.text().await?;
1082
1083    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1084        serde_json::from_str(&local_var_content).map_err(Error::from)
1085    } else {
1086        let local_var_entity: Option<PullsSlashUpdateReviewCommentError> = serde_json::from_str(&local_var_content).ok();
1087        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1088        Err(Error::ResponseError(local_var_error))
1089    }
1090}
1091