use serde::{Deserialize, Serialize}; use crate::{ error::{OperationError, RepositoryError}, object::Object, object_backend::ObjectBackend, operation::GiteratedOperation, }; use super::{Issue, IssueInfo}; /// A request to get info about an issue. (graphql please) /// /// # Authentication /// - Instance Authentication /// - Validate request against the `issued_for` public key /// - Validate User token against the user's instance's public key /// # Authorization /// - User Authorization /// - Potential User permissions checks #[derive(Clone, Debug, Serialize, Deserialize)] pub struct IssueInfoRequest { pub id: u64, } impl GiteratedOperation for IssueInfoRequest { type Success = IssueInfo; type Failure = RepositoryError; } impl + std::fmt::Debug> Object<'_, S, Issue, B> { pub async fn info( &mut self, id: u64, operation_state: &S, ) -> Result> { self.request::(IssueInfoRequest { id }, operation_state) .await } }