openapi_github/models/
webhooks_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhooksProject {
16    /// Body of the project
17    #[serde(rename = "body", deserialize_with = "Option::deserialize")]
18    pub body: Option<String>,
19    #[serde(rename = "columns_url")]
20    pub columns_url: String,
21    #[serde(rename = "created_at")]
22    pub created_at: String,
23    #[serde(rename = "creator", deserialize_with = "Option::deserialize")]
24    pub creator: Option<Box<models::User>>,
25    #[serde(rename = "html_url")]
26    pub html_url: String,
27    #[serde(rename = "id")]
28    pub id: i32,
29    /// Name of the project
30    #[serde(rename = "name")]
31    pub name: String,
32    #[serde(rename = "node_id")]
33    pub node_id: String,
34    #[serde(rename = "number")]
35    pub number: i32,
36    #[serde(rename = "owner_url")]
37    pub owner_url: String,
38    /// State of the project; either 'open' or 'closed'
39    #[serde(rename = "state")]
40    pub state: State,
41    #[serde(rename = "updated_at")]
42    pub updated_at: String,
43    #[serde(rename = "url")]
44    pub url: String,
45}
46
47impl WebhooksProject {
48    pub fn new(body: Option<String>, columns_url: String, created_at: String, creator: Option<models::User>, html_url: String, id: i32, name: String, node_id: String, number: i32, owner_url: String, state: State, updated_at: String, url: String) -> WebhooksProject {
49        WebhooksProject {
50            body,
51            columns_url,
52            created_at,
53            creator: creator.map(Box::new),
54            html_url,
55            id,
56            name,
57            node_id,
58            number,
59            owner_url,
60            state,
61            updated_at,
62            url,
63        }
64    }
65}
66/// State of the project; either 'open' or 'closed'
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum State {
69    #[serde(rename = "open")]
70    Open,
71    #[serde(rename = "closed")]
72    Closed,
73}
74
75impl Default for State {
76    fn default() -> State {
77        Self::Open
78    }
79}
80