openapi_github/models/
topic_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/// TopicSearchResultItem : Topic Search Result Item
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TopicSearchResultItem {
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "display_name", deserialize_with = "Option::deserialize")]
20    pub display_name: Option<String>,
21    #[serde(rename = "short_description", deserialize_with = "Option::deserialize")]
22    pub short_description: Option<String>,
23    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
24    pub description: Option<String>,
25    #[serde(rename = "created_by", deserialize_with = "Option::deserialize")]
26    pub created_by: Option<String>,
27    #[serde(rename = "released", deserialize_with = "Option::deserialize")]
28    pub released: Option<String>,
29    #[serde(rename = "created_at")]
30    pub created_at: String,
31    #[serde(rename = "updated_at")]
32    pub updated_at: String,
33    #[serde(rename = "featured")]
34    pub featured: bool,
35    #[serde(rename = "curated")]
36    pub curated: bool,
37    #[serde(rename = "score")]
38    pub score: f64,
39    #[serde(rename = "repository_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub repository_count: Option<Option<i32>>,
41    #[serde(rename = "logo_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub logo_url: Option<Option<String>>,
43    #[serde(rename = "text_matches", skip_serializing_if = "Option::is_none")]
44    pub text_matches: Option<Vec<models::SearchResultTextMatchesInner>>,
45    #[serde(rename = "related", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub related: Option<Option<Vec<models::TopicSearchResultItemRelatedInner>>>,
47    #[serde(rename = "aliases", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
48    pub aliases: Option<Option<Vec<models::TopicSearchResultItemRelatedInner>>>,
49}
50
51impl TopicSearchResultItem {
52    /// Topic Search Result Item
53    pub fn new(name: String, display_name: Option<String>, short_description: Option<String>, description: Option<String>, created_by: Option<String>, released: Option<String>, created_at: String, updated_at: String, featured: bool, curated: bool, score: f64) -> TopicSearchResultItem {
54        TopicSearchResultItem {
55            name,
56            display_name,
57            short_description,
58            description,
59            created_by,
60            released,
61            created_at,
62            updated_at,
63            featured,
64            curated,
65            score,
66            repository_count: None,
67            logo_url: None,
68            text_matches: None,
69            related: None,
70            aliases: None,
71        }
72    }
73}
74