openapi_github/models/
pulls_submit_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 PullsSubmitReviewRequest {
16    /// The body text of the pull request review
17    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
18    pub body: Option<String>,
19    /// The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to `PENDING`, which means you will need to re-submit the pull request review using a review action.
20    #[serde(rename = "event")]
21    pub event: Event,
22}
23
24impl PullsSubmitReviewRequest {
25    pub fn new(event: Event) -> PullsSubmitReviewRequest {
26        PullsSubmitReviewRequest {
27            body: None,
28            event,
29        }
30    }
31}
32/// The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to `PENDING`, which means you will need to re-submit the pull request review using a review action.
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum Event {
35    #[serde(rename = "APPROVE")]
36    Approve,
37    #[serde(rename = "REQUEST_CHANGES")]
38    RequestChanges,
39    #[serde(rename = "COMMENT")]
40    Comment,
41}
42
43impl Default for Event {
44    fn default() -> Event {
45        Self::Approve
46    }
47}
48