Skip to main content

ephemeris_forge_github/api/operations/
variables.rs

1use ephemeris_forge::RepoRef;
2
3use crate::api::error::ForgeError;
4use crate::api::model::Variable;
5use crate::api::request::{VariableBody, VariableScope};
6
7/// The variables operations of the GitHub API.
8pub trait VariablesApi {
9    /// Create an Actions variable.
10    fn create_variable(
11        &self,
12        repository: &RepoRef,
13        scope: &VariableScope,
14        variable: &VariableBody,
15    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
16
17    /// Delete the Actions variable `name`.
18    fn delete_variable(
19        &self,
20        repository: &RepoRef,
21        scope: &VariableScope,
22        name: &str,
23    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
24
25    /// Change the value of an Actions variable.
26    fn update_variable(
27        &self,
28        repository: &RepoRef,
29        scope: &VariableScope,
30        variable: &VariableBody,
31    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
32
33    /// Read the Actions variables in `scope`.
34    fn variables(
35        &self,
36        repository: &RepoRef,
37        scope: &VariableScope,
38    ) -> impl Future<Output = Result<Vec<Variable>, ForgeError>> + Send;
39}