openapi_github/models/
nullable_scoped_installation.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 NullableScopedInstallation {
16    #[serde(rename = "permissions")]
17    pub permissions: Box<models::AppPermissions>,
18    /// Describe whether all repositories have been selected or there's a selection involved
19    #[serde(rename = "repository_selection")]
20    pub repository_selection: RepositorySelection,
21    #[serde(rename = "single_file_name", deserialize_with = "Option::deserialize")]
22    pub single_file_name: Option<String>,
23    #[serde(rename = "has_multiple_single_files", skip_serializing_if = "Option::is_none")]
24    pub has_multiple_single_files: Option<bool>,
25    #[serde(rename = "single_file_paths", skip_serializing_if = "Option::is_none")]
26    pub single_file_paths: Option<Vec<String>>,
27    #[serde(rename = "repositories_url")]
28    pub repositories_url: String,
29    #[serde(rename = "account")]
30    pub account: Box<models::SimpleUser>,
31}
32
33impl NullableScopedInstallation {
34    pub fn new(permissions: models::AppPermissions, repository_selection: RepositorySelection, single_file_name: Option<String>, repositories_url: String, account: models::SimpleUser) -> NullableScopedInstallation {
35        NullableScopedInstallation {
36            permissions: Box::new(permissions),
37            repository_selection,
38            single_file_name,
39            has_multiple_single_files: None,
40            single_file_paths: None,
41            repositories_url,
42            account: Box::new(account),
43        }
44    }
45}
46/// Describe whether all repositories have been selected or there's a selection involved
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum RepositorySelection {
49    #[serde(rename = "all")]
50    All,
51    #[serde(rename = "selected")]
52    Selected,
53}
54
55impl Default for RepositorySelection {
56    fn default() -> RepositorySelection {
57        Self::All
58    }
59}
60