getApiKey method
Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key, with the description replaced by <redacted>
.
Parameters:
key
API key.requestOptions
additional request configuration.
Implementation
Future<GetApiKeyResponse> getApiKey({
required String key,
RequestOptions? requestOptions,
}) async {
assert(
key.isNotEmpty,
'Parameter `key` is required when calling `getApiKey`.',
);
final request = ApiRequest(
method: RequestMethod.get,
path: r'/1/keys/{key}'
.replaceAll('{' r'key' '}', Uri.encodeComponent(key.toString())),
);
final response = await _retryStrategy.execute(
request: request,
options: requestOptions,
);
return deserialize<GetApiKeyResponse, GetApiKeyResponse>(
response,
'GetApiKeyResponse',
growable: true,
);
}