KeyFileConfig.fromJson constructor

KeyFileConfig.fromJson(
  1. Map json
)

Creates KeyFileConfig from json

Implementation

factory KeyFileConfig.fromJson(Map json){
  return $checkedCreate(
    'KeyFileConfig',
    json,
    ($checkedConvert) {
      final val = KeyFileConfig(
        generate: $checkedConvert('generate', (v) => v as bool? ?? false),
        publicKey: $checkedConvert('public_key', (v) => v as String?),
        privateKey: $checkedConvert('private_key', (v) => v as String?),
      );
      return val;
    },
    fieldKeyMap: const {
      'path': 'path',
    },
  );
}