openapi_github/models/
codespaces_set_codespaces_access_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 CodespacesSetCodespacesAccessRequest {
16    /// Which users can access codespaces in the organization. `disabled` means that no users can access codespaces in the organization.
17    #[serde(rename = "visibility")]
18    pub visibility: Visibility,
19    /// The usernames of the organization members who should have access to codespaces in the organization. Required when `visibility` is `selected_members`. The provided list of usernames will replace any existing value.
20    #[serde(rename = "selected_usernames", skip_serializing_if = "Option::is_none")]
21    pub selected_usernames: Option<Vec<String>>,
22}
23
24impl CodespacesSetCodespacesAccessRequest {
25    pub fn new(visibility: Visibility) -> CodespacesSetCodespacesAccessRequest {
26        CodespacesSetCodespacesAccessRequest {
27            visibility,
28            selected_usernames: None,
29        }
30    }
31}
32/// Which users can access codespaces in the organization. `disabled` means that no users can access codespaces in the organization.
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum Visibility {
35    #[serde(rename = "disabled")]
36    Disabled,
37    #[serde(rename = "selected_members")]
38    SelectedMembers,
39    #[serde(rename = "all_members")]
40    AllMembers,
41    #[serde(rename = "all_members_and_outside_collaborators")]
42    AllMembersAndOutsideCollaborators,
43}
44
45impl Default for Visibility {
46    fn default() -> Visibility {
47        Self::Disabled
48    }
49}
50