Skip to main content

ephemeris_forge_github/api/operations/
labels.rs

1use ephemeris_forge::{LabelColor, RepoRef};
2
3use crate::api::error::ForgeError;
4use crate::api::model::Label;
5
6/// The labels operations of the GitHub API.
7pub trait LabelsApi {
8    /// Create the label `name`.
9    fn create_label(
10        &self,
11        repository: &RepoRef,
12        name: &str,
13        color: &LabelColor,
14        description: &str,
15    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
16
17    /// Delete the label `name`.
18    fn delete_label(
19        &self,
20        repository: &RepoRef,
21        name: &str,
22    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
23
24    /// Read every label of the repository.
25    fn labels(
26        &self,
27        repository: &RepoRef,
28    ) -> impl Future<Output = Result<Vec<Label>, ForgeError>> + Send;
29
30    /// Set the color and description of the label `name`.
31    fn update_label(
32        &self,
33        repository: &RepoRef,
34        name: &str,
35        color: &LabelColor,
36        description: &str,
37    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
38}