pub struct ApprovalGate { /* private fields */ }Expand description
Manages approval gates for workflow steps
Implementations§
Source§impl ApprovalGate
impl ApprovalGate
Sourcepub fn request_approval(
&mut self,
step_id: String,
message: String,
timeout_ms: u64,
) -> WorkflowResult<String>
pub fn request_approval( &mut self, step_id: String, message: String, timeout_ms: u64, ) -> WorkflowResult<String>
Request approval for a step
Creates an approval request and returns the request ID. The request will timeout after the specified duration.
Sourcepub fn approve(
&mut self,
request_id: &str,
comments: Option<String>,
) -> WorkflowResult<()>
pub fn approve( &mut self, request_id: &str, comments: Option<String>, ) -> WorkflowResult<()>
Approve a pending request
Marks the approval request as approved. Returns error if the request is not found or already decided.
Sourcepub fn reject(
&mut self,
request_id: &str,
comments: Option<String>,
) -> WorkflowResult<()>
pub fn reject( &mut self, request_id: &str, comments: Option<String>, ) -> WorkflowResult<()>
Reject a pending request
Marks the approval request as rejected. Returns error if the request is not found or already decided.
Sourcepub fn get_request_status(
&self,
request_id: &str,
) -> WorkflowResult<ApprovalRequest>
pub fn get_request_status( &self, request_id: &str, ) -> WorkflowResult<ApprovalRequest>
Get the status of an approval request
Sourcepub fn is_approved(&self, request_id: &str) -> WorkflowResult<bool>
pub fn is_approved(&self, request_id: &str) -> WorkflowResult<bool>
Check if a step is approved
Returns true if the step has been approved, false if rejected or pending. Returns error if the request is not found or timed out.
Sourcepub fn is_rejected(&self, request_id: &str) -> WorkflowResult<bool>
pub fn is_rejected(&self, request_id: &str) -> WorkflowResult<bool>
Check if a step is rejected
Returns true if the step has been rejected, false if approved or pending. Returns error if the request is not found or timed out.
Sourcepub fn is_pending(&self, request_id: &str) -> WorkflowResult<bool>
pub fn is_pending(&self, request_id: &str) -> WorkflowResult<bool>
Check if a request is still pending
Sourcepub fn get_pending_requests(&self) -> Vec<ApprovalRequest>
pub fn get_pending_requests(&self) -> Vec<ApprovalRequest>
Get all pending requests
Sourcepub fn get_step_requests(&self, step_id: &str) -> Vec<ApprovalRequest>
pub fn get_step_requests(&self, step_id: &str) -> Vec<ApprovalRequest>
Get all requests for a specific step