openapi_github/models/actions_workflow_access_to_repository.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 ActionsWorkflowAccessToRepository {
16 /// Defines the level of access that workflows outside of the repository have to actions and reusable workflows within the repository. `none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization.
17 #[serde(rename = "access_level")]
18 pub access_level: AccessLevel,
19}
20
21impl ActionsWorkflowAccessToRepository {
22 pub fn new(access_level: AccessLevel) -> ActionsWorkflowAccessToRepository {
23 ActionsWorkflowAccessToRepository {
24 access_level,
25 }
26 }
27}
28/// Defines the level of access that workflows outside of the repository have to actions and reusable workflows within the repository. `none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization.
29#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
30pub enum AccessLevel {
31 #[serde(rename = "none")]
32 None,
33 #[serde(rename = "user")]
34 User,
35 #[serde(rename = "organization")]
36 Organization,
37}
38
39impl Default for AccessLevel {
40 fn default() -> AccessLevel {
41 Self::None
42 }
43}
44