openapi_github/models/
label.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 Label {
16    /// 6-character hex code, without the leading #, identifying the color
17    #[serde(rename = "color")]
18    pub color: String,
19    #[serde(rename = "default")]
20    pub default: bool,
21    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
22    pub description: Option<String>,
23    #[serde(rename = "id")]
24    pub id: i32,
25    /// The name of the label.
26    #[serde(rename = "name")]
27    pub name: String,
28    #[serde(rename = "node_id")]
29    pub node_id: String,
30    /// URL for the label
31    #[serde(rename = "url")]
32    pub url: String,
33}
34
35impl Label {
36    pub fn new(color: String, default: bool, description: Option<String>, id: i32, name: String, node_id: String, url: String) -> Label {
37        Label {
38            color,
39            default,
40            description,
41            id,
42            name,
43            node_id,
44            url,
45        }
46    }
47}
48