createApiKey method

Future<ApiKeyDto> createApiKey({
  1. required String sudoToken,
  2. String? name,
})

POST /apiKey

Implementation

Future<ApiKeyDto> createApiKey({
  required String sudoToken,
  String? name,
}) async {
  final data = name == null ? null : CreateApiKeyDto(name: name).toJson();
  final response = await manageDio.post(
    '/apiKey',
    data: data,
    options: _sudoOptions(sudoToken),
  );
  return ApiKeyDto.fromJson(response.data);
}