ServiceAccount.fromJson constructor

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

Load a service account from a JSON map.

The method may throw an AssertionError if the account contains empty strings.

Implementation

ServiceAccount.fromJson(Map<String, dynamic> json)
    : userId = json['userId'] as String,
      keyId = json['keyId'] as String,
      key = json['key'] as String {
  assert(userId != '');
  assert(keyId != '');
  assert(key != '');
}