openapi_github/models/
simple_commit_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SimpleCommitStatus {
16    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
17    pub description: Option<String>,
18    #[serde(rename = "id")]
19    pub id: i32,
20    #[serde(rename = "node_id")]
21    pub node_id: String,
22    #[serde(rename = "state")]
23    pub state: String,
24    #[serde(rename = "context")]
25    pub context: String,
26    #[serde(rename = "target_url", deserialize_with = "Option::deserialize")]
27    pub target_url: Option<String>,
28    #[serde(rename = "required", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub required: Option<Option<bool>>,
30    #[serde(rename = "avatar_url", deserialize_with = "Option::deserialize")]
31    pub avatar_url: Option<String>,
32    #[serde(rename = "url")]
33    pub url: String,
34    #[serde(rename = "created_at")]
35    pub created_at: String,
36    #[serde(rename = "updated_at")]
37    pub updated_at: String,
38}
39
40impl SimpleCommitStatus {
41    pub fn new(description: Option<String>, id: i32, node_id: String, state: String, context: String, target_url: Option<String>, avatar_url: Option<String>, url: String, created_at: String, updated_at: String) -> SimpleCommitStatus {
42        SimpleCommitStatus {
43            description,
44            id,
45            node_id,
46            state,
47            context,
48            target_url,
49            required: None,
50            avatar_url,
51            url,
52            created_at,
53            updated_at,
54        }
55    }
56}
57