Region.fromJson constructor

Region.fromJson(
  1. Object? j
)

Implementation

factory Region.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Region(
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    deprecated: switch (json['deprecated']) {
      null => null,
      Object $1 => DeprecationStatus.fromJson($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    quotaStatusWarning: switch (json['quotaStatusWarning']) {
      null => null,
      Object $1 => QuotaStatusWarning.fromJson($1),
    },
    quotas: switch (json['quotas']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Quota.fromJson(i)],
      _ => throw const FormatException('"quotas" is not a list'),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    status: switch (json['status']) {
      null => null,
      Object $1 => decodeString($1),
    },
    supportsPzs: switch (json['supportsPzs']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    zones: switch (json['zones']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"zones" is not a list'),
    },
  );
}