Skip to main content

yt/api/
users.rs

1use serde::Deserialize;
2
3use crate::api::{Client, Projection};
4use crate::error::Result;
5
6#[derive(Debug, Deserialize)]
7pub struct Me {
8    pub id: String,
9    pub login: String,
10    pub name: Option<String>,
11}
12
13impl Projection for Me {
14    const FIELDS: &'static str = "id,login,name";
15}
16
17pub async fn me(client: &Client) -> Result<Me> {
18    client.get("users/me", &[]).await
19}