Probe_HttpGetAction.fromJson constructor

Probe_HttpGetAction.fromJson(
  1. Object? j
)

Implementation

factory Probe_HttpGetAction.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Probe_HttpGetAction(
    path: switch (json['path']) {
      null => '',
      Object $1 => decodeString($1),
    },
    port: switch (json['port']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    host: switch (json['host']) {
      null => '',
      Object $1 => decodeString($1),
    },
    scheme: switch (json['scheme']) {
      null => '',
      Object $1 => decodeString($1),
    },
    httpHeaders: switch (json['httpHeaders']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Probe_HttpHeader.fromJson(i)],
      _ => throw const FormatException('"httpHeaders" is not a list'),
    },
  );
}