ReplicationJob.fromJson constructor

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

Implementation

factory ReplicationJob.fromJson(Map<String, dynamic> json) {
  return ReplicationJob(
    description: json['description'] as String?,
    encrypted: json['encrypted'] as bool?,
    frequency: json['frequency'] as int?,
    kmsKeyId: json['kmsKeyId'] as String?,
    latestAmiId: json['latestAmiId'] as String?,
    licenseType: (json['licenseType'] as String?)?.toLicenseType(),
    nextReplicationRunStartTime:
        timeStampFromJson(json['nextReplicationRunStartTime']),
    numberOfRecentAmisToKeep: json['numberOfRecentAmisToKeep'] as int?,
    replicationJobId: json['replicationJobId'] as String?,
    replicationRunList: (json['replicationRunList'] as List?)
        ?.whereNotNull()
        .map((e) => ReplicationRun.fromJson(e as Map<String, dynamic>))
        .toList(),
    roleName: json['roleName'] as String?,
    runOnce: json['runOnce'] as bool?,
    seedReplicationTime: timeStampFromJson(json['seedReplicationTime']),
    serverId: json['serverId'] as String?,
    serverType: (json['serverType'] as String?)?.toServerType(),
    state: (json['state'] as String?)?.toReplicationJobState(),
    statusMessage: json['statusMessage'] as String?,
    vmServer: json['vmServer'] != null
        ? VmServer.fromJson(json['vmServer'] as Map<String, dynamic>)
        : null,
  );
}