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