openapi_github/models/
organization_actions_variable.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/// OrganizationActionsVariable : Organization variable for GitHub Actions.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OrganizationActionsVariable {
17    /// The name of the variable.
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The value of the variable.
21    #[serde(rename = "value")]
22    pub value: String,
23    /// The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
24    #[serde(rename = "created_at")]
25    pub created_at: String,
26    /// The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
27    #[serde(rename = "updated_at")]
28    pub updated_at: String,
29    /// Visibility of a variable
30    #[serde(rename = "visibility")]
31    pub visibility: Visibility,
32    #[serde(rename = "selected_repositories_url", skip_serializing_if = "Option::is_none")]
33    pub selected_repositories_url: Option<String>,
34}
35
36impl OrganizationActionsVariable {
37    /// Organization variable for GitHub Actions.
38    pub fn new(name: String, value: String, created_at: String, updated_at: String, visibility: Visibility) -> OrganizationActionsVariable {
39        OrganizationActionsVariable {
40            name,
41            value,
42            created_at,
43            updated_at,
44            visibility,
45            selected_repositories_url: None,
46        }
47    }
48}
49/// Visibility of a variable
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Visibility {
52    #[serde(rename = "all")]
53    All,
54    #[serde(rename = "private")]
55    Private,
56    #[serde(rename = "selected")]
57    Selected,
58}
59
60impl Default for Visibility {
61    fn default() -> Visibility {
62        Self::All
63    }
64}
65