mirror of
https://github.com/supleed2/nanobot.git
synced 2024-11-10 04:35:48 +00:00
Add eActivities module
This commit is contained in:
parent
e92ee416c8
commit
d62fabb048
22
src/ea.rs
Normal file
22
src/ea.rs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#[derive(serde::Deserialize)]
|
||||||
|
#[serde(rename_all = "PascalCase")]
|
||||||
|
pub struct EaMember {
|
||||||
|
pub first_name: String,
|
||||||
|
pub surname: String,
|
||||||
|
pub login: String,
|
||||||
|
pub order_no: usize,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) async fn get_members_list(
|
||||||
|
api_key: &str,
|
||||||
|
url: &str,
|
||||||
|
) -> Result<Vec<EaMember>, reqwest::Error> {
|
||||||
|
let members = reqwest::Client::new()
|
||||||
|
.get(url)
|
||||||
|
.header("X-API-Key", api_key)
|
||||||
|
.send()
|
||||||
|
.await?
|
||||||
|
.json::<Vec<EaMember>>()
|
||||||
|
.await?;
|
||||||
|
Ok(members)
|
||||||
|
}
|
Loading…
Reference in a new issue