Skip to main content

HttpCallConfig

Struct HttpCallConfig 

Source
pub struct HttpCallConfig {
    pub connector: String,
    pub method: HttpMethod,
    pub path: Option<String>,
    pub path_logic: Option<Template>,
    pub headers: HashMap<String, String>,
    pub body: Option<Value>,
    pub body_logic: Option<Template>,
    pub response_path: Option<String>,
    pub timeout_ms: u64,
}
Expand description

Configuration for the http_call integration function.

The actual HTTP implementation is provided by the service layer via AsyncFunctionHandler. This struct provides typed config validation and pre-compilation of JSONLogic expressions.

Unknown keys are rejected. A misspelled field previously parsed cleanly and was discarded, so an http_call task could make its request and silently throw the response away with no error at build time and none at dispatch.

Fields§

§connector: String

Named connector reference (resolved by service layer)

§method: HttpMethod

HTTP method

§path: Option<String>

Static path string

§path_logic: Option<Template>

JSONLogic expression to compute path dynamically. Compiled once at engine construction (LogicCompiler); read it through HttpCallConfig::resolve_path rather than directly — that method applies the static-path fallback and is the sanctioned read.

§headers: HashMap<String, String>

Static headers

§body: Option<Value>

Static request body

§body_logic: Option<Template>

JSONLogic expression to compute body dynamically. Compiled once at engine construction; read it through HttpCallConfig::resolve_body.

§response_path: Option<String>

JSONPath/dot-path to extract from response and merge into context.

output is accepted as an alias, so a service layer can present one destination-field name across its whole function catalogue. Supplying both keys is a duplicate field error rather than a precedence rule.

§timeout_ms: u64

Request timeout in milliseconds (default: 30000)

Implementations§

Source§

impl HttpCallConfig

Source

pub fn resolve_path(&self, ctx: &TaskContext<'_>) -> Result<Option<String>>

Resolve the request path: path_logic evaluated against the message context when compiled, otherwise the static path. Ok(None) when neither is set.

§Errors

As [resolve_string_field] — an evaluation failure propagates rather than falling back to the static path.

Source

pub fn resolve_body(&self, ctx: &TaskContext<'_>) -> Result<Option<Value>>

Resolve the request body: body_logic when compiled, otherwise the static body. Ok(None) when neither is set.

§Errors

As Self::resolve_path — an evaluation failure propagates rather than falling back.

Trait Implementations§

Source§

impl Clone for HttpCallConfig

Source§

fn clone(&self) -> HttpCallConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HttpCallConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for HttpCallConfig

Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.