StoragePool.fromJson constructor

StoragePool.fromJson(
  1. Object? j
)

Implementation

factory StoragePool.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return StoragePool(
    capacityProvisioningType: switch (json['capacityProvisioningType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    exapoolProvisionedCapacityGb:
        switch (json['exapoolProvisionedCapacityGb']) {
          null => null,
          Object $1 => StoragePoolExapoolProvisionedCapacityGb.fromJson($1),
        },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    labelFingerprint: switch (json['labelFingerprint']) {
      null => null,
      Object $1 => decodeString($1),
    },
    labels: switch (json['labels']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException('"labels" is not an object'),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    params: switch (json['params']) {
      null => null,
      Object $1 => StoragePoolParams.fromJson($1),
    },
    performanceProvisioningType:
        switch (json['performanceProvisioningType']) {
          null => null,
          Object $1 => decodeString($1),
        },
    poolProvisionedCapacityGb: switch (json['poolProvisionedCapacityGb']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    poolProvisionedIops: switch (json['poolProvisionedIops']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    poolProvisionedThroughput: switch (json['poolProvisionedThroughput']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    resourceStatus: switch (json['resourceStatus']) {
      null => null,
      Object $1 => StoragePoolResourceStatus.fromJson($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    selfLinkWithId: switch (json['selfLinkWithId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    shareSettings: switch (json['shareSettings']) {
      null => null,
      Object $1 => StoragePoolShareSettings.fromJson($1),
    },
    state: switch (json['state']) {
      null => null,
      Object $1 => decodeString($1),
    },
    status: switch (json['status']) {
      null => null,
      Object $1 => StoragePoolResourceStatus.fromJson($1),
    },
    storagePoolType: switch (json['storagePoolType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    zone: switch (json['zone']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}