Firewall.fromJson constructor

Firewall.fromJson(
  1. Object? j
)

Implementation

factory Firewall.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Firewall(
    allowed: switch (json['allowed']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Allowed.fromJson(i)],
      _ => throw const FormatException('"allowed" is not a list'),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    denied: switch (json['denied']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Denied.fromJson(i)],
      _ => throw const FormatException('"denied" is not a list'),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    destinationRanges: switch (json['destinationRanges']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"destinationRanges" is not a list'),
    },
    direction: switch (json['direction']) {
      null => null,
      Object $1 => decodeString($1),
    },
    disabled: switch (json['disabled']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    logConfig: switch (json['logConfig']) {
      null => null,
      Object $1 => FirewallLogConfig.fromJson($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    network: switch (json['network']) {
      null => null,
      Object $1 => decodeString($1),
    },
    params: switch (json['params']) {
      null => null,
      Object $1 => FirewallParams.fromJson($1),
    },
    priority: switch (json['priority']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceRanges: switch (json['sourceRanges']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"sourceRanges" is not a list'),
    },
    sourceServiceAccounts: switch (json['sourceServiceAccounts']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"sourceServiceAccounts" is not a list',
      ),
    },
    sourceTags: switch (json['sourceTags']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"sourceTags" is not a list'),
    },
    targetServiceAccounts: switch (json['targetServiceAccounts']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"targetServiceAccounts" is not a list',
      ),
    },
    targetTags: switch (json['targetTags']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"targetTags" is not a list'),
    },
  );
}