1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum PullsSlashCheckIfMergedError {
22 Status404(),
23 UnknownValue(serde_json::Value),
24}
25
26#[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#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(untagged)]
38pub enum PullsSlashCreateReplyForReviewCommentError {
39 Status404(models::BasicError),
40 UnknownValue(serde_json::Value),
41}
42
43#[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#[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#[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#[derive(Debug, Clone, Serialize, Deserialize)]
72#[serde(untagged)]
73pub enum PullsSlashDeleteReviewCommentError {
74 Status404(models::BasicError),
75 UnknownValue(serde_json::Value),
76}
77
78#[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#[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#[derive(Debug, Clone, Serialize, Deserialize)]
100#[serde(untagged)]
101pub enum PullsSlashGetReviewError {
102 Status404(models::BasicError),
103 UnknownValue(serde_json::Value),
104}
105
106#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum PullsSlashGetReviewCommentError {
110 Status404(models::BasicError),
111 UnknownValue(serde_json::Value),
112}
113
114#[derive(Debug, Clone, Serialize, Deserialize)]
116#[serde(untagged)]
117pub enum PullsSlashListError {
118 Status422(models::ValidationError),
119 UnknownValue(serde_json::Value),
120}
121
122#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum PullsSlashListCommentsForReviewError {
126 Status404(models::BasicError),
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PullsSlashListCommitsError {
134 UnknownValue(serde_json::Value),
135}
136
137#[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#[derive(Debug, Clone, Serialize, Deserialize)]
149#[serde(untagged)]
150pub enum PullsSlashListRequestedReviewersError {
151 UnknownValue(serde_json::Value),
152}
153
154#[derive(Debug, Clone, Serialize, Deserialize)]
156#[serde(untagged)]
157pub enum PullsSlashListReviewCommentsError {
158 UnknownValue(serde_json::Value),
159}
160
161#[derive(Debug, Clone, Serialize, Deserialize)]
163#[serde(untagged)]
164pub enum PullsSlashListReviewCommentsForRepoError {
165 UnknownValue(serde_json::Value),
166}
167
168#[derive(Debug, Clone, Serialize, Deserialize)]
170#[serde(untagged)]
171pub enum PullsSlashListReviewsError {
172 UnknownValue(serde_json::Value),
173}
174
175#[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#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum PullsSlashRemoveRequestedReviewersError {
191 Status422(models::ValidationError),
192 UnknownValue(serde_json::Value),
193}
194
195#[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#[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#[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#[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#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum PullsSlashUpdateReviewError {
236 Status422(models::ValidationErrorSimple),
237 UnknownValue(serde_json::Value),
238}
239
240#[derive(Debug, Clone, Serialize, Deserialize)]
242#[serde(untagged)]
243pub enum PullsSlashUpdateReviewCommentError {
244 UnknownValue(serde_json::Value),
245}
246
247
248pub 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
276pub 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
305pub 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
334pub 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
363pub 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
392pub 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
420pub 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
448pub 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
477pub 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
505pub 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
533pub 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
561pub 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
610pub 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
644pub 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
678pub 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
712pub 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
740pub 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
783pub 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
826pub 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
860pub 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
889pub 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
918pub 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
947pub 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
976pub 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
1005pub 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
1034pub 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
1063pub 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