provideActionArgsByRequest method

Future<ProvideActionArgsResponse> provideActionArgsByRequest (ProvideActionArgsRequest request, { SpongeRequestContext context })

Sends the actionArgs request to the server. Fetches the provided action arguments from the server.

Implementation

Future<ProvideActionArgsResponse> provideActionArgsByRequest(
    ProvideActionArgsRequest request,
    {SpongeRequestContext context}) async {
  ActionMeta actionMeta = await getActionMeta(request.name);
  _setupActionExecutionRequest(actionMeta, request);

  request.current =
      await _marshalProvideActionArgsCurrent(actionMeta, request.current);

  ProvideActionArgsResponse response = await execute(
      SpongeClientConstants.OPERATION_ACTION_ARGS,
      request,
      (json) => ProvideActionArgsResponse.fromJson(json),
      context);

  if (actionMeta != null) {
    await unmarshalProvidedActionArgValues(actionMeta, response.provided);
  }

  return response;
}