generateAppAttestChallenge method

Initiates the App Attest flow by generating a challenge which will be used as a type of nonce for this attestation.

request - The metadata request object.

Request parameters:

app - Required. The full resource name to the iOS App. Format: "projects/{project_id}/apps/{app_id}" Value must have pattern ^projects/\[^/\]+/apps/\[^/\]+$.

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

Completes with a GoogleFirebaseAppcheckV1betaAppAttestChallengeResponse.

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<GoogleFirebaseAppcheckV1betaAppAttestChallengeResponse>
    generateAppAttestChallenge(
  GoogleFirebaseAppcheckV1betaGenerateAppAttestChallengeRequest request,
  core.String app, {
  core.String? $fields,
}) async {
  final _body = convert.json.encode(request.toJson());
  final _queryParams = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final _url =
      'v1beta/' + core.Uri.encodeFull('$app') + ':generateAppAttestChallenge';

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