pub struct ApprovalGrantedEvent {
pub run_id: Uuid,
pub step_id: Option<Uuid>,
pub approved_by: String,
pub approvals_received: u32,
pub approvals_required: u32,
pub requirement: Option<ApprovalRequirement>,
pub at: DateTime<Utc>,
}Expand description
Payload of the Event::ApprovalGranted event.
Published for every vote cast on a gate. A vote with
approvals_received < approvals_required is recorded but does not resolve
the gate: the run stays AwaitingApproval until enough distinct approvers
voted.
§Examples
use chrono::Utc;
use ironflow_engine::notify::ApprovalGrantedEvent;
use uuid::Uuid;
let payload = ApprovalGrantedEvent {
run_id: Uuid::now_v7(),
step_id: Some(Uuid::now_v7()),
approved_by: "alice".to_string(),
approvals_received: 1,
approvals_required: 2,
requirement: None,
at: Utc::now(),
};
assert!(payload.approvals_received < payload.approvals_required);Fields§
§run_id: UuidRun identifier.
step_id: Option<Uuid>Approval step identifier. None in events recorded before it existed.
approved_by: StringUser who approved (ID or username).
approvals_received: u32Distinct approvals recorded on the gate, this one included.
approvals_required: u32Distinct approvals needed to resolve the gate.
requirement: Option<ApprovalRequirement>Approvers the handler required, if any.
at: DateTime<Utc>When the approval was granted.
Trait Implementations§
Source§impl Clone for ApprovalGrantedEvent
impl Clone for ApprovalGrantedEvent
Source§impl Debug for ApprovalGrantedEvent
impl Debug for ApprovalGrantedEvent
Source§impl<'de> Deserialize<'de> for ApprovalGrantedEvent
impl<'de> Deserialize<'de> for ApprovalGrantedEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ApprovalGrantedEvent
impl RefUnwindSafe for ApprovalGrantedEvent
impl Send for ApprovalGrantedEvent
impl Sync for ApprovalGrantedEvent
impl Unpin for ApprovalGrantedEvent
impl UnsafeUnpin for ApprovalGrantedEvent
impl UnwindSafe for ApprovalGrantedEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more