1080-row Discovery-derived call table, validating Caller, typed facades, demo under /google/enterprise, Discovery checker, live read checks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
27 lines
1.3 KiB
C++
27 lines
1.3 KiB
C++
// Route: POST /google/enterprise/detect (Dialogflow ES and CX detectIntent)
|
|
#include "google/enterprise/cases.hpp"
|
|
|
|
using namespace molo::example::test;
|
|
|
|
int main() {
|
|
const std::string es = "{\"kind\":\"es\",\"session\":\"projects/p1/agent/sessions/s1\",\"text\":\"hello\"}";
|
|
check_enterprise_post_route("/google/enterprise/detect", es,
|
|
"{\"kind\":\"es\",\"session\":\"projects/p1/agent/sessions/s1\",\"text\":\"\"}",
|
|
"empty text");
|
|
check_enterprise_dry_run("/google/enterprise/detect", es,
|
|
"dialogflow.googleapis.com/v2/projects/p1/agent/sessions/s1:detectIntent");
|
|
check_enterprise_dry_run(
|
|
"/google/enterprise/detect",
|
|
"{\"kind\":\"cx\",\"session\":\"projects/p1/locations/europe-west1/agents/a1/sessions/s1\","
|
|
"\"text\":\"hi\",\"language\":\"nl\"}",
|
|
"europe-west1-dialogflow.googleapis.com/v3/projects/p1/locations/europe-west1/agents/a1/sessions/s1:detectIntent");
|
|
{
|
|
GoogleRig rig;
|
|
Fixture f(rig.client);
|
|
check(f.client->post("/google/enterprise/detect", "{\"kind\":\"x\",\"session\":\"s\",\"text\":\"t\"}",
|
|
"application/json").status == 422,
|
|
"unknown kind");
|
|
}
|
|
return finish("google/enterprise/detect");
|
|
}
|