use serde::{Deserialize, Serialize}; use crate::{ error::UserError, model::{instance::Instance, repository::Repository, user::User}, }; use super::{GiteratedOperation, Object, ObjectBackend}; #[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, UserError> { self.request::(UserRepositoriesRequest { instance: instance.clone(), user: self.inner.clone(), }) } }