openapi_github/models/
label_search_result_item.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[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 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