rollback method

Future<RemoteConfig> rollback(
  1. RollbackRemoteConfigRequest request,
  2. String project, {
  3. String? $fields,
})

Roll back a project's published Remote Config template to the one specified by the provided version number.

A rollback is equivalent to getting a previously published Remote Config template, and re-publishing it using a force update. Returns the published RemoteConfig and the updated ETag as a response header if successful, or an error. See the publishing guide for a list of [error codes](/docs/remote-config/use-config-rest#step_5_publish_json_data_to_replace_data_in_the_service). In particular, note that the method returns an error with HTTP Status 404 if the requested version_number to rollback to is not found.

request - The metadata request object.

Request parameters:

project - Required. The Firebase project's Project ID or Project Number, prefixed with "projects/". Value must have pattern ^projects/\[^/\]+$.

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

Completes with a RemoteConfig.

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<RemoteConfig> rollback(
  RollbackRemoteConfigRequest request,
  core.String project, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' + core.Uri.encodeFull('$project') + '/remoteConfig:rollback';

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