PersistentResource.fromJson constructor

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

Implementation

factory PersistentResource.fromJson(Map<String, dynamic> json) {
  return PersistentResource(
    name: json['name'] ?? '',
    displayName: json['displayName'] ?? '',
    resourcePools:
        decodeListMessage(json['resourcePools'], ResourcePool.fromJson) ?? [],
    state:
        decodeEnum(json['state'], PersistentResource_State.fromJson) ??
        PersistentResource_State.$default,
    error: decode(json['error'], Status.fromJson),
    createTime: decodeCustom(json['createTime'], protobuf.Timestamp.fromJson),
    startTime: decodeCustom(json['startTime'], protobuf.Timestamp.fromJson),
    updateTime: decodeCustom(json['updateTime'], protobuf.Timestamp.fromJson),
    labels: decodeMap(json['labels']) ?? {},
    network: json['network'] ?? '',
    pscInterfaceConfig: decode(
      json['pscInterfaceConfig'],
      PscInterfaceConfig.fromJson,
    ),
    encryptionSpec: decode(json['encryptionSpec'], EncryptionSpec.fromJson),
    resourceRuntimeSpec: decode(
      json['resourceRuntimeSpec'],
      ResourceRuntimeSpec.fromJson,
    ),
    resourceRuntime: decode(
      json['resourceRuntime'],
      ResourceRuntime.fromJson,
    ),
    reservedIpRanges: decodeList(json['reservedIpRanges']) ?? [],
    satisfiesPzs: json['satisfiesPzs'] ?? false,
    satisfiesPzi: json['satisfiesPzi'] ?? false,
  );
}