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
use octocrate_core::*;
#[allow(unused_imports)]
use crate::types::*;
pub struct GitHubCodesOfConductAPI {
config: SharedAPIConfig,
}
impl GitHubCodesOfConductAPI {
pub fn new(config: &SharedAPIConfig) -> Self {
Self {
config: config.clone(),
}
}
/// **Get all codes of conduct**
///
/// Returns array of all GitHub's codes of conduct.
///
/// *Documentation*: [https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct](https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct)
pub fn get_all_codes_of_conduct(
&self,
) -> Request<(), (), CodeOfConductArray> {
let url = format!("/codes_of_conduct");
Request::<(), (), CodeOfConductArray>::builder(&self.config)
.get(url)
.build()
}
/// **Get a code of conduct**
///
/// Returns information about the specified GitHub code of conduct.
///
/// *Documentation*: [https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct](https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct)
pub fn get_conduct_code(
&self,
key: impl Into<String>,
) -> Request<(), (), CodeOfConduct> {
let key = key.into();
let url = format!("/codes_of_conduct/{key}");
Request::<(), (), CodeOfConduct>::builder(&self.config)
.get(url)
.build()
}
}