openapi_github/models/
deployment_branch_policy.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/// DeploymentBranchPolicy : Details of a deployment branch or tag policy.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DeploymentBranchPolicy {
17    /// The unique identifier of the branch or tag policy.
18    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19    pub id: Option<i32>,
20    #[serde(rename = "node_id", skip_serializing_if = "Option::is_none")]
21    pub node_id: Option<String>,
22    /// The name pattern that branches or tags must match in order to deploy to the environment.
23    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    /// Whether this rule targets a branch or tag.
26    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
27    pub r#type: Option<Type>,
28}
29
30impl DeploymentBranchPolicy {
31    /// Details of a deployment branch or tag policy.
32    pub fn new() -> DeploymentBranchPolicy {
33        DeploymentBranchPolicy {
34            id: None,
35            node_id: None,
36            name: None,
37            r#type: None,
38        }
39    }
40}
41/// Whether this rule targets a branch or tag.
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Type {
44    #[serde(rename = "branch")]
45    Branch,
46    #[serde(rename = "tag")]
47    Tag,
48}
49
50impl Default for Type {
51    fn default() -> Type {
52        Self::Branch
53    }
54}
55