openapi_github/models/pulls_create_review_request.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
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct PullsCreateReviewRequest {
16 /// The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value.
17 #[serde(rename = "commit_id", skip_serializing_if = "Option::is_none")]
18 pub commit_id: Option<String>,
19 /// **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review.
20 #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
21 pub body: Option<String>,
22 /// The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request) when you are ready.
23 #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
24 pub event: Option<Event>,
25 /// Use the following table to specify the location, destination, and contents of the draft review comment.
26 #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
27 pub comments: Option<Vec<models::PullsCreateReviewRequestCommentsInner>>,
28}
29
30impl PullsCreateReviewRequest {
31 pub fn new() -> PullsCreateReviewRequest {
32 PullsCreateReviewRequest {
33 commit_id: None,
34 body: None,
35 event: None,
36 comments: None,
37 }
38 }
39}
40/// The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request) when you are ready.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Event {
43 #[serde(rename = "APPROVE")]
44 Approve,
45 #[serde(rename = "REQUEST_CHANGES")]
46 RequestChanges,
47 #[serde(rename = "COMMENT")]
48 Comment,
49}
50
51impl Default for Event {
52 fn default() -> Event {
53 Self::Approve
54 }
55}
56