Publishing.fromJson constructor

Publishing.fromJson(
  1. Object? j
)

Implementation

factory Publishing.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Publishing(
    methodSettings: switch (json['methodSettings']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) MethodSettings.fromJson(i)],
      _ => throw const FormatException('"methodSettings" is not a list'),
    },
    newIssueUri: switch (json['newIssueUri']) {
      null => '',
      Object $1 => decodeString($1),
    },
    documentationUri: switch (json['documentationUri']) {
      null => '',
      Object $1 => decodeString($1),
    },
    apiShortName: switch (json['apiShortName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    githubLabel: switch (json['githubLabel']) {
      null => '',
      Object $1 => decodeString($1),
    },
    codeownerGithubTeams: switch (json['codeownerGithubTeams']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"codeownerGithubTeams" is not a list',
      ),
    },
    docTagPrefix: switch (json['docTagPrefix']) {
      null => '',
      Object $1 => decodeString($1),
    },
    organization: switch (json['organization']) {
      null => ClientLibraryOrganization.$default,
      Object $1 => ClientLibraryOrganization.fromJson($1),
    },
    librarySettings: switch (json['librarySettings']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) ClientLibrarySettings.fromJson(i),
      ],
      _ => throw const FormatException('"librarySettings" is not a list'),
    },
    protoReferenceDocumentationUri:
        switch (json['protoReferenceDocumentationUri']) {
          null => '',
          Object $1 => decodeString($1),
        },
    restReferenceDocumentationUri:
        switch (json['restReferenceDocumentationUri']) {
          null => '',
          Object $1 => decodeString($1),
        },
  );
}