Skip to main content

ephemeris_forge_forgejo/api/operations/
actions_variables.rs

1use ephemeris_forge::RepoRef;
2
3use crate::api::error::ForgeError;
4use crate::api::model::ActionVariable;
5use crate::api::request::{CreateVariableOption, UpdateVariableOption};
6
7/// The Actions variable operations of the Forgejo API.
8pub trait ActionsVariablesApi {
9    /// `GET /repos/{owner}/{repo}/actions/variables`, every page.
10    fn actions_variables(
11        &self,
12        repo: &RepoRef,
13    ) -> impl Future<Output = Result<Vec<ActionVariable>, ForgeError>> + Send;
14
15    /// `POST /repos/{owner}/{repo}/actions/variables/{name}`.
16    fn create_actions_variable(
17        &self,
18        repo: &RepoRef,
19        name: &str,
20        body: &CreateVariableOption,
21    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
22
23    /// `DELETE /repos/{owner}/{repo}/actions/variables/{name}`.
24    fn delete_actions_variable(
25        &self,
26        repo: &RepoRef,
27        name: &str,
28    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
29
30    /// `PUT /repos/{owner}/{repo}/actions/variables/{name}`.
31    fn update_actions_variable(
32        &self,
33        repo: &RepoRef,
34        name: &str,
35        body: &UpdateVariableOption,
36    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
37}