increment method

Future<AchievementIncrementResponse> increment(
  1. String achievementId,
  2. int stepsToIncrement, {
  3. String? requestId,
  4. String? $fields,
})

Increments the steps of the achievement with the given ID for the currently authenticated player.

Request parameters:

achievementId - The ID of the achievement used by this method.

stepsToIncrement - Required. The number of steps to increment.

requestId - A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.

$fields - Selector specifying which fields to include in a partial response.

Completes with a AchievementIncrementResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<AchievementIncrementResponse> increment(
  core.String achievementId,
  core.int stepsToIncrement, {
  core.String? requestId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'stepsToIncrement': ['${stepsToIncrement}'],
    if (requestId != null) 'requestId': [requestId],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'games/v1/achievements/' +
      commons.escapeVariable('$achievementId') +
      '/increment';

  final response_ = await _requester.request(
    url_,
    'POST',
    queryParams: queryParams_,
  );
  return AchievementIncrementResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}