Skip to content
Clone
a06673b
67 lines 1.9 KB Rust
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<BranchProtectionPage> {
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<BranchProtectionView> {
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<BranchProtectionView> {
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<BranchProtectionView> {
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
}
}