UrlMap.fromJson constructor

UrlMap.fromJson(
  1. Object? j
)

Implementation

factory UrlMap.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return UrlMap(
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    defaultCustomErrorResponsePolicy:
        switch (json['defaultCustomErrorResponsePolicy']) {
          null => null,
          Object $1 => CustomErrorResponsePolicy.fromJson($1),
        },
    defaultRouteAction: switch (json['defaultRouteAction']) {
      null => null,
      Object $1 => HttpRouteAction.fromJson($1),
    },
    defaultService: switch (json['defaultService']) {
      null => null,
      Object $1 => decodeString($1),
    },
    defaultUrlRedirect: switch (json['defaultUrlRedirect']) {
      null => null,
      Object $1 => HttpRedirectAction.fromJson($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    fingerprint: switch (json['fingerprint']) {
      null => null,
      Object $1 => decodeString($1),
    },
    headerAction: switch (json['headerAction']) {
      null => null,
      Object $1 => HttpHeaderAction.fromJson($1),
    },
    hostRules: switch (json['hostRules']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) HostRule.fromJson(i)],
      _ => throw const FormatException('"hostRules" is not a list'),
    },
    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),
    },
    pathMatchers: switch (json['pathMatchers']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) PathMatcher.fromJson(i)],
      _ => throw const FormatException('"pathMatchers" is not a list'),
    },
    region: switch (json['region']) {
      null => null,
      Object $1 => decodeString($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    tests: switch (json['tests']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) UrlMapTest.fromJson(i)],
      _ => throw const FormatException('"tests" is not a list'),
    },
  );
}