openapi_github/models/
simple_repository.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/// SimpleRepository : A GitHub repository.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SimpleRepository {
17    /// A unique identifier of the repository.
18    #[serde(rename = "id")]
19    pub id: i32,
20    /// The GraphQL identifier of the repository.
21    #[serde(rename = "node_id")]
22    pub node_id: String,
23    /// The name of the repository.
24    #[serde(rename = "name")]
25    pub name: String,
26    /// The full, globally unique, name of the repository.
27    #[serde(rename = "full_name")]
28    pub full_name: String,
29    #[serde(rename = "owner")]
30    pub owner: Box<models::SimpleUser>,
31    /// Whether the repository is private.
32    #[serde(rename = "private")]
33    pub private: bool,
34    /// The URL to view the repository on GitHub.com.
35    #[serde(rename = "html_url")]
36    pub html_url: String,
37    /// The repository description.
38    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
39    pub description: Option<String>,
40    /// Whether the repository is a fork.
41    #[serde(rename = "fork")]
42    pub fork: bool,
43    /// The URL to get more information about the repository from the GitHub API.
44    #[serde(rename = "url")]
45    pub url: String,
46    /// A template for the API URL to download the repository as an archive.
47    #[serde(rename = "archive_url")]
48    pub archive_url: String,
49    /// A template for the API URL to list the available assignees for issues in the repository.
50    #[serde(rename = "assignees_url")]
51    pub assignees_url: String,
52    /// A template for the API URL to create or retrieve a raw Git blob in the repository.
53    #[serde(rename = "blobs_url")]
54    pub blobs_url: String,
55    /// A template for the API URL to get information about branches in the repository.
56    #[serde(rename = "branches_url")]
57    pub branches_url: String,
58    /// A template for the API URL to get information about collaborators of the repository.
59    #[serde(rename = "collaborators_url")]
60    pub collaborators_url: String,
61    /// A template for the API URL to get information about comments on the repository.
62    #[serde(rename = "comments_url")]
63    pub comments_url: String,
64    /// A template for the API URL to get information about commits on the repository.
65    #[serde(rename = "commits_url")]
66    pub commits_url: String,
67    /// A template for the API URL to compare two commits or refs.
68    #[serde(rename = "compare_url")]
69    pub compare_url: String,
70    /// A template for the API URL to get the contents of the repository.
71    #[serde(rename = "contents_url")]
72    pub contents_url: String,
73    /// A template for the API URL to list the contributors to the repository.
74    #[serde(rename = "contributors_url")]
75    pub contributors_url: String,
76    /// The API URL to list the deployments of the repository.
77    #[serde(rename = "deployments_url")]
78    pub deployments_url: String,
79    /// The API URL to list the downloads on the repository.
80    #[serde(rename = "downloads_url")]
81    pub downloads_url: String,
82    /// The API URL to list the events of the repository.
83    #[serde(rename = "events_url")]
84    pub events_url: String,
85    /// The API URL to list the forks of the repository.
86    #[serde(rename = "forks_url")]
87    pub forks_url: String,
88    /// A template for the API URL to get information about Git commits of the repository.
89    #[serde(rename = "git_commits_url")]
90    pub git_commits_url: String,
91    /// A template for the API URL to get information about Git refs of the repository.
92    #[serde(rename = "git_refs_url")]
93    pub git_refs_url: String,
94    /// A template for the API URL to get information about Git tags of the repository.
95    #[serde(rename = "git_tags_url")]
96    pub git_tags_url: String,
97    /// A template for the API URL to get information about issue comments on the repository.
98    #[serde(rename = "issue_comment_url")]
99    pub issue_comment_url: String,
100    /// A template for the API URL to get information about issue events on the repository.
101    #[serde(rename = "issue_events_url")]
102    pub issue_events_url: String,
103    /// A template for the API URL to get information about issues on the repository.
104    #[serde(rename = "issues_url")]
105    pub issues_url: String,
106    /// A template for the API URL to get information about deploy keys on the repository.
107    #[serde(rename = "keys_url")]
108    pub keys_url: String,
109    /// A template for the API URL to get information about labels of the repository.
110    #[serde(rename = "labels_url")]
111    pub labels_url: String,
112    /// The API URL to get information about the languages of the repository.
113    #[serde(rename = "languages_url")]
114    pub languages_url: String,
115    /// The API URL to merge branches in the repository.
116    #[serde(rename = "merges_url")]
117    pub merges_url: String,
118    /// A template for the API URL to get information about milestones of the repository.
119    #[serde(rename = "milestones_url")]
120    pub milestones_url: String,
121    /// A template for the API URL to get information about notifications on the repository.
122    #[serde(rename = "notifications_url")]
123    pub notifications_url: String,
124    /// A template for the API URL to get information about pull requests on the repository.
125    #[serde(rename = "pulls_url")]
126    pub pulls_url: String,
127    /// A template for the API URL to get information about releases on the repository.
128    #[serde(rename = "releases_url")]
129    pub releases_url: String,
130    /// The API URL to list the stargazers on the repository.
131    #[serde(rename = "stargazers_url")]
132    pub stargazers_url: String,
133    /// A template for the API URL to get information about statuses of a commit.
134    #[serde(rename = "statuses_url")]
135    pub statuses_url: String,
136    /// The API URL to list the subscribers on the repository.
137    #[serde(rename = "subscribers_url")]
138    pub subscribers_url: String,
139    /// The API URL to subscribe to notifications for this repository.
140    #[serde(rename = "subscription_url")]
141    pub subscription_url: String,
142    /// The API URL to get information about tags on the repository.
143    #[serde(rename = "tags_url")]
144    pub tags_url: String,
145    /// The API URL to list the teams on the repository.
146    #[serde(rename = "teams_url")]
147    pub teams_url: String,
148    /// A template for the API URL to create or retrieve a raw Git tree of the repository.
149    #[serde(rename = "trees_url")]
150    pub trees_url: String,
151    /// The API URL to list the hooks on the repository.
152    #[serde(rename = "hooks_url")]
153    pub hooks_url: String,
154}
155
156impl SimpleRepository {
157    /// A GitHub repository.
158    pub fn new(id: i32, node_id: String, name: String, full_name: String, owner: models::SimpleUser, private: bool, html_url: String, description: Option<String>, fork: bool, url: String, archive_url: String, assignees_url: String, blobs_url: String, branches_url: String, collaborators_url: String, comments_url: String, commits_url: String, compare_url: String, contents_url: String, contributors_url: String, deployments_url: String, downloads_url: String, events_url: String, forks_url: String, git_commits_url: String, git_refs_url: String, git_tags_url: String, issue_comment_url: String, issue_events_url: String, issues_url: String, keys_url: String, labels_url: String, languages_url: String, merges_url: String, milestones_url: String, notifications_url: String, pulls_url: String, releases_url: String, stargazers_url: String, statuses_url: String, subscribers_url: String, subscription_url: String, tags_url: String, teams_url: String, trees_url: String, hooks_url: String) -> SimpleRepository {
159        SimpleRepository {
160            id,
161            node_id,
162            name,
163            full_name,
164            owner: Box::new(owner),
165            private,
166            html_url,
167            description,
168            fork,
169            url,
170            archive_url,
171            assignees_url,
172            blobs_url,
173            branches_url,
174            collaborators_url,
175            comments_url,
176            commits_url,
177            compare_url,
178            contents_url,
179            contributors_url,
180            deployments_url,
181            downloads_url,
182            events_url,
183            forks_url,
184            git_commits_url,
185            git_refs_url,
186            git_tags_url,
187            issue_comment_url,
188            issue_events_url,
189            issues_url,
190            keys_url,
191            labels_url,
192            languages_url,
193            merges_url,
194            milestones_url,
195            notifications_url,
196            pulls_url,
197            releases_url,
198            stargazers_url,
199            statuses_url,
200            subscribers_url,
201            subscription_url,
202            tags_url,
203            teams_url,
204            trees_url,
205            hooks_url,
206        }
207    }
208}
209