pub struct ApprovalManager { /* private fields */ }Expand description
Approval manager for execution plans
Manages approval requests and decisions for execution plans. Wraps the ApprovalGate from workflows and provides plan-specific approval management.
Implementations§
Source§impl ApprovalManager
impl ApprovalManager
Sourcepub fn request_approval(
&mut self,
plan: &ExecutionPlan,
) -> ExecutionResult<String>
pub fn request_approval( &mut self, plan: &ExecutionPlan, ) -> ExecutionResult<String>
Request approval for a plan
Creates an approval request for the plan and returns the request ID. The request will timeout after 30 minutes (1800000 ms).
Sourcepub fn approve(
&mut self,
request_id: &str,
comments: Option<String>,
) -> ExecutionResult<()>
pub fn approve( &mut self, request_id: &str, comments: Option<String>, ) -> ExecutionResult<()>
Approve a plan
Marks the approval request as approved.
Sourcepub fn reject(
&mut self,
request_id: &str,
comments: Option<String>,
) -> ExecutionResult<()>
pub fn reject( &mut self, request_id: &str, comments: Option<String>, ) -> ExecutionResult<()>
Reject a plan
Marks the approval request as rejected.
Sourcepub fn is_approved(&self, request_id: &str) -> ExecutionResult<bool>
pub fn is_approved(&self, request_id: &str) -> ExecutionResult<bool>
Check if a plan is approved
Returns true if the plan has been approved, false if rejected or pending.
Sourcepub fn is_rejected(&self, request_id: &str) -> ExecutionResult<bool>
pub fn is_rejected(&self, request_id: &str) -> ExecutionResult<bool>
Check if a plan is rejected
Returns true if the plan has been rejected, false if approved or pending.
Sourcepub fn is_pending(&self, request_id: &str) -> ExecutionResult<bool>
pub fn is_pending(&self, request_id: &str) -> ExecutionResult<bool>
Check if a request is still pending
Sourcepub fn get_request(&self, request_id: &str) -> ExecutionResult<ApprovalRequest>
pub fn get_request(&self, request_id: &str) -> ExecutionResult<ApprovalRequest>
Get the approval request details
Sourcepub fn get_pending_requests(&self) -> Vec<ApprovalRequest>
pub fn get_pending_requests(&self) -> Vec<ApprovalRequest>
Get all pending approval requests
Sourcepub fn get_request_id(&self, plan_id: &str) -> Option<String>
pub fn get_request_id(&self, plan_id: &str) -> Option<String>
Get the approval request ID for a plan
Sourcepub fn approval_required(risk_level: RiskLevel) -> bool
pub fn approval_required(risk_level: RiskLevel) -> bool
Determine if approval is required based on risk level
Returns true if approval is required for the given risk level.
Sourcepub fn approval_strongly_recommended(risk_level: RiskLevel) -> bool
pub fn approval_strongly_recommended(risk_level: RiskLevel) -> bool
Determine if approval is strongly recommended based on risk level
Returns true if approval is strongly recommended (Critical risk).