openapi_github/models/
status.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/// Status : The status of a commit.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Status {
17    #[serde(rename = "url")]
18    pub url: String,
19    #[serde(rename = "avatar_url", deserialize_with = "Option::deserialize")]
20    pub avatar_url: Option<String>,
21    #[serde(rename = "id")]
22    pub id: i32,
23    #[serde(rename = "node_id")]
24    pub node_id: String,
25    #[serde(rename = "state")]
26    pub state: String,
27    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
28    pub description: Option<String>,
29    #[serde(rename = "target_url", deserialize_with = "Option::deserialize")]
30    pub target_url: Option<String>,
31    #[serde(rename = "context")]
32    pub context: String,
33    #[serde(rename = "created_at")]
34    pub created_at: String,
35    #[serde(rename = "updated_at")]
36    pub updated_at: String,
37    #[serde(rename = "creator", deserialize_with = "Option::deserialize")]
38    pub creator: Option<Box<models::NullableSimpleUser>>,
39}
40
41impl Status {
42    /// The status of a commit.
43    pub fn new(url: String, avatar_url: Option<String>, id: i32, node_id: String, state: String, description: Option<String>, target_url: Option<String>, context: String, created_at: String, updated_at: String, creator: Option<models::NullableSimpleUser>) -> Status {
44        Status {
45            url,
46            avatar_url,
47            id,
48            node_id,
49            state,
50            description,
51            target_url,
52            context,
53            created_at,
54            updated_at,
55            creator: creator.map(Box::new),
56        }
57    }
58}
59