License.fromJson constructor

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

Implementation

factory License.fromJson(Map<String, dynamic> json) {
  return License(
    beneficiary: json['Beneficiary'] as String?,
    consumptionConfiguration: json['ConsumptionConfiguration'] != null
        ? ConsumptionConfiguration.fromJson(
            json['ConsumptionConfiguration'] as Map<String, dynamic>)
        : null,
    createTime: json['CreateTime'] as String?,
    entitlements: (json['Entitlements'] as List?)
        ?.whereNotNull()
        .map((e) => Entitlement.fromJson(e as Map<String, dynamic>))
        .toList(),
    homeRegion: json['HomeRegion'] as String?,
    issuer: json['Issuer'] != null
        ? IssuerDetails.fromJson(json['Issuer'] as Map<String, dynamic>)
        : null,
    licenseArn: json['LicenseArn'] as String?,
    licenseMetadata: (json['LicenseMetadata'] as List?)
        ?.whereNotNull()
        .map((e) => Metadata.fromJson(e as Map<String, dynamic>))
        .toList(),
    licenseName: json['LicenseName'] as String?,
    productName: json['ProductName'] as String?,
    productSKU: json['ProductSKU'] as String?,
    status: (json['Status'] as String?)?.toLicenseStatus(),
    validity: json['Validity'] != null
        ? DatetimeRange.fromJson(json['Validity'] as Map<String, dynamic>)
        : null,
    version: json['Version'] as String?,
  );
}