pub enum PolicyDecision {
Allow {
reason: DecisionReason,
},
Deny {
reason: DecisionReason,
},
Ask {
approval: ApprovalRequestSpec,
},
Modify {
modification: ToolRequestModification,
},
Defer {
resume_policy: ResumePolicy,
},
Interrupt {
reason: DecisionReason,
},
}Expand description
Enumerates the finite policy decision cases. Serialized names are part of the SDK contract; update fixtures when variants change.
Variants§
Allow
Use this variant when the contract needs to represent allow; selecting it has no side effect by itself.
Fields
reason: DecisionReasonRedacted explanation for a denial, failure, status, or package delta.
Deny
Use this variant when the contract needs to represent deny; selecting it has no side effect by itself.
Fields
reason: DecisionReasonRedacted explanation for a denial, failure, status, or package delta.
Ask
Use this variant when the contract needs to represent ask; selecting it has no side effect by itself.
Fields
approval: ApprovalRequestSpecApproval used by this record or request.
Modify
Use this variant when the contract needs to represent modify; selecting it has no side effect by itself.
Fields
modification: ToolRequestModificationModification used by this record or request.
Defer
Use this variant when the contract needs to represent defer; selecting it has no side effect by itself.
Fields
resume_policy: ResumePolicyResume policy used by this record or request.
Interrupt
Use this variant when the contract needs to represent interrupt; selecting it has no side effect by itself.
Fields
reason: DecisionReasonRedacted explanation for a denial, failure, status, or package delta.
Implementations§
Source§impl PolicyDecision
impl PolicyDecision
Sourcepub fn allow(code: impl Into<String>) -> Self
pub fn allow(code: impl Into<String>) -> Self
Builds the allow value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn deny(code: impl Into<String>) -> Self
pub fn deny(code: impl Into<String>) -> Self
Returns an updated domain::policy value with deny applied. This is data construction only and does not execute the configured behavior.
Trait Implementations§
Source§impl Clone for PolicyDecision
impl Clone for PolicyDecision
Source§fn clone(&self) -> PolicyDecision
fn clone(&self) -> PolicyDecision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolicyDecision
impl Debug for PolicyDecision
Source§impl Default for PolicyDecision
impl Default for PolicyDecision
Source§impl<'de> Deserialize<'de> for PolicyDecision
impl<'de> Deserialize<'de> for PolicyDecision
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>,
Source§impl PartialEq for PolicyDecision
impl PartialEq for PolicyDecision
Source§fn eq(&self, other: &PolicyDecision) -> bool
fn eq(&self, other: &PolicyDecision) -> bool
self and other values to be equal, and is used by ==.