CommonLanguageSettings.fromJson constructor

CommonLanguageSettings.fromJson(
  1. Object? j
)

Implementation

factory CommonLanguageSettings.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return CommonLanguageSettings(
    referenceDocsUri: switch (json['referenceDocsUri']) {
      null => '',
      Object $1 => decodeString($1),
    },
    destinations: switch (json['destinations']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) ClientLibraryDestination.fromJson(i),
      ],
      _ => throw const FormatException('"destinations" is not a list'),
    },
    selectiveGapicGeneration: switch (json['selectiveGapicGeneration']) {
      null => null,
      Object $1 => SelectiveGapicGeneration.fromJson($1),
    },
  );
}