ephemeris_forge_forgejo/api/operations/
branch_rules.rs1use ephemeris_forge::RepoRef;
2
3use crate::api::error::ForgeError;
4use crate::api::model::BranchProtection;
5use crate::api::request::{CreateBranchProtectionOption, EditBranchProtectionOption};
6
7pub trait BranchRulesApi {
9 fn branch_protection(
13 &self,
14 repo: &RepoRef,
15 rule: &str,
16 ) -> impl Future<Output = Result<Option<BranchProtection>, ForgeError>> + Send;
17
18 fn branch_protections(
20 &self,
21 repo: &RepoRef,
22 ) -> impl Future<Output = Result<Vec<BranchProtection>, ForgeError>> + Send;
23
24 fn create_branch_protection(
26 &self,
27 repo: &RepoRef,
28 body: &CreateBranchProtectionOption,
29 ) -> impl Future<Output = Result<(), ForgeError>> + Send;
30
31 fn delete_branch_protection(
33 &self,
34 repo: &RepoRef,
35 rule: &str,
36 ) -> impl Future<Output = Result<(), ForgeError>> + Send;
37
38 fn patch_branch_protection(
40 &self,
41 repo: &RepoRef,
42 rule: &str,
43 body: &EditBranchProtectionOption,
44 ) -> impl Future<Output = Result<(), ForgeError>> + Send;
45}