updateApiKey method
Updates an API key. You can update the key as long as it's not deleted.
May throw ApiKeyValidityOutOfBoundsException.
May throw BadRequestException.
May throw InternalFailureException.
May throw LimitExceededException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter apiId :
The ID for the GraphQL API.
Parameter id :
The API key ID.
Parameter description :
A description of the purpose of the API key.
Parameter expires :
From the update time, the time after which the API key expires. The date
is represented as seconds since the epoch. For more information, see .
Implementation
Future<UpdateApiKeyResponse> updateApiKey({
required String apiId,
required String id,
String? description,
int? expires,
}) async {
final $payload = <String, dynamic>{
if (description != null) 'description': description,
if (expires != null) 'expires': expires,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/v1/apis/${Uri.encodeComponent(apiId)}/apikeys/${Uri.encodeComponent(id)}',
exceptionFnMap: _exceptionFns,
);
return UpdateApiKeyResponse.fromJson(response);
}