openapi_github/models/
label_search_result_item.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/// LabelSearchResultItem : Label Search Result Item
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LabelSearchResultItem {
17    #[serde(rename = "id")]
18    pub id: i32,
19    #[serde(rename = "node_id")]
20    pub node_id: String,
21    #[serde(rename = "url")]
22    pub url: String,
23    #[serde(rename = "name")]
24    pub name: String,
25    #[serde(rename = "color")]
26    pub color: String,
27    #[serde(rename = "default")]
28    pub default: bool,
29    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
30    pub description: Option<String>,
31    #[serde(rename = "score")]
32    pub score: f64,
33    #[serde(rename = "text_matches", skip_serializing_if = "Option::is_none")]
34    pub text_matches: Option<Vec<models::SearchResultTextMatchesInner>>,
35}
36
37impl LabelSearchResultItem {
38    /// Label Search Result Item
39    pub fn new(id: i32, node_id: String, url: String, name: String, color: String, default: bool, description: Option<String>, score: f64) -> LabelSearchResultItem {
40        LabelSearchResultItem {
41            id,
42            node_id,
43            url,
44            name,
45            color,
46            default,
47            description,
48            score,
49            text_matches: None,
50        }
51    }
52}
53