LightsailDistribution.fromJson constructor

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

Implementation

factory LightsailDistribution.fromJson(Map<String, dynamic> json) {
  return LightsailDistribution(
    ableToUpdateBundle: json['ableToUpdateBundle'] as bool?,
    alternativeDomainNames: (json['alternativeDomainNames'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    arn: json['arn'] as String?,
    bundleId: json['bundleId'] as String?,
    cacheBehaviorSettings: json['cacheBehaviorSettings'] != null
        ? CacheSettings.fromJson(
            json['cacheBehaviorSettings'] as Map<String, dynamic>)
        : null,
    cacheBehaviors: (json['cacheBehaviors'] as List?)
        ?.whereNotNull()
        .map((e) => CacheBehaviorPerPath.fromJson(e as Map<String, dynamic>))
        .toList(),
    certificateName: json['certificateName'] as String?,
    createdAt: timeStampFromJson(json['createdAt']),
    defaultCacheBehavior: json['defaultCacheBehavior'] != null
        ? CacheBehavior.fromJson(
            json['defaultCacheBehavior'] as Map<String, dynamic>)
        : null,
    domainName: json['domainName'] as String?,
    isEnabled: json['isEnabled'] as bool?,
    location: json['location'] != null
        ? ResourceLocation.fromJson(json['location'] as Map<String, dynamic>)
        : null,
    name: json['name'] as String?,
    origin: json['origin'] != null
        ? Origin.fromJson(json['origin'] as Map<String, dynamic>)
        : null,
    originPublicDNS: json['originPublicDNS'] as String?,
    resourceType: (json['resourceType'] as String?)?.toResourceType(),
    status: json['status'] as String?,
    supportCode: json['supportCode'] as String?,
    tags: (json['tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}