use build_it::Builder;
use serde::Serialize;
use teatime_macros::QueryParams;
use crate::error::Result;
use crate::model::repos::Repository;
#[derive(Debug, Clone, Serialize, Builder, QueryParams)]
pub struct ListReposBuilder {
page: Option<i64>,
limit: Option<i64>,
}
impl ListReposBuilder {
pub fn new() -> Self {
Self {
page: None,
limit: None,
}
}
pub async fn send(&self, client: &crate::Client) -> Result<Vec<Repository>> {
let req = client.get("user/repos").build()?;
let res = client.make_request(req).await?;
client.parse_response(res).await
}
}
impl Default for ListReposBuilder {
fn default() -> Self {
Self::new()
}
}