importApiKeys method
Import API keys from an external source, such as a CSV-formatted file.
May throw BadRequestException.
May throw ConflictException.
May throw LimitExceededException.
May throw NotFoundException.
May throw TooManyRequestsException.
May throw UnauthorizedException.
Parameter body :
The payload of the POST request to import API keys. For the payload
format, see API Key File Format.
Parameter format :
A query parameter to specify the input format to imported API keys.
Currently, only the csv format is supported.
Parameter failOnWarnings :
A query parameter to indicate whether to rollback ApiKey importation
(true) or not (false) when error is encountered.
Implementation
Future<ApiKeyIds> importApiKeys({
required Uint8List body,
required ApiKeysFormat format,
bool? failOnWarnings,
}) async {
final $query = <String, List<String>>{
'format': [format.value],
if (failOnWarnings != null) 'failonwarnings': [failOnWarnings.toString()],
};
final response = await _protocol.send(
payload: body,
method: 'POST',
requestUri: '/apikeys?mode=import',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ApiKeyIds.fromJson(response);
}