openapi_github/models/
environment_approvals.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/// EnvironmentApprovals : An entry in the reviews log for environment deployments
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct EnvironmentApprovals {
17    /// The list of environments that were approved or rejected
18    #[serde(rename = "environments")]
19    pub environments: Vec<models::EnvironmentApprovalsEnvironmentsInner>,
20    /// Whether deployment to the environment(s) was approved or rejected or pending (with comments)
21    #[serde(rename = "state")]
22    pub state: State,
23    #[serde(rename = "user")]
24    pub user: Box<models::SimpleUser>,
25    /// The comment submitted with the deployment review
26    #[serde(rename = "comment")]
27    pub comment: String,
28}
29
30impl EnvironmentApprovals {
31    /// An entry in the reviews log for environment deployments
32    pub fn new(environments: Vec<models::EnvironmentApprovalsEnvironmentsInner>, state: State, user: models::SimpleUser, comment: String) -> EnvironmentApprovals {
33        EnvironmentApprovals {
34            environments,
35            state,
36            user: Box::new(user),
37            comment,
38        }
39    }
40}
41/// Whether deployment to the environment(s) was approved or rejected or pending (with comments)
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum State {
44    #[serde(rename = "approved")]
45    Approved,
46    #[serde(rename = "rejected")]
47    Rejected,
48    #[serde(rename = "pending")]
49    Pending,
50}
51
52impl Default for State {
53    fn default() -> State {
54        Self::Approved
55    }
56}
57