use uuid::Uuid; use crate::error::RepoResult; use crate::features::RepoService; use super::types::{ BranchProtectionPage, BranchProtectionView, CreateBranchProtectionOption, EditBranchProtectionOption, ListBranchProtectionQuery, UpdateBranchProtectionPriorities, }; use super::usecase; impl RepoService { pub async fn list_branch_protections( &self, actor: Uuid, repo_id: Uuid, q: ListBranchProtectionQuery, ) -> RepoResult { usecase::list_branch_protections(self, actor, repo_id, q).await } pub async fn create_branch_protection( &self, actor: Uuid, repo_id: Uuid, input: CreateBranchProtectionOption, ) -> RepoResult { usecase::create_branch_protection(self, actor, repo_id, input).await } pub async fn get_branch_protection( &self, actor: Uuid, repo_id: Uuid, policy_id: Uuid, ) -> RepoResult { usecase::get_branch_protection(self, actor, repo_id, policy_id).await } pub async fn edit_branch_protection( &self, actor: Uuid, repo_id: Uuid, policy_id: Uuid, input: EditBranchProtectionOption, ) -> RepoResult { usecase::edit_branch_protection(self, actor, repo_id, policy_id, input).await } pub async fn delete_branch_protection( &self, actor: Uuid, repo_id: Uuid, policy_id: Uuid, ) -> RepoResult<()> { usecase::delete_branch_protection(self, actor, repo_id, policy_id).await } pub async fn update_branch_protection_priorities( &self, actor: Uuid, repo_id: Uuid, input: UpdateBranchProtectionPriorities, ) -> RepoResult<()> { usecase::update_branch_protection_priorities(self, actor, repo_id, input).await } }