Bundle.fromJson constructor

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

Implementation

factory Bundle.fromJson(Map<String, dynamic> json) {
  return Bundle(
    bundleId: json['bundleId'] as String?,
    cpuCount: json['cpuCount'] as int?,
    diskSizeInGb: json['diskSizeInGb'] as int?,
    instanceType: json['instanceType'] as String?,
    isActive: json['isActive'] as bool?,
    name: json['name'] as String?,
    power: json['power'] as int?,
    price: json['price'] as double?,
    ramSizeInGb: json['ramSizeInGb'] as double?,
    supportedPlatforms: (json['supportedPlatforms'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toInstancePlatform())
        .toList(),
    transferPerMonthInGb: json['transferPerMonthInGb'] as int?,
  );
}