addFirebase method

Future<Operation> addFirebase(
  1. AddFirebaseRequest request,
  2. String project, {
  3. String? $fields,
})

Adds Firebase resources to the specified existing [Google Cloud Platform (GCP) Project](https://cloud.google.com/resource-manager/reference/rest/v1/projects).

Since a FirebaseProject is actually also a GCP Project, a FirebaseProject has the same underlying GCP identifiers (projectNumber and projectId). This allows for easy interop with Google APIs. The result of this call is an [Operation](../../v1beta1/operations). Poll the Operation to track the provisioning process by calling GetOperation until [done](../../v1beta1/operations#Operation.FIELDS.done) is true. When done is true, the Operation has either succeeded or failed. If the Operation succeeded, its [response](../../v1beta1/operations#Operation.FIELDS.response) is set to a FirebaseProject; if the Operation failed, its [error](../../v1beta1/operations#Operation.FIELDS.error) is set to a google.rpc.Status. The Operation is automatically deleted after completion, so there is no need to call DeleteOperation. This method does not modify any billing account information on the underlying GCP Project. To call AddFirebase, a project member or service account must have the following permissions (the IAM roles of Editor and Owner contain these permissions): firebase.projects.update, resourcemanager.projects.get, serviceusage.services.enable, and serviceusage.services.get.

request - The metadata request object.

Request parameters:

project - The resource name of the GCP Project to which Firebase resources will be added, in the format: projects/PROJECT_IDENTIFIER Refer to the FirebaseProject [name](../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values. After calling AddFirebase, the unique Project identifiers ( [projectNumber](https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project.FIELDS.project_number) and [projectId](https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project.FIELDS.project_id)) of the underlying GCP Project are also the identifiers of the FirebaseProject. Value must have pattern ^projects/\[^/\]+$.

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

Completes with a Operation.

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<Operation> addFirebase(
  AddFirebaseRequest 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 = 'v1beta1/' + core.Uri.encodeFull('$project') + ':addFirebase';

  final _response = await _requester.request(
    _url,
    'POST',
    body: _body,
    queryParams: _queryParams,
  );
  return Operation.fromJson(_response as core.Map<core.String, core.dynamic>);
}