use serde::{Deserialize, Serialize}; use crate::{ error::{OperationError, UserError}, instance::Instance, object::Object, object_backend::ObjectBackend, operation::{GiteratedOperation, OperationState}, repository::RepositorySummary, }; 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 + std::fmt::Debug, OS> Object { pub async fn repositories( &mut self, instance: &Instance, operation_state: &mut OS, ) -> Result, OperationError> { self.request::( UserRepositoriesRequest { instance: instance.clone(), user: self.inner.clone(), }, operation_state, ) .await } }