LoadBalancer.fromJson constructor

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

Implementation

factory LoadBalancer.fromJson(Map<String, dynamic> json) {
  return LoadBalancer(
    arn: json['arn'] as String?,
    configurationOptions:
        (json['configurationOptions'] as Map<String, dynamic>?)?.map(
            (k, e) => MapEntry(k.toLoadBalancerAttributeName(), e as String)),
    createdAt: timeStampFromJson(json['createdAt']),
    dnsName: json['dnsName'] as String?,
    healthCheckPath: json['healthCheckPath'] as String?,
    instanceHealthSummary: (json['instanceHealthSummary'] as List?)
        ?.whereNotNull()
        .map((e) => InstanceHealthSummary.fromJson(e as Map<String, dynamic>))
        .toList(),
    instancePort: json['instancePort'] as int?,
    location: json['location'] != null
        ? ResourceLocation.fromJson(json['location'] as Map<String, dynamic>)
        : null,
    name: json['name'] as String?,
    protocol: (json['protocol'] as String?)?.toLoadBalancerProtocol(),
    publicPorts: (json['publicPorts'] as List?)
        ?.whereNotNull()
        .map((e) => e as int)
        .toList(),
    resourceType: (json['resourceType'] as String?)?.toResourceType(),
    state: (json['state'] as String?)?.toLoadBalancerState(),
    supportCode: json['supportCode'] as String?,
    tags: (json['tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
    tlsCertificateSummaries: (json['tlsCertificateSummaries'] as List?)
        ?.whereNotNull()
        .map((e) => LoadBalancerTlsCertificateSummary.fromJson(
            e as Map<String, dynamic>))
        .toList(),
  );
}