Skip to main content

EnvironmentsApi

Trait EnvironmentsApi 

Source
pub trait EnvironmentsApi {
    // Required methods
    fn branch_policies(
        &self,
        repository: &RepoRef,
        environment: &str,
    ) -> impl Future<Output = Result<Vec<BranchPolicy>, ForgeError>> + Send;
    fn create_branch_policy(
        &self,
        repository: &RepoRef,
        environment: &str,
        policy: &Policy,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn delete_branch_policy(
        &self,
        repository: &RepoRef,
        environment: &str,
        id: u64,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn delete_environment(
        &self,
        repository: &RepoRef,
        environment: &str,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn environments(
        &self,
        repository: &RepoRef,
    ) -> impl Future<Output = Result<Vec<Environment>, ForgeError>> + Send;
    fn put_environment(
        &self,
        repository: &RepoRef,
        environment: &str,
        settings: &EnvironmentBody,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
}
Expand description

The environments operations of the GitHub API.

Required Methods§

Source

fn branch_policies( &self, repository: &RepoRef, environment: &str, ) -> impl Future<Output = Result<Vec<BranchPolicy>, ForgeError>> + Send

Read the branch policies of environment.

Source

fn create_branch_policy( &self, repository: &RepoRef, environment: &str, policy: &Policy, ) -> impl Future<Output = Result<(), ForgeError>> + Send

Add a branch policy to environment.

Source

fn delete_branch_policy( &self, repository: &RepoRef, environment: &str, id: u64, ) -> impl Future<Output = Result<(), ForgeError>> + Send

Remove the branch policy id from environment.

Source

fn delete_environment( &self, repository: &RepoRef, environment: &str, ) -> impl Future<Output = Result<(), ForgeError>> + Send

Delete environment.

Source

fn environments( &self, repository: &RepoRef, ) -> impl Future<Output = Result<Vec<Environment>, ForgeError>> + Send

Read the repository’s environments, without their branch policies.

Source

fn put_environment( &self, repository: &RepoRef, environment: &str, settings: &EnvironmentBody, ) -> impl Future<Output = Result<(), ForgeError>> + Send

Create environment or replace its settings.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§