use std::path::Path;
use async_trait::async_trait;
use stackless_core::def::StackDef;
use stackless_core::substrate::StepResource;
use stackless_stripe_projects::stripe::{CommandRunner, StripeProjects};
pub mod config;
pub mod error;
pub mod hostable;
pub mod observation;
pub mod resource;
pub use config::{config_bool, config_optional_string, config_string};
pub use error::IntegrationError;
pub use hostable::{
BlockedSetting, ConfigScope, Hostable, IntegrationHosting, host_bound_hosts,
host_bound_supports,
};
pub use observation::{Drift, IntegrationObservation};
pub use resource::{CatalogResource, ResourcePayload};
#[async_trait]
pub trait ProviderOps: Send + Sync {
#[allow(clippy::too_many_arguments)]
async fn provision(
&self,
stripe: &StripeProjects<&dyn CommandRunner>,
def: &StackDef,
definition_dir: &Path,
instance: &str,
name: &str,
substrate: &str,
skip_stripe_instance_context: bool,
) -> Result<StepResource, IntegrationError>;
#[allow(clippy::too_many_arguments)]
async fn apply(
&self,
_stripe: &StripeProjects<&dyn CommandRunner>,
_def: &StackDef,
_name: &str,
_substrate: &str,
_provisioned: &StepResource,
) -> Result<(), IntegrationError> {
Ok(())
}
async fn observe(
&self,
stripe: &StripeProjects<&dyn CommandRunner>,
checkpoint_payload: &str,
fallback_resource: &str,
) -> Result<IntegrationObservation, IntegrationError>;
async fn destroy(
&self,
stripe: &StripeProjects<&dyn CommandRunner>,
checkpoint_payload: &str,
fallback_resource: &str,
) -> Result<(), IntegrationError>;
}