AiutaAuthentication.fromJson constructor

AiutaAuthentication.fromJson(
  1. Map<String, dynamic> json
)

Factory method to create AiutaAuthentication from json.

Implementation

factory AiutaAuthentication.fromJson(Map<String, dynamic> json) {
  switch (json['mode'] as String) {
    case 'apiKey':
      return ApiKeyAuthentication.fromJson(json);
    case 'jwt':
      return JWTAuthentication.fromJson(json);
    default:
      throw Exception('Unknown authentication type');
  }
}