KeyMetadata.fromJson constructor

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

Implementation

factory KeyMetadata.fromJson(Map<String, dynamic> json) {
  return KeyMetadata(
    keyId: json['KeyId'] as String,
    awsAccountId: json['AWSAccountId'] as String?,
    arn: json['Arn'] as String?,
    cloudHsmClusterId: json['CloudHsmClusterId'] as String?,
    creationDate: timeStampFromJson(json['CreationDate']),
    customKeyStoreId: json['CustomKeyStoreId'] as String?,
    customerMasterKeySpec:
        (json['CustomerMasterKeySpec'] as String?)?.toCustomerMasterKeySpec(),
    deletionDate: timeStampFromJson(json['DeletionDate']),
    description: json['Description'] as String?,
    enabled: json['Enabled'] as bool?,
    encryptionAlgorithms: (json['EncryptionAlgorithms'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toEncryptionAlgorithmSpec())
        .toList(),
    expirationModel:
        (json['ExpirationModel'] as String?)?.toExpirationModelType(),
    keyManager: (json['KeyManager'] as String?)?.toKeyManagerType(),
    keyState: (json['KeyState'] as String?)?.toKeyState(),
    keyUsage: (json['KeyUsage'] as String?)?.toKeyUsageType(),
    origin: (json['Origin'] as String?)?.toOriginType(),
    signingAlgorithms: (json['SigningAlgorithms'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toSigningAlgorithmSpec())
        .toList(),
    validTo: timeStampFromJson(json['ValidTo']),
  );
}