SslPolicy.fromJson constructor

SslPolicy.fromJson(
  1. Object? j
)

Implementation

factory SslPolicy.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return SslPolicy(
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    customFeatures: switch (json['customFeatures']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"customFeatures" is not a list'),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    enabledFeatures: switch (json['enabledFeatures']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"enabledFeatures" is not a list'),
    },
    fingerprint: switch (json['fingerprint']) {
      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),
    },
    minTlsVersion: switch (json['minTlsVersion']) {
      null => null,
      Object $1 => decodeString($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    postQuantumKeyExchange: switch (json['postQuantumKeyExchange']) {
      null => null,
      Object $1 => decodeString($1),
    },
    profile: switch (json['profile']) {
      null => null,
      Object $1 => decodeString($1),
    },
    region: switch (json['region']) {
      null => null,
      Object $1 => decodeString($1),
    },
    selfLink: switch (json['selfLink']) {
      null => null,
      Object $1 => decodeString($1),
    },
    warnings: switch (json['warnings']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Warnings.fromJson(i)],
      _ => throw const FormatException('"warnings" is not a list'),
    },
  );
}