Cluster.fromJson constructor

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

Implementation

factory Cluster.fromJson(Map<String, dynamic> json) {
  return Cluster(
    backupPolicy: (json['BackupPolicy'] as String?)?.toBackupPolicy(),
    backupRetentionPolicy: json['BackupRetentionPolicy'] != null
        ? BackupRetentionPolicy.fromJson(
            json['BackupRetentionPolicy'] as Map<String, dynamic>)
        : null,
    certificates: json['Certificates'] != null
        ? Certificates.fromJson(json['Certificates'] as Map<String, dynamic>)
        : null,
    clusterId: json['ClusterId'] as String?,
    createTimestamp: timeStampFromJson(json['CreateTimestamp']),
    hsmType: json['HsmType'] as String?,
    hsms: (json['Hsms'] as List?)
        ?.whereNotNull()
        .map((e) => Hsm.fromJson(e as Map<String, dynamic>))
        .toList(),
    preCoPassword: json['PreCoPassword'] as String?,
    securityGroup: json['SecurityGroup'] as String?,
    sourceBackupId: json['SourceBackupId'] as String?,
    state: (json['State'] as String?)?.toClusterState(),
    stateMessage: json['StateMessage'] as String?,
    subnetMapping: (json['SubnetMapping'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    tagList: (json['TagList'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
    vpcId: json['VpcId'] as String?,
  );
}