lookupKey method

Future<V2LookupKeyResponse> lookupKey({
  1. String? keyString,
  2. String? $fields,
})

Find the parent project and resource name of the API key that matches the key string in the request.

If the API key has been purged, resource name will not be set. The service account must have the apikeys.keys.lookup permission on the parent project.

Request parameters:

keyString - Required. Finds the project that owns the key string value.

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

Completes with a V2LookupKeyResponse.

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<V2LookupKeyResponse> lookupKey({
  core.String? keyString,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (keyString != null) 'keyString': [keyString],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v2/keys:lookupKey';

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