openlark_platform/app_engine/apaas/v1/application/
mod.rs1pub mod audit_log;
4pub mod environment_variable;
5pub mod flow;
6pub mod function;
7pub mod object;
8pub mod record_permission;
9pub mod role;
10
11use crate::PlatformConfig;
12use std::sync::Arc;
13
14#[derive(Debug, Clone)]
16pub struct ApplicationService {
17 config: Arc<PlatformConfig>,
18 namespace: String,
19}
20
21impl ApplicationService {
22 pub fn new(config: Arc<PlatformConfig>, namespace: impl Into<String>) -> Self {
24 Self {
25 config,
26 namespace: namespace.into(),
27 }
28 }
29
30 pub fn object(&self, object_api_name: impl Into<String>) -> object::ObjectService {
32 object::ObjectService::new(self.config.clone(), self.namespace.clone(), object_api_name)
33 }
34
35 pub fn role(&self, role_api_name: impl Into<String>) -> role::RoleService {
37 role::RoleService::new(self.config.clone(), self.namespace.clone(), role_api_name)
38 }
39
40 pub fn record_permission(
42 &self,
43 record_permission_api_name: impl Into<String>,
44 ) -> record_permission::RecordPermissionService {
45 record_permission::RecordPermissionService::new(
46 self.config.clone(),
47 self.namespace.clone(),
48 record_permission_api_name,
49 )
50 }
51
52 pub fn environment_variable(&self) -> environment_variable::EnvironmentVariableService {
54 environment_variable::EnvironmentVariableService::new(
55 self.config.as_ref().clone(),
56 self.namespace.clone(),
57 )
58 }
59
60 pub fn function(&self, function_api_name: impl Into<String>) -> function::FunctionService {
62 function::FunctionService::new(
63 self.config.as_ref().clone(),
64 self.namespace.clone(),
65 function_api_name,
66 )
67 }
68
69 pub fn flow(&self, flow_id: impl Into<String>) -> flow::FlowService {
71 flow::FlowService::new(
72 self.config.as_ref().clone(),
73 self.namespace.clone(),
74 flow_id,
75 )
76 }
77
78 pub fn audit_log(&self) -> audit_log::AuditLogService {
80 audit_log::AuditLogService::new(self.config.as_ref().clone(), self.namespace.clone())
81 }
82}