
org.tinymediamanager.jsonrpc.api.call.Addons Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kodi-json-rpc Show documentation
Show all versions of kodi-json-rpc Show documentation
This library is the result of freezy's Kodi JSON introspection, merged with dereulenspiegel's adoption
without android, and patched to Kodi 16 Jarvis.
The newest version!
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC Remote; see the file license. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
package org.tinymediamanager.jsonrpc.api.call;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ArrayNode;
import org.codehaus.jackson.node.ObjectNode;
import org.tinymediamanager.jsonrpc.api.AbstractCall;
import org.tinymediamanager.jsonrpc.api.model.AddonModel;
import org.tinymediamanager.jsonrpc.api.model.GlobalModel;
import org.tinymediamanager.jsonrpc.api.model.ListModel;
public final class Addons {
/**
* Executes the given addon with the given parameters (if possible).
*
* This class represents the API method Addons.ExecuteAddon
*
* This class was generated automatically from XBMC's JSON-RPC introspect.
*/
public static class ExecuteAddon extends AbstractCall {
public final static String API_TYPE = "Addons.ExecuteAddon";
/**
* Executes the given addon with the given parameters (if possible).
*
* @param addonid
* @param params
* @param wait
*/
public ExecuteAddon(String addonid, HashMap params, Boolean wait) {
super();
addParameter("addonid", addonid);
addParameter("params", params);
addParameter("wait", wait);
}
/**
* Executes the given addon with the given parameters (if possible).
*
* @param addonid
* @param params
* @param wait
*/
public ExecuteAddon(String addonid, String[] params, Boolean wait) {
super();
addParameter("addonid", addonid);
addParameter("params", params);
addParameter("wait", wait);
}
/**
* Executes the given addon with the given parameters (if possible).
*
* @param addonid
* @param params
* URL path (must start with / or ?.
* @param wait
*/
public ExecuteAddon(String addonid, String params, Boolean wait) {
super();
addParameter("addonid", addonid);
addParameter("params", params);
addParameter("wait", wait);
}
/**
* Executes the given addon with the given parameters (if possible).
*
* @param addonid
*/
public ExecuteAddon(String addonid) {
super();
addParameter("addonid", addonid);
}
/**
* Executes the given addon with the given parameters (if possible).
*
* @param addonid
* @param params
*/
public ExecuteAddon(String addonid, HashMap params) {
super();
addParameter("addonid", addonid);
addParameter("params", params);
}
/**
* Executes the given addon with the given parameters (if possible).
*
* @param addonid
* @param wait
*/
public ExecuteAddon(String addonid, Boolean wait) {
super();
addParameter("addonid", addonid);
addParameter("wait", wait);
}
/**
* Executes the given addon with the given parameters (if possible).
*
* @param addonid
* @param params
*/
public ExecuteAddon(String addonid, String... params) {
super();
addParameter("addonid", addonid);
addParameter("params", params);
}
/**
* Executes the given addon with the given parameters (if possible).
*
* @param addonid
* @param params
* URL path (must start with / or ?.
*/
public ExecuteAddon(String addonid, String params) {
super();
addParameter("addonid", addonid);
addParameter("params", params);
}
@Override
protected String parseOne(JsonNode node) {
return node.getTextValue();
}
@Override
public String getName() {
return API_TYPE;
}
@Override
protected boolean returnsList() {
return false;
}
}
/**
* Gets the details of a specific addon.
*
* This class represents the API method Addons.GetAddonDetails
*
* This class was generated automatically from XBMC's JSON-RPC introspect.
*/
public static class GetAddonDetails extends AbstractCall {
public final static String API_TYPE = "Addons.GetAddonDetails";
public final static String RESULT = "addon";
/**
* Gets the details of a specific addon.
*
* @param addonid
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddonDetails(String addonid, String... properties) {
super();
addParameter("addonid", addonid);
addParameter("properties", properties);
}
@Override
protected AddonModel.Detail parseOne(JsonNode node) {
return new AddonModel.Detail((ObjectNode) node.get(RESULT));
}
@Override
public String getName() {
return API_TYPE;
}
@Override
protected boolean returnsList() {
return false;
}
}
/**
* Gets all available addons.
*
* This class represents the API method Addons.GetAddons
*
* This class was generated automatically from XBMC's JSON-RPC introspect.
*/
public static class GetAddons extends AbstractCall {
public final static String API_TYPE = "Addons.GetAddons";
public final static String RESULT = "addons";
/**
* Gets all available addons.
*
* @param type
* One of: unknown, xbmc.metadata.scraper.albums, xbmc.metadata.scraper.artists,
* xbmc.metadata.scraper.movies, xbmc.metadata.scraper.musicvideos, xbmc.metadata.scraper.tvshows,
* xbmc.ui.screensaver, xbmc.player.musicviz, xbmc.python.pluginsource, xbmc.python.script,
* xbmc.python.weather, xbmc.python.subtitles, xbmc.python.lyrics, xbmc.gui.skin,
* xbmc.gui.webinterface, xbmc.pvrclient, xbmc.addon.video, xbmc.addon.audio,
* xbmc.addon.image, xbmc.addon.executable, xbmc.service. See constants at {@link AddonModel.Types}.
* @param content
* Content provided by the addon. Only considered for plugins and scripts. One of: unknown, video, audio,
* image, executable. See constants at {@link AddonModel.Content}.
* @param enabled
* @param limits
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddons(String type, String content, Boolean enabled, ListModel.Limits limits, String... properties) {
super();
addParameter("type", type);
addParameter("content", content);
addParameter("enabled", enabled);
addParameter("limits", limits);
addParameter("properties", properties);
}
/**
* Gets all available addons.
*
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddons(String... properties) {
super();
addParameter("properties", properties);
}
/**
* Gets all available addons.
*
* @param type
* One of: unknown, xbmc.player.musicviz, xbmc.gui.skin, xbmc.pvrclient, kodi.adsp,
* xbmc.python.script, xbmc.python.weather, xbmc.subtitle.module, xbmc.python.lyrics,
* xbmc.metadata.scraper.albums, xbmc.metadata.scraper.artists, xbmc.metadata.scraper.movies,
* xbmc.metadata.scraper.musicvideos, xbmc.metadata.scraper.tvshows, xbmc.ui.screensaver,
* xbmc.python.pluginsource, xbmc.addon.repository, xbmc.webinterface, xbmc.service,
* xbmc.audioencoder, kodi.context.item, kodi.audiodecoder, kodi.resource.images,
* kodi.resource.language, kodi.resource.uisounds, xbmc.addon.video, xbmc.addon.audio,
* xbmc.addon.image, xbmc.addon.executable, visualization-library, xbmc.metadata.scraper.library,
* xbmc.python.library, xbmc.python.module. See constants at {@link AddonModel.Types}.
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddons(String type, String... properties) {
super();
addParameter("type", type);
addParameter("properties", properties);
}
/**
* Gets all available addons.
*
* @param type
* One of: unknown, xbmc.player.musicviz, xbmc.gui.skin, xbmc.pvrclient, kodi.adsp,
* xbmc.python.script, xbmc.python.weather, xbmc.subtitle.module, xbmc.python.lyrics,
* xbmc.metadata.scraper.albums, xbmc.metadata.scraper.artists, xbmc.metadata.scraper.movies,
* xbmc.metadata.scraper.musicvideos, xbmc.metadata.scraper.tvshows, xbmc.ui.screensaver,
* xbmc.python.pluginsource, xbmc.addon.repository, xbmc.webinterface, xbmc.service,
* xbmc.audioencoder, kodi.context.item, kodi.audiodecoder, kodi.resource.images,
* kodi.resource.language, kodi.resource.uisounds, xbmc.addon.video, xbmc.addon.audio,
* xbmc.addon.image, xbmc.addon.executable, visualization-library, xbmc.metadata.scraper.library,
* xbmc.python.library, xbmc.python.module. See constants at {@link AddonModel.Types}.
* @param content
* Content provided by the addon. Only considered for plugins and scripts. One of: unknown, video, audio,
* image, executable. See constants at {@link AddonModel.Content}.
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddons(String type, String content, String... properties) {
super();
addParameter("type", type);
addParameter("content", content);
addParameter("properties", properties);
}
/**
* Gets all available addons.
*
* @param enabled
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddons(Boolean enabled, String... properties) {
super();
addParameter("enabled", enabled);
addParameter("properties", properties);
}
/**
* Gets all available addons.
*
* @param type
* One of: unknown, xbmc.player.musicviz, xbmc.gui.skin, xbmc.pvrclient, kodi.adsp,
* xbmc.python.script, xbmc.python.weather, xbmc.subtitle.module, xbmc.python.lyrics,
* xbmc.metadata.scraper.albums, xbmc.metadata.scraper.artists, xbmc.metadata.scraper.movies,
* xbmc.metadata.scraper.musicvideos, xbmc.metadata.scraper.tvshows, xbmc.ui.screensaver,
* xbmc.python.pluginsource, xbmc.addon.repository, xbmc.webinterface, xbmc.service,
* xbmc.audioencoder, kodi.context.item, kodi.audiodecoder, kodi.resource.images,
* kodi.resource.language, kodi.resource.uisounds, xbmc.addon.video, xbmc.addon.audio,
* xbmc.addon.image, xbmc.addon.executable, visualization-library, xbmc.metadata.scraper.library,
* xbmc.python.library, xbmc.python.module. See constants at {@link AddonModel.Types}.
* @param content
* Content provided by the addon. Only considered for plugins and scripts. One of: unknown, video, audio,
* image, executable. See constants at {@link AddonModel.Content}.
* @param enabled
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddons(String type, String content, Boolean enabled, String... properties) {
super();
addParameter("type", type);
addParameter("content", content);
addParameter("enabled", enabled);
addParameter("properties", properties);
}
/**
* Gets all available addons.
*
* @param limits
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddons(ListModel.Limits limits, String... properties) {
super();
addParameter("limits", limits);
addParameter("properties", properties);
}
/**
* Gets all available addons.
*
* @param enabled
* @param limits
* @param properties
* One or more of: name, version, summary, description, path, author,
* thumbnail, disclaimer, fanart, dependencies, broken, extrainfo, rating,
* enabled. See constants at {@link AddonModel.Fields}.
*/
public GetAddons(Boolean enabled, ListModel.Limits limits, String... properties) {
super();
addParameter("enabled", enabled);
addParameter("limits", limits);
addParameter("properties", properties);
}
@Override
protected ArrayList parseMany(JsonNode node) {
final ArrayNode addons = parseResults(node, RESULT);
if (addons != null) {
final ArrayList ret = new ArrayList(addons.size());
for (int i = 0; i < addons.size(); i++) {
final ObjectNode item = (ObjectNode) addons.get(i);
ret.add(new AddonModel.Detail(item));
}
return ret;
}
else {
return new ArrayList(0);
}
}
@Override
public String getName() {
return API_TYPE;
}
@Override
protected boolean returnsList() {
return true;
}
/**
* API Name: enabled
*/
public interface Enabled {
public final String ALL = "all";
public final static Set values = new HashSet(Arrays.asList(ALL));
}
}
/**
* Enables/Disables a specific addon.
*
* This class represents the API method Addons.SetAddonEnabled
*
* This class was generated automatically from XBMC's JSON-RPC introspect.
*/
public static class SetAddonEnabled extends AbstractCall {
public final static String API_TYPE = "Addons.SetAddonEnabled";
/**
* Enables/Disables a specific addon.
*
* @param addonid
* @param enabled
*/
public SetAddonEnabled(String addonid, GlobalModel.Toggle enabled) {
super();
addParameter("addonid", addonid);
addParameter("enabled", enabled);
}
@Override
protected String parseOne(JsonNode node) {
return node.getTextValue();
}
@Override
public String getName() {
return API_TYPE;
}
@Override
protected boolean returnsList() {
return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy