openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
/*
 * GitHub's official OpenAPI spec + Octokit extension
 *
 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
 *
 * The version of the OpenAPI document: 16.6.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// FullRepository : Full Repository
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FullRepository {
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "node_id")]
    pub node_id: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "full_name")]
    pub full_name: String,
    #[serde(rename = "owner")]
    pub owner: Box<models::SimpleUser>,
    #[serde(rename = "private")]
    pub private: bool,
    #[serde(rename = "html_url")]
    pub html_url: String,
    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
    pub description: Option<String>,
    #[serde(rename = "fork")]
    pub fork: bool,
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "archive_url")]
    pub archive_url: String,
    #[serde(rename = "assignees_url")]
    pub assignees_url: String,
    #[serde(rename = "blobs_url")]
    pub blobs_url: String,
    #[serde(rename = "branches_url")]
    pub branches_url: String,
    #[serde(rename = "collaborators_url")]
    pub collaborators_url: String,
    #[serde(rename = "comments_url")]
    pub comments_url: String,
    #[serde(rename = "commits_url")]
    pub commits_url: String,
    #[serde(rename = "compare_url")]
    pub compare_url: String,
    #[serde(rename = "contents_url")]
    pub contents_url: String,
    #[serde(rename = "contributors_url")]
    pub contributors_url: String,
    #[serde(rename = "deployments_url")]
    pub deployments_url: String,
    #[serde(rename = "downloads_url")]
    pub downloads_url: String,
    #[serde(rename = "events_url")]
    pub events_url: String,
    #[serde(rename = "forks_url")]
    pub forks_url: String,
    #[serde(rename = "git_commits_url")]
    pub git_commits_url: String,
    #[serde(rename = "git_refs_url")]
    pub git_refs_url: String,
    #[serde(rename = "git_tags_url")]
    pub git_tags_url: String,
    #[serde(rename = "git_url")]
    pub git_url: String,
    #[serde(rename = "issue_comment_url")]
    pub issue_comment_url: String,
    #[serde(rename = "issue_events_url")]
    pub issue_events_url: String,
    #[serde(rename = "issues_url")]
    pub issues_url: String,
    #[serde(rename = "keys_url")]
    pub keys_url: String,
    #[serde(rename = "labels_url")]
    pub labels_url: String,
    #[serde(rename = "languages_url")]
    pub languages_url: String,
    #[serde(rename = "merges_url")]
    pub merges_url: String,
    #[serde(rename = "milestones_url")]
    pub milestones_url: String,
    #[serde(rename = "notifications_url")]
    pub notifications_url: String,
    #[serde(rename = "pulls_url")]
    pub pulls_url: String,
    #[serde(rename = "releases_url")]
    pub releases_url: String,
    #[serde(rename = "ssh_url")]
    pub ssh_url: String,
    #[serde(rename = "stargazers_url")]
    pub stargazers_url: String,
    #[serde(rename = "statuses_url")]
    pub statuses_url: String,
    #[serde(rename = "subscribers_url")]
    pub subscribers_url: String,
    #[serde(rename = "subscription_url")]
    pub subscription_url: String,
    #[serde(rename = "tags_url")]
    pub tags_url: String,
    #[serde(rename = "teams_url")]
    pub teams_url: String,
    #[serde(rename = "trees_url")]
    pub trees_url: String,
    #[serde(rename = "clone_url")]
    pub clone_url: String,
    #[serde(rename = "mirror_url", deserialize_with = "Option::deserialize")]
    pub mirror_url: Option<String>,
    #[serde(rename = "hooks_url")]
    pub hooks_url: String,
    #[serde(rename = "svn_url")]
    pub svn_url: String,
    #[serde(rename = "homepage", deserialize_with = "Option::deserialize")]
    pub homepage: Option<String>,
    #[serde(rename = "language", deserialize_with = "Option::deserialize")]
    pub language: Option<String>,
    #[serde(rename = "forks_count")]
    pub forks_count: i32,
    #[serde(rename = "stargazers_count")]
    pub stargazers_count: i32,
    #[serde(rename = "watchers_count")]
    pub watchers_count: i32,
    /// The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.
    #[serde(rename = "size")]
    pub size: i32,
    #[serde(rename = "default_branch")]
    pub default_branch: String,
    #[serde(rename = "open_issues_count")]
    pub open_issues_count: i32,
    #[serde(rename = "is_template", skip_serializing_if = "Option::is_none")]
    pub is_template: Option<bool>,
    #[serde(rename = "topics", skip_serializing_if = "Option::is_none")]
    pub topics: Option<Vec<String>>,
    #[serde(rename = "has_issues")]
    pub has_issues: bool,
    #[serde(rename = "has_projects")]
    pub has_projects: bool,
    #[serde(rename = "has_wiki")]
    pub has_wiki: bool,
    #[serde(rename = "has_pages")]
    pub has_pages: bool,
    #[serde(rename = "has_downloads", skip_serializing_if = "Option::is_none")]
    pub has_downloads: Option<bool>,
    #[serde(rename = "has_discussions")]
    pub has_discussions: bool,
    #[serde(rename = "archived")]
    pub archived: bool,
    /// Returns whether or not this repository disabled.
    #[serde(rename = "disabled")]
    pub disabled: bool,
    /// The repository visibility: public, private, or internal.
    #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
    pub visibility: Option<String>,
    #[serde(rename = "pushed_at")]
    pub pushed_at: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
    pub permissions: Option<Box<models::FullRepositoryPermissions>>,
    #[serde(rename = "allow_rebase_merge", skip_serializing_if = "Option::is_none")]
    pub allow_rebase_merge: Option<bool>,
    #[serde(rename = "template_repository", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub template_repository: Option<Option<Box<models::NullableRepository>>>,
    #[serde(rename = "temp_clone_token", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub temp_clone_token: Option<Option<String>>,
    #[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")]
    pub allow_squash_merge: Option<bool>,
    #[serde(rename = "allow_auto_merge", skip_serializing_if = "Option::is_none")]
    pub allow_auto_merge: Option<bool>,
    #[serde(rename = "delete_branch_on_merge", skip_serializing_if = "Option::is_none")]
    pub delete_branch_on_merge: Option<bool>,
    #[serde(rename = "allow_merge_commit", skip_serializing_if = "Option::is_none")]
    pub allow_merge_commit: Option<bool>,
    #[serde(rename = "allow_update_branch", skip_serializing_if = "Option::is_none")]
    pub allow_update_branch: Option<bool>,
    #[serde(rename = "use_squash_pr_title_as_default", skip_serializing_if = "Option::is_none")]
    pub use_squash_pr_title_as_default: Option<bool>,
    /// The default value for a squash merge commit title:  - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
    #[serde(rename = "squash_merge_commit_title", skip_serializing_if = "Option::is_none")]
    pub squash_merge_commit_title: Option<SquashMergeCommitTitle>,
    /// The default value for a squash merge commit message:  - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message.
    #[serde(rename = "squash_merge_commit_message", skip_serializing_if = "Option::is_none")]
    pub squash_merge_commit_message: Option<SquashMergeCommitMessage>,
    /// The default value for a merge commit title.    - `PR_TITLE` - default to the pull request's title.   - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
    #[serde(rename = "merge_commit_title", skip_serializing_if = "Option::is_none")]
    pub merge_commit_title: Option<MergeCommitTitle>,
    /// The default value for a merge commit message.  - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message.
    #[serde(rename = "merge_commit_message", skip_serializing_if = "Option::is_none")]
    pub merge_commit_message: Option<MergeCommitMessage>,
    #[serde(rename = "allow_forking", skip_serializing_if = "Option::is_none")]
    pub allow_forking: Option<bool>,
    #[serde(rename = "web_commit_signoff_required", skip_serializing_if = "Option::is_none")]
    pub web_commit_signoff_required: Option<bool>,
    #[serde(rename = "subscribers_count")]
    pub subscribers_count: i32,
    #[serde(rename = "network_count")]
    pub network_count: i32,
    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
    pub license: Option<Box<models::NullableLicenseSimple>>,
    #[serde(rename = "organization", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub organization: Option<Option<Box<models::NullableSimpleUser>>>,
    #[serde(rename = "parent", skip_serializing_if = "Option::is_none")]
    pub parent: Option<Box<models::Repository>>,
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<Box<models::Repository>>,
    #[serde(rename = "forks")]
    pub forks: i32,
    #[serde(rename = "master_branch", skip_serializing_if = "Option::is_none")]
    pub master_branch: Option<String>,
    #[serde(rename = "open_issues")]
    pub open_issues: i32,
    #[serde(rename = "watchers")]
    pub watchers: i32,
    /// Whether anonymous git access is allowed.
    #[serde(rename = "anonymous_access_enabled", skip_serializing_if = "Option::is_none")]
    pub anonymous_access_enabled: Option<bool>,
    #[serde(rename = "code_of_conduct", skip_serializing_if = "Option::is_none")]
    pub code_of_conduct: Option<Box<models::CodeOfConductSimple>>,
    #[serde(rename = "security_and_analysis", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub security_and_analysis: Option<Option<Box<models::SecurityAndAnalysis>>>,
    /// The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.
    #[serde(rename = "custom_properties", skip_serializing_if = "Option::is_none")]
    pub custom_properties: Option<std::collections::HashMap<String, serde_json::Value>>,
}

impl FullRepository {
    /// Full Repository
    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, git_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, ssh_url: String, stargazers_url: String, statuses_url: String, subscribers_url: String, subscription_url: String, tags_url: String, teams_url: String, trees_url: String, clone_url: String, mirror_url: Option<String>, hooks_url: String, svn_url: String, homepage: Option<String>, language: Option<String>, forks_count: i32, stargazers_count: i32, watchers_count: i32, size: i32, default_branch: String, open_issues_count: i32, has_issues: bool, has_projects: bool, has_wiki: bool, has_pages: bool, has_discussions: bool, archived: bool, disabled: bool, pushed_at: String, created_at: String, updated_at: String, subscribers_count: i32, network_count: i32, license: Option<models::NullableLicenseSimple>, forks: i32, open_issues: i32, watchers: i32) -> FullRepository {
        FullRepository {
            id,
            node_id,
            name,
            full_name,
            owner: Box::new(owner),
            private,
            html_url,
            description,
            fork,
            url,
            archive_url,
            assignees_url,
            blobs_url,
            branches_url,
            collaborators_url,
            comments_url,
            commits_url,
            compare_url,
            contents_url,
            contributors_url,
            deployments_url,
            downloads_url,
            events_url,
            forks_url,
            git_commits_url,
            git_refs_url,
            git_tags_url,
            git_url,
            issue_comment_url,
            issue_events_url,
            issues_url,
            keys_url,
            labels_url,
            languages_url,
            merges_url,
            milestones_url,
            notifications_url,
            pulls_url,
            releases_url,
            ssh_url,
            stargazers_url,
            statuses_url,
            subscribers_url,
            subscription_url,
            tags_url,
            teams_url,
            trees_url,
            clone_url,
            mirror_url,
            hooks_url,
            svn_url,
            homepage,
            language,
            forks_count,
            stargazers_count,
            watchers_count,
            size,
            default_branch,
            open_issues_count,
            is_template: None,
            topics: None,
            has_issues,
            has_projects,
            has_wiki,
            has_pages,
            has_downloads: None,
            has_discussions,
            archived,
            disabled,
            visibility: None,
            pushed_at,
            created_at,
            updated_at,
            permissions: None,
            allow_rebase_merge: None,
            template_repository: None,
            temp_clone_token: None,
            allow_squash_merge: None,
            allow_auto_merge: None,
            delete_branch_on_merge: None,
            allow_merge_commit: None,
            allow_update_branch: None,
            use_squash_pr_title_as_default: None,
            squash_merge_commit_title: None,
            squash_merge_commit_message: None,
            merge_commit_title: None,
            merge_commit_message: None,
            allow_forking: None,
            web_commit_signoff_required: None,
            subscribers_count,
            network_count,
            license: license.map(Box::new),
            organization: None,
            parent: None,
            source: None,
            forks,
            master_branch: None,
            open_issues,
            watchers,
            anonymous_access_enabled: None,
            code_of_conduct: None,
            security_and_analysis: None,
            custom_properties: None,
        }
    }
}
/// The default value for a squash merge commit title:  - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SquashMergeCommitTitle {
    #[serde(rename = "PR_TITLE")]
    PrTitle,
    #[serde(rename = "COMMIT_OR_PR_TITLE")]
    CommitOrPrTitle,
}

impl Default for SquashMergeCommitTitle {
    fn default() -> SquashMergeCommitTitle {
        Self::PrTitle
    }
}
/// The default value for a squash merge commit message:  - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SquashMergeCommitMessage {
    #[serde(rename = "PR_BODY")]
    PrBody,
    #[serde(rename = "COMMIT_MESSAGES")]
    CommitMessages,
    #[serde(rename = "BLANK")]
    Blank,
}

impl Default for SquashMergeCommitMessage {
    fn default() -> SquashMergeCommitMessage {
        Self::PrBody
    }
}
/// The default value for a merge commit title.    - `PR_TITLE` - default to the pull request's title.   - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MergeCommitTitle {
    #[serde(rename = "PR_TITLE")]
    PrTitle,
    #[serde(rename = "MERGE_MESSAGE")]
    MergeMessage,
}

impl Default for MergeCommitTitle {
    fn default() -> MergeCommitTitle {
        Self::PrTitle
    }
}
/// The default value for a merge commit message.  - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MergeCommitMessage {
    #[serde(rename = "PR_BODY")]
    PrBody,
    #[serde(rename = "PR_TITLE")]
    PrTitle,
    #[serde(rename = "BLANK")]
    Blank,
}

impl Default for MergeCommitMessage {
    fn default() -> MergeCommitMessage {
        Self::PrBody
    }
}