handleRuleEngineRequest method

Future handleRuleEngineRequest(
  1. String requestBody, {
  2. EntityId? entityId,
  3. int? timeout,
  4. RequestConfig? requestConfig,
})

Implementation

Future<dynamic> handleRuleEngineRequest(String requestBody,
    {EntityId? entityId, int? timeout, RequestConfig? requestConfig}) async {
  var url = '/api/rule-engine';
  if (entityId != null) {
    url += '/${entityId.entityType.toShortString()}/${entityId.id}';
    if (timeout != null) {
      url += '/$timeout';
    }
  }
  var response = await _tbClient.post<ResponseBody>(url,
      data: requestBody,
      options: defaultHttpOptionsFromConfig(requestConfig));
  return response.data;
}