use serde::{Deserialize, Serialize}; use crate::{ error::{OperationError, UserError}, instance::Instance, object::Object, object_backend::ObjectBackend, operation::GiteratedOperation, repository::Repository, }; use super::User; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct UserRepositoriesRequest { pub instance: Instance, pub user: User, } impl GiteratedOperation for UserRepositoriesRequest { type Success = Vec; type Failure = UserError; } impl Object<'_, User, B> { pub async fn repositories( &mut self, instance: &Instance, ) -> Result, OperationError> { self.request::(UserRepositoriesRequest { instance: instance.clone(), user: self.inner.clone(), }) .await } }