addModSourceInfo method

Future<ModSourceInfo> addModSourceInfo({
  1. required String namespace,
  2. MinecraftMod? mod,
  3. List<SourceText>? patchouliAddons,
  4. String? token,
})

Add a mod source info. Parameters

  • namespace The namespace of the mod.
  • mod The mod of the info (optional).
  • patchouliAddons Used to store specially formatted SourceText in patchouli manuals (optional).
  • token The token to use for authentication (optional if you have set a global token).

Implementation

Future<ModSourceInfo> addModSourceInfo(
    {required String namespace,
    MinecraftMod? mod,
    List<SourceText>? patchouliAddons,
    String? token}) async {
  APIHttpResponse response =
      await httpClient.post('/translate/mod-source-info/',
          body: {
            'namespace': namespace,
            if (mod != null) 'modUUID': mod.uuid,
            if (patchouliAddons != null)
              'patchouliAddons': patchouliAddons.map((e) => e.uuid).toList(),
          },
          token: token);

  return ModSourceInfo.fromMap(response.data);
}