pub struct Action {
pub target: String,
pub verb: Verb,
pub resource: Resource,
pub fields: Value,
}Expand description
One normalized operation, the sole input to the policy engine.
Fields§
§target: StringThe configured service instance this targets (e.g. "github", "eks-prod") — the
verb: Verb§resource: Resource§fields: ValueSelected request attributes (merged query + JSON body) for conditional rules,
Implementations§
Source§impl Action
impl Action
Sourcepub fn of(target: impl Into<String>, verb: Verb, resource: Resource) -> Self
pub fn of(target: impl Into<String>, verb: Verb, resource: Resource) -> Self
Ergonomic constructor with an empty fields object (the generated new requires
every field, including fields, positionally). target is the service instance
name.
Sourcepub fn with_fields(self, fields: Value) -> Self
pub fn with_fields(self, fields: Value) -> Self
Set the request fields (merged query + body) used by conditional rules.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
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
Source§impl JsonSchema for Action
impl JsonSchema for Action
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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