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
use octocrate_core::*;
#[allow(unused_imports)]
use octocrate_types::*;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use typed_builder::TypedBuilder;
pub mod root {
#[allow(unused_imports)]
use super::*;
pub type Response = Root;
}
pub mod get {
#[allow(unused_imports)]
use super::*;
pub type Response = ApiOverview;
}
pub mod get_octocat {
#[allow(unused_imports)]
use super::*;
#[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
#[builder(field_defaults(setter(into)))]
pub struct Query {
/// The words to show in Octocat's speech bubble
#[serde(skip_serializing_if = "Option::is_none")]
#[builder(default, setter(strip_option))]
pub s: Option<String>,
}
}
pub mod get_all_versions {
#[allow(unused_imports)]
use super::*;
pub type Response = Vec<String>;
}
pub mod get_zen {
#[allow(unused_imports)]
use super::*;
pub type Response = String;
}
/// Endpoints that give information about the API.
pub struct GitHubMetaAPI {
config: SharedAPIConfig,
}
impl GitHubMetaAPI {
pub fn new(config: &SharedAPIConfig) -> Self {
Self {
config: config.clone(),
}
}
/// **GitHub API Root**
///
/// Get Hypermedia links to resources accessible in GitHub's REST API
///
/// *Documentation*: [https://docs.github.com/rest/meta/meta#github-api-root](https://docs.github.com/rest/meta/meta#github-api-root)
pub fn root(&self) -> Request<(), (), root::Response> {
let url = format!("/");
Request::<(), (), root::Response>::builder(&self.config)
.get(url)
.build()
}
/// **Get GitHub meta information**
///
/// Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://docs.github.com/articles/about-github-s-ip-addresses/)."
///
/// The API's response also includes a list of GitHub's domain names.
///
/// The values shown in the documentation's response are example values. You must always query the API directly to get the latest values.
///
/// **Note:** This endpoint returns both IPv4 and IPv6 addresses. However, not all features support IPv6. You should refer to the specific documentation for each feature to determine if IPv6 is supported.
///
/// *Documentation*: [https://docs.github.com/rest/meta/meta#get-apiname-meta-information](https://docs.github.com/rest/meta/meta#get-apiname-meta-information)
pub fn get(&self) -> Request<(), (), get::Response> {
let url = format!("/meta");
Request::<(), (), get::Response>::builder(&self.config)
.get(url)
.build()
}
/// **Get Octocat**
///
/// Get the octocat as ASCII art
///
/// *Documentation*: [https://docs.github.com/rest/meta/meta#get-octocat](https://docs.github.com/rest/meta/meta#get-octocat)
pub fn get_octocat(&self) -> NoContentRequest<(), get_octocat::Query> {
let url = format!("/octocat");
NoContentRequest::<(), get_octocat::Query>::builder(&self.config)
.get(url)
.build()
}
/// **Get all API versions**
///
/// Get all supported GitHub API versions.
///
/// *Documentation*: [https://docs.github.com/rest/meta/meta#get-all-api-versions](https://docs.github.com/rest/meta/meta#get-all-api-versions)
pub fn get_all_versions(&self) -> Request<(), (), get_all_versions::Response> {
let url = format!("/versions");
Request::<(), (), get_all_versions::Response>::builder(&self.config)
.get(url)
.build()
}
/// **Get the Zen of GitHub**
///
/// Get a random sentence from the Zen of GitHub
///
/// *Documentation*: [https://docs.github.com/rest/meta/meta#get-the-zen-of-github](https://docs.github.com/rest/meta/meta#get-the-zen-of-github)
pub fn get_zen(&self) -> Request<(), (), get_zen::Response> {
let url = format!("/zen");
Request::<(), (), get_zen::Response>::builder(&self.config)
.get(url)
.build()
}
}