mintAppCheckToken method

Mints a new App Check token for the specified Firebase App.

This method is intended to be called from a privileged environment where the caller can be authorized via Cloud IAM; for example, using a service account. To call this method, the caller must have the [firebaseappcheck.googleapis.com/tokens.mint](https://firebase.google.com/docs/projects/iam/permissions#app-check) permission. Returns a MintAppCheckTokenResponse.

request - The metadata request object.

Request parameters:

app - Required. The relative resource name of the app, in the format: projects/{project_number}/apps/{app_id} If necessary, the project_number element can be replaced with the project ID of the Firebase project. Learn more about using project identifiers in Google's AIP 2510 standard. Value must have pattern ^projects/\[^/\]+/apps/\[^/\]+$.

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

Completes with a GoogleFirebaseAppcheckV1MintAppCheckTokenResponse.

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<GoogleFirebaseAppcheckV1MintAppCheckTokenResponse>
mintAppCheckToken(
  GoogleFirebaseAppcheckV1MintAppCheckTokenRequest request,
  core.String app, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$app') + ':mintAppCheckToken';

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