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
use octocrate_core::*;
#[allow(unused_imports)]
use octocrate_types::*;
/// 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> {
let url = format!("/");
Request::<(), (), Root>::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<(), (), ApiOverview> {
let url = format!("/meta");
Request::<(), (), ApiOverview>::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<(), MetaGetOctocatQuery> {
let url = format!("/octocat");
NoContentRequest::<(), MetaGetOctocatQuery>::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<(), (), StringArray> {
let url = format!("/versions");
Request::<(), (), StringArray>::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<(), (), String> {
let url = format!("/zen");
Request::<(), (), String>::builder(&self.config)
.get(url)
.build()
}
}