setStepsAtLeast method
Sets the steps for the currently authenticated player towards unlocking an achievement.
If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified.
Request parameters:
achievementId
- The ID of the achievement used by this method.
steps
- Required. The minimum value to set the steps to.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a AchievementSetStepsAtLeastResponse.
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<AchievementSetStepsAtLeastResponse> setStepsAtLeast(
core.String achievementId,
core.int steps, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'steps': ['${steps}'],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'games/v1/achievements/' +
commons.escapeVariable('$achievementId') +
'/setStepsAtLeast';
final response_ = await _requester.request(
url_,
'POST',
queryParams: queryParams_,
);
return AchievementSetStepsAtLeastResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}