Certificate.fromJson constructor

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

Implementation

factory Certificate.fromJson(Map<String, dynamic> json) {
  return Certificate(
    arn: json['arn'] as String?,
    createdAt: timeStampFromJson(json['createdAt']),
    domainName: json['domainName'] as String?,
    domainValidationRecords: (json['domainValidationRecords'] as List?)
        ?.whereNotNull()
        .map(
            (e) => DomainValidationRecord.fromJson(e as Map<String, dynamic>))
        .toList(),
    eligibleToRenew: json['eligibleToRenew'] as String?,
    inUseResourceCount: json['inUseResourceCount'] as int?,
    issuedAt: timeStampFromJson(json['issuedAt']),
    issuerCA: json['issuerCA'] as String?,
    keyAlgorithm: json['keyAlgorithm'] as String?,
    name: json['name'] as String?,
    notAfter: timeStampFromJson(json['notAfter']),
    notBefore: timeStampFromJson(json['notBefore']),
    renewalSummary: json['renewalSummary'] != null
        ? RenewalSummary.fromJson(
            json['renewalSummary'] as Map<String, dynamic>)
        : null,
    requestFailureReason: json['requestFailureReason'] as String?,
    revocationReason: json['revocationReason'] as String?,
    revokedAt: timeStampFromJson(json['revokedAt']),
    serialNumber: json['serialNumber'] as String?,
    status: (json['status'] as String?)?.toCertificateStatus(),
    subjectAlternativeNames: (json['subjectAlternativeNames'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    supportCode: json['supportCode'] as String?,
    tags: (json['tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}