openapi_github/models/
orgs_review_pat_grant_request_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 OrgsReviewPatGrantRequestRequest {
16    /// Action to apply to the request.
17    #[serde(rename = "action")]
18    pub action: Action,
19    /// Reason for approving or denying the request. Max 1024 characters.
20    #[serde(rename = "reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub reason: Option<Option<String>>,
22}
23
24impl OrgsReviewPatGrantRequestRequest {
25    pub fn new(action: Action) -> OrgsReviewPatGrantRequestRequest {
26        OrgsReviewPatGrantRequestRequest {
27            action,
28            reason: None,
29        }
30    }
31}
32/// Action to apply to the request.
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum Action {
35    #[serde(rename = "approve")]
36    Approve,
37    #[serde(rename = "deny")]
38    Deny,
39}
40
41impl Default for Action {
42    fn default() -> Action {
43        Self::Approve
44    }
45}
46