pub mod audit_log;
pub mod environment_variable;
pub mod flow;
pub mod function;
pub mod object;
pub mod record_permission;
pub mod role;
use crate::PlatformConfig;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct ApplicationService {
config: Arc<PlatformConfig>,
namespace: String,
}
impl ApplicationService {
pub fn new(config: Arc<PlatformConfig>, namespace: impl Into<String>) -> Self {
Self {
config,
namespace: namespace.into(),
}
}
pub fn object(&self, object_api_name: impl Into<String>) -> object::ObjectService {
object::ObjectService::new(self.config.clone(), self.namespace.clone(), object_api_name)
}
pub fn role(&self, role_api_name: impl Into<String>) -> role::RoleService {
role::RoleService::new(self.config.clone(), self.namespace.clone(), role_api_name)
}
pub fn record_permission(
&self,
record_permission_api_name: impl Into<String>,
) -> record_permission::RecordPermissionService {
record_permission::RecordPermissionService::new(
self.config.clone(),
self.namespace.clone(),
record_permission_api_name,
)
}
pub fn environment_variable(&self) -> environment_variable::EnvironmentVariableService {
environment_variable::EnvironmentVariableService::new(
self.config.as_ref().clone(),
self.namespace.clone(),
)
}
pub fn function(&self, function_api_name: impl Into<String>) -> function::FunctionService {
function::FunctionService::new(
self.config.as_ref().clone(),
self.namespace.clone(),
function_api_name,
)
}
pub fn flow(&self, flow_id: impl Into<String>) -> flow::FlowService {
flow::FlowService::new(
self.config.as_ref().clone(),
self.namespace.clone(),
flow_id,
)
}
pub fn audit_log(&self) -> audit_log::AuditLogService {
audit_log::AuditLogService::new(self.config.as_ref().clone(), self.namespace.clone())
}
}