|
A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
|
The full typed interface of an action. More...
#include <cpp/a11/actions/schema.h>
Public Member Functions | |
| absl::Status | Validate () const |
| Validates the schema and all of its ports and headers. | |
| absl::Status | MapOutputToJson (std::string output_name, std::string field_name={}) |
| Maps an output port onto a JSON result field. | |
Public Attributes | |
| std::string | name |
| Action name. | |
| std::string | description |
| Human-readable description. | |
| absl::flat_hash_map< std::string, ActionPortSchema > | inputs |
| Input ports. | |
| absl::flat_hash_map< std::string, ActionPortSchema > | outputs |
| Output ports. | |
| absl::flat_hash_map< std::string, ActionHeaderSchema > | headers |
| Headers. | |
| absl::flat_hash_map< std::string, std::string > | output_to_json_field |
| Maps output port names to JSON result fields. | |
Static Public Attributes | |
| static constexpr std::string_view | kWholeJson = "$" |
| Whole-JSON target. | |
Friends | |
| bool | operator== (const ActionSchema &, const ActionSchema &)=default |
The full typed interface of an action.
Combines the action's name and description with its inputs, outputs and headers schemas. output_to_json_field optionally maps output ports onto fields of a single JSON result document (use kWholeJson to map an output to the whole document).
| absl::Status a11::actions::ActionSchema::MapOutputToJson | ( | std::string | output_name, |
| std::string | field_name = {} |
||
| ) |
Maps an output port onto a JSON result field.
| output_name | Output port to map. |
| field_name | Target field; empty maps to a field named like the port. |
| absl::Status a11::actions::ActionSchema::Validate | ( | ) | const |
Validates the schema and all of its ports and headers.
|
friend |
| std::string a11::actions::ActionSchema::description |
Human-readable description.
| absl::flat_hash_map<std::string, ActionHeaderSchema> a11::actions::ActionSchema::headers |
Headers.
| absl::flat_hash_map<std::string, ActionPortSchema> a11::actions::ActionSchema::inputs |
Input ports.
|
staticconstexpr |
Whole-JSON target.
| std::string a11::actions::ActionSchema::name |
Action name.
| absl::flat_hash_map<std::string, std::string> a11::actions::ActionSchema::output_to_json_field |
Maps output port names to JSON result fields.
| absl::flat_hash_map<std::string, ActionPortSchema> a11::actions::ActionSchema::outputs |
Output ports.