pub struct ConditionContext {
pub request_body: Option<Value>,
pub response_body: Option<Value>,
pub request_xml: Option<String>,
pub response_xml: Option<String>,
pub headers: HashMap<String, String>,
pub query_params: HashMap<String, String>,
pub path: String,
pub method: String,
pub operation_id: Option<String>,
pub tags: Vec<String>,
}Expand description
Context for evaluating conditions
Fields§
§request_body: Option<Value>Request body (JSON)
response_body: Option<Value>Response body (JSON)
request_xml: Option<String>Request body as XML string
response_xml: Option<String>Response body as XML string
headers: HashMap<String, String>Request headers
query_params: HashMap<String, String>Query parameters
path: StringRequest path
method: StringHTTP method
operation_id: Option<String>Operation ID
Tags
Implementations§
Source§impl ConditionContext
impl ConditionContext
Sourcepub fn with_request_body(self, body: Value) -> Self
pub fn with_request_body(self, body: Value) -> Self
Set the request body as JSON
Sourcepub fn with_response_body(self, body: Value) -> Self
pub fn with_response_body(self, body: Value) -> Self
Set the response body as JSON
Sourcepub fn with_request_xml(self, xml: String) -> Self
pub fn with_request_xml(self, xml: String) -> Self
Set the request body as XML string
Sourcepub fn with_response_xml(self, xml: String) -> Self
pub fn with_response_xml(self, xml: String) -> Self
Set the response body as XML string
Sourcepub fn with_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_headers(self, headers: HashMap<String, String>) -> Self
Set the request headers
Sourcepub fn with_query_params(self, params: HashMap<String, String>) -> Self
pub fn with_query_params(self, params: HashMap<String, String>) -> Self
Set the query parameters
Sourcepub fn with_method(self, method: String) -> Self
pub fn with_method(self, method: String) -> Self
Set the HTTP method
Sourcepub fn with_operation_id(self, operation_id: String) -> Self
pub fn with_operation_id(self, operation_id: String) -> Self
Set the OpenAPI operation ID
Set the OpenAPI tags
Trait Implementations§
Source§impl Clone for ConditionContext
impl Clone for ConditionContext
Source§fn clone(&self) -> ConditionContext
fn clone(&self) -> ConditionContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConditionContext
impl Debug for ConditionContext
Auto Trait Implementations§
impl Freeze for ConditionContext
impl RefUnwindSafe for ConditionContext
impl Send for ConditionContext
impl Sync for ConditionContext
impl Unpin for ConditionContext
impl UnwindSafe for ConditionContext
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