execute<TResponse> method
Executes a Function with action
.
A FunctionsAction and FunctionsActionResponse must be prepared for each mode.
action
を持つFunctionを実行します。
各モードに応じたFunctionsActionとFunctionsActionResponseを用意する必要があります。
Implementation
@override
Future<TResponse> execute<TResponse>(FunctionsAction<TResponse> action) {
final stub = functions.firstWhereOrNull(
(stub) => stub.functionName == action.action,
);
if (stub == null) {
return action.execute((input) async => {});
}
return action.execute((input) async => stub.process(input ?? {}));
}