Skip to main content

ephemeris_forge_github/api/operations/
actions.rs

1use ephemeris_forge::RepoRef;
2
3use crate::api::error::ForgeError;
4use crate::api::model::actions::routes::ActionsGroup;
5use crate::config::actions::Cache;
6
7/// The actions operations of the GitHub API.
8pub trait ActionsApi {
9    /// Read the cache limits, or `None` when GitHub reports the endpoint
10    /// unavailable.
11    fn actions_cache(
12        &self,
13        repository: &RepoRef,
14    ) -> impl Future<Output = Result<Option<Cache>, ForgeError>> + Send;
15
16    /// Read one settings group, or `None` when GitHub reports the endpoint
17    /// unavailable.
18    fn actions_group<G: ActionsGroup>(
19        &self,
20        repository: &RepoRef,
21    ) -> impl Future<Output = Result<Option<G>, ForgeError>> + Send;
22
23    /// Replace the cache limits.
24    fn set_actions_cache(
25        &self,
26        repository: &RepoRef,
27        group: &Cache,
28    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
29
30    /// Replace one settings group.
31    fn set_actions_group<G: ActionsGroup>(
32        &self,
33        repository: &RepoRef,
34        group: &G,
35    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
36}