DecisionRequest
Rust struct goodmem::models::DecisionRequest: declaration, fields or variants, and implementations.
Struct DecisionRequest
goodmem::models::DecisionRequest
Sends named questions and content to a registered decision model. The provider may charge for this request.
pub struct DecisionRequest {
pub state: Box<DecisionContent>,
pub attachments: Option<Vec<DecisionMedia>>,
pub questions: BTreeMap<String, DecisionQuestion>,
}Referenced types: DecisionContent, DecisionMedia, DecisionQuestion.
Fields
state
pub state: Box<DecisionContent>
Content evaluated by all questions.
Wire name: state.
attachments
pub attachments: Option<Vec<DecisionMedia>>
Media files included with the request. Their order is preserved within each media type.
Wire name: attachments.
questions
pub questions: BTreeMap<String, DecisionQuestion>
Questions keyed by names that you choose. The model must support each question type and its media.
Wire name: questions.
Implementations
validate
pub fn validate(&self) -> crate::Result<()>
Validate the request before sending, without making an HTTP call.
Trait implementations
Clone(derived)Default(derived)PartialEq(derived)Serialize(derived)impl<'de> Deserialize<'de> for DecisionRequestimpl std::fmt::Debug for DecisionRequest