openapi_github/models/
team_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/// TeamProject : A team's access to a project.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TeamProject {
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    #[serde(rename = "name")]
30    pub name: String,
31    #[serde(rename = "body", deserialize_with = "Option::deserialize")]
32    pub body: Option<String>,
33    #[serde(rename = "number")]
34    pub number: i32,
35    #[serde(rename = "state")]
36    pub state: String,
37    #[serde(rename = "creator")]
38    pub creator: Box<models::SimpleUser>,
39    #[serde(rename = "created_at")]
40    pub created_at: String,
41    #[serde(rename = "updated_at")]
42    pub updated_at: String,
43    /// The organization permission for this project. Only present when owner is an organization.
44    #[serde(rename = "organization_permission", skip_serializing_if = "Option::is_none")]
45    pub organization_permission: Option<String>,
46    /// Whether the project is private or not. Only present when owner is an organization.
47    #[serde(rename = "private", skip_serializing_if = "Option::is_none")]
48    pub private: Option<bool>,
49    #[serde(rename = "permissions")]
50    pub permissions: Box<models::TeamProjectPermissions>,
51}
52
53impl TeamProject {
54    /// A team's access to a project.
55    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: models::SimpleUser, created_at: String, updated_at: String, permissions: models::TeamProjectPermissions) -> TeamProject {
56        TeamProject {
57            owner_url,
58            url,
59            html_url,
60            columns_url,
61            id,
62            node_id,
63            name,
64            body,
65            number,
66            state,
67            creator: Box::new(creator),
68            created_at,
69            updated_at,
70            organization_permission: None,
71            private: None,
72            permissions: Box::new(permissions),
73        }
74    }
75}
76