gitea_sdk/api/orgs/
list_repos.rsuse build_it::Builder;
use serde::Serialize;
use crate::{error::Result, model::repos::Repository, Client};
#[derive(Debug, Clone, Builder, Serialize)]
#[build_it(into)]
pub struct ListReposBuilder {
#[serde(skip)]
#[build_it(skip)]
org: String,
page: Option<i64>,
limit: Option<i64>,
}
impl ListReposBuilder {
pub fn new(org: impl ToString) -> Self {
Self {
org: org.to_string(),
page: None,
limit: None,
}
}
pub async fn send(&self, client: &Client) -> Result<Vec<Repository>> {
let req = client
.get(format!("/orgs/{}/repos", self.org))
.query(self)
.build()?;
let res = client.make_request(req).await?;
client.parse_response(res).await
}
}