openapi_github/models/
project.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/// Project : Projects are a way to organize columns and cards of work.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Project {
17    #[serde(rename = "owner_url")]
18    pub owner_url: String,
19    #[serde(rename = "url")]
20    pub url: String,
21    #[serde(rename = "html_url")]
22    pub html_url: String,
23    #[serde(rename = "columns_url")]
24    pub columns_url: String,
25    #[serde(rename = "id")]
26    pub id: i32,
27    #[serde(rename = "node_id")]
28    pub node_id: String,
29    /// Name of the project
30    #[serde(rename = "name")]
31    pub name: String,
32    /// Body of the project
33    #[serde(rename = "body", deserialize_with = "Option::deserialize")]
34    pub body: Option<String>,
35    #[serde(rename = "number")]
36    pub number: i32,
37    /// State of the project; either 'open' or 'closed'
38    #[serde(rename = "state")]
39    pub state: String,
40    #[serde(rename = "creator", deserialize_with = "Option::deserialize")]
41    pub creator: Option<Box<models::NullableSimpleUser>>,
42    #[serde(rename = "created_at")]
43    pub created_at: String,
44    #[serde(rename = "updated_at")]
45    pub updated_at: String,
46    /// The baseline permission that all organization members have on this project. Only present if owner is an organization.
47    #[serde(rename = "organization_permission", skip_serializing_if = "Option::is_none")]
48    pub organization_permission: Option<OrganizationPermission>,
49    /// Whether or not this project can be seen by everyone. Only present if owner is an organization.
50    #[serde(rename = "private", skip_serializing_if = "Option::is_none")]
51    pub private: Option<bool>,
52}
53
54impl Project {
55    /// Projects are a way to organize columns and cards of work.
56    pub fn new(owner_url: String, url: String, html_url: String, columns_url: String, id: i32, node_id: String, name: String, body: Option<String>, number: i32, state: String, creator: Option<models::NullableSimpleUser>, created_at: String, updated_at: String) -> Project {
57        Project {
58            owner_url,
59            url,
60            html_url,
61            columns_url,
62            id,
63            node_id,
64            name,
65            body,
66            number,
67            state,
68            creator: creator.map(Box::new),
69            created_at,
70            updated_at,
71            organization_permission: None,
72            private: None,
73        }
74    }
75}
76/// The baseline permission that all organization members have on this project. Only present if owner is an organization.
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
78pub enum OrganizationPermission {
79    #[serde(rename = "read")]
80    Read,
81    #[serde(rename = "write")]
82    Write,
83    #[serde(rename = "admin")]
84    Admin,
85    #[serde(rename = "none")]
86    None,
87}
88
89impl Default for OrganizationPermission {
90    fn default() -> OrganizationPermission {
91        Self::Read
92    }
93}
94