openapi_github/models/
user_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/// UserSearchResultItem : User Search Result Item
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UserSearchResultItem {
17    #[serde(rename = "login")]
18    pub login: String,
19    #[serde(rename = "id")]
20    pub id: i32,
21    #[serde(rename = "node_id")]
22    pub node_id: String,
23    #[serde(rename = "avatar_url")]
24    pub avatar_url: String,
25    #[serde(rename = "gravatar_id", deserialize_with = "Option::deserialize")]
26    pub gravatar_id: Option<String>,
27    #[serde(rename = "url")]
28    pub url: String,
29    #[serde(rename = "html_url")]
30    pub html_url: String,
31    #[serde(rename = "followers_url")]
32    pub followers_url: String,
33    #[serde(rename = "subscriptions_url")]
34    pub subscriptions_url: String,
35    #[serde(rename = "organizations_url")]
36    pub organizations_url: String,
37    #[serde(rename = "repos_url")]
38    pub repos_url: String,
39    #[serde(rename = "received_events_url")]
40    pub received_events_url: String,
41    #[serde(rename = "type")]
42    pub r#type: String,
43    #[serde(rename = "score")]
44    pub score: f64,
45    #[serde(rename = "following_url")]
46    pub following_url: String,
47    #[serde(rename = "gists_url")]
48    pub gists_url: String,
49    #[serde(rename = "starred_url")]
50    pub starred_url: String,
51    #[serde(rename = "events_url")]
52    pub events_url: String,
53    #[serde(rename = "public_repos", skip_serializing_if = "Option::is_none")]
54    pub public_repos: Option<i32>,
55    #[serde(rename = "public_gists", skip_serializing_if = "Option::is_none")]
56    pub public_gists: Option<i32>,
57    #[serde(rename = "followers", skip_serializing_if = "Option::is_none")]
58    pub followers: Option<i32>,
59    #[serde(rename = "following", skip_serializing_if = "Option::is_none")]
60    pub following: Option<i32>,
61    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
62    pub created_at: Option<String>,
63    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
64    pub updated_at: Option<String>,
65    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
66    pub name: Option<Option<String>>,
67    #[serde(rename = "bio", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
68    pub bio: Option<Option<String>>,
69    #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
70    pub email: Option<Option<String>>,
71    #[serde(rename = "location", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
72    pub location: Option<Option<String>>,
73    #[serde(rename = "site_admin")]
74    pub site_admin: bool,
75    #[serde(rename = "hireable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
76    pub hireable: Option<Option<bool>>,
77    #[serde(rename = "text_matches", skip_serializing_if = "Option::is_none")]
78    pub text_matches: Option<Vec<models::SearchResultTextMatchesInner>>,
79    #[serde(rename = "blog", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
80    pub blog: Option<Option<String>>,
81    #[serde(rename = "company", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
82    pub company: Option<Option<String>>,
83    #[serde(rename = "suspended_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
84    pub suspended_at: Option<Option<String>>,
85}
86
87impl UserSearchResultItem {
88    /// User Search Result Item
89    pub fn new(login: String, id: i32, node_id: String, avatar_url: String, gravatar_id: Option<String>, url: String, html_url: String, followers_url: String, subscriptions_url: String, organizations_url: String, repos_url: String, received_events_url: String, r#type: String, score: f64, following_url: String, gists_url: String, starred_url: String, events_url: String, site_admin: bool) -> UserSearchResultItem {
90        UserSearchResultItem {
91            login,
92            id,
93            node_id,
94            avatar_url,
95            gravatar_id,
96            url,
97            html_url,
98            followers_url,
99            subscriptions_url,
100            organizations_url,
101            repos_url,
102            received_events_url,
103            r#type,
104            score,
105            following_url,
106            gists_url,
107            starred_url,
108            events_url,
109            public_repos: None,
110            public_gists: None,
111            followers: None,
112            following: None,
113            created_at: None,
114            updated_at: None,
115            name: None,
116            bio: None,
117            email: None,
118            location: None,
119            site_admin,
120            hireable: None,
121            text_matches: None,
122            blog: None,
123            company: None,
124            suspended_at: None,
125        }
126    }
127}
128