ContainerService.fromJson constructor

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

Implementation

factory ContainerService.fromJson(Map<String, dynamic> json) {
  return ContainerService(
    arn: json['arn'] as String?,
    containerServiceName: json['containerServiceName'] as String?,
    createdAt: timeStampFromJson(json['createdAt']),
    currentDeployment: json['currentDeployment'] != null
        ? ContainerServiceDeployment.fromJson(
            json['currentDeployment'] as Map<String, dynamic>)
        : null,
    isDisabled: json['isDisabled'] as bool?,
    location: json['location'] != null
        ? ResourceLocation.fromJson(json['location'] as Map<String, dynamic>)
        : null,
    nextDeployment: json['nextDeployment'] != null
        ? ContainerServiceDeployment.fromJson(
            json['nextDeployment'] as Map<String, dynamic>)
        : null,
    power: (json['power'] as String?)?.toContainerServicePowerName(),
    powerId: json['powerId'] as String?,
    principalArn: json['principalArn'] as String?,
    privateDomainName: json['privateDomainName'] as String?,
    publicDomainNames: (json['publicDomainNames'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
    resourceType: (json['resourceType'] as String?)?.toResourceType(),
    scale: json['scale'] as int?,
    state: (json['state'] as String?)?.toContainerServiceState(),
    tags: (json['tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
    url: json['url'] as String?,
  );
}