index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/namespaces/NamespaceList.java
package ai.wanaku.cli.main.commands.namespaces; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import ai.wanaku.api.types.Namespace; import ai.wanaku.api.types.WanakuResponse; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.NamespacesService; import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder; import java.net.URI; import java.util.List; import java.util.stream.Collectors; import org.jline.terminal.Terminal; import picocli.CommandLine; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; @CommandLine.Command(name = "list", description = "List namespaces") public class NamespaceList extends BaseCommand { @CommandLine.Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; NamespacesService namespacesService; private AddressableNamespace convertToAddressable(Namespace n) { return AddressableNamespace.fromNamespace(host, n); } private static class AddressableNamespace extends Namespace { private String host; @Override public String getPath() { return String.format("%s/%s/mcp/sse", host, super.getPath()); } public static AddressableNamespace fromNamespace(String host, Namespace namespace) { AddressableNamespace ret = new AddressableNamespace(); ret.setId(namespace.getId()); ret.setPath(namespace.getPath()); ret.setName(namespace.getName() == null ? "" : namespace.getName()); ret.host = host; return ret; } public static AddressableNamespace defaultNs(String host) { AddressableNamespace ret = new AddressableNamespace(); ret.setId("<default>"); ret.setPath(""); ret.setName(""); ret.host = host; return ret; } } @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { namespacesService = QuarkusRestClientBuilder.newBuilder() .baseUri(URI.create(host)) .build(NamespacesService.class); try { WanakuResponse<List<Namespace>> response = namespacesService.list(); List<AddressableNamespace> list = response.data().stream() .map(this::convertToAddressable) .collect(Collectors.toList()); list.add(AddressableNamespace.defaultNs(host)); printer.printTable(list, "id","name","path"); } catch (WebApplicationException ex) { Response response = ex.getResponse(); commonResponseErrorHandler(response); return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/namespaces/Namespaces.java
package ai.wanaku.cli.main.commands.namespaces; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; import static picocli.CommandLine.usage; @CommandLine.Command(name = "namespaces", description = "Manage namespaces", subcommands = { NamespaceList.class}) public class Namespaces extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/resources/Resources.java
package ai.wanaku.cli.main.commands.resources; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.IOException; @CommandLine.Command(name = "resources", description = "Manage resources", subcommands = { ResourcesExpose.class, ResourcesRemove.class, ResourcesList.class}) public class Resources extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { CommandLine.usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/resources/ResourcesExpose.java
package ai.wanaku.cli.main.commands.resources; import ai.wanaku.api.types.ResourceReference; import ai.wanaku.api.types.io.ResourcePayload; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.FileHelper; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ResourcesService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.IOException; import java.util.ArrayList; import java.util.List; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; @CommandLine.Command(name = "expose",description = "Expose resources") public class ResourcesExpose extends BaseCommand { @CommandLine.Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @CommandLine.Option(names = { "--location" }, description = "The of the resource", required = true, arity = "0..1") private String location; @CommandLine.Option(names = { "--type" }, description = "The type of the resource", required = true, arity = "0..1") private String type; @CommandLine.Option(names = { "--name" }, description = "A human-readable name for the resource", required = true, arity = "0..1") private String name; @CommandLine.Option(names = {"-N", "--namespace"}, description="The namespace associated with the tool", defaultValue = "", required = true) private String namespace; @CommandLine.Option(names = { "--description" }, description = "A brief description of the resource", required = true, arity = "0..1") private String description; @CommandLine.Option(names = { "--mimeType" }, description = "The MIME type of the resource (i.e.: text/plain)", required = true, defaultValue = "text/plain", arity = "0..1") private String mimeType; @CommandLine.Option(names = { "--param" }, description = "One or more parameters for the resource", arity = "0..n") private List<String> params; @CommandLine.Option(names = {"--configuration-from-file"}, description="Configure the capability provider using the given file", arity = "0..1") private String configurationFromFile; @CommandLine.Option(names = {"--secrets-from-file"}, description="Add the given secrets to the capability provider using the given file", arity = "0..1") private String secretsFromFile; ResourcesService resourcesService; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { resourcesService = initService(ResourcesService.class, host); ResourceReference resource = new ResourceReference(); resource.setLocation(location); resource.setType(type); resource.setName(name); resource.setDescription(description); resource.setMimeType(mimeType); resource.setNamespace(namespace); ResourcePayload resourcePayload = new ResourcePayload(); resourcePayload.setPayload(resource); FileHelper.loadConfigurationSources(configurationFromFile, resourcePayload::setConfigurationData); FileHelper.loadConfigurationSources(secretsFromFile, resourcePayload::setSecretsData); if (params != null) { List<ResourceReference.Param> paramsList = new ArrayList<>(); for (String paramStr : params) { ResourceReference.Param param = new ResourceReference.Param(); String[] split = paramStr.split("="); param.setName(split[0]); if (split.length > 1) { param.setValue(split[1]); } paramsList.add(param); } resource.setParams(paramsList); } try (Response response = resourcesService.exposeWithPayload(resourcePayload)) { } catch (WebApplicationException ex) { Response response = ex.getResponse(); commonResponseErrorHandler(response); return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/resources/ResourcesList.java
package ai.wanaku.cli.main.commands.resources; import ai.wanaku.api.types.ResourceReference; import ai.wanaku.api.types.WanakuResponse; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ResourcesService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jline.terminal.Terminal; import java.util.List; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; @Command(name = "list", description = "List resources") public class ResourcesList extends BaseCommand { @Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; ResourcesService resourcesService; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { resourcesService = initService(ResourcesService.class, host); try { WanakuResponse<List<ResourceReference>> response = resourcesService.list(); List<ResourceReference> list = response.data(); printer.printTable(list, "name", "type", "description", "location"); } catch (WebApplicationException ex) { Response response = ex.getResponse(); commonResponseErrorHandler(response); return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/resources/ResourcesRemove.java
package ai.wanaku.cli.main.commands.resources; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ResourcesService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jline.terminal.Terminal; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; @Command(name = "remove",description = "Remove exposed resources") public class ResourcesRemove extends BaseCommand { @Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @Option(names = { "--name" }, description = "A human-readable name for the resource", required = true, arity = "0..1") private String name; ResourcesService resourcesService; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { resourcesService = initService(ResourcesService.class, host); try (Response response = resourcesService.remove(name)) { printer.printSuccessMessage("Successfully removed resource reference '" + name+"'"); } catch (WebApplicationException ex) { Response response = ex.getResponse(); if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { String warningMessage = String.format("Resource not found (%s): %s%n", name, response.getStatusInfo().getReasonPhrase()); printer.printWarningMessage(warningMessage); } else { commonResponseErrorHandler(response); } return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/start/Start.java
package ai.wanaku.cli.main.commands.start; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; @CommandLine.Command(name = "start", description = "Start Wanaku", subcommands = { StartLocal.class}) public class Start extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { CommandLine.usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/start/StartBase.java
package ai.wanaku.cli.main.commands.start; import ai.wanaku.cli.main.commands.BaseCommand; import org.jboss.logging.Logger; import picocli.CommandLine; import java.util.List; public abstract class StartBase extends BaseCommand { private static final Logger LOG = Logger.getLogger(StartBase.class); @CommandLine.ArgGroup(exclusive = true, multiplicity = "0..1") ExclusiveOptions exclusive; static class ExclusiveOptions { @CommandLine.Option(names = { "--services" }, split = ",", description = "Which of services to start (separated by comma)", arity = "0..n") protected List<String> services; @CommandLine.ArgGroup(exclusive = true, multiplicity = "1") ExclusiveNonStartOptions exclusiveNonStart; } static class ExclusiveNonStartOptions { @CommandLine.Option(names = { "--list-services" }, description = "A list of available services") protected boolean listServices = false; @CommandLine.Option(names = { "--clean" }, description = "Clean the local cache of downloaded files and services") protected boolean clean = false; } protected abstract void startWanaku(); }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/start/StartLocal.java
package ai.wanaku.cli.main.commands.start; import ai.wanaku.api.exceptions.WanakuException; import ai.wanaku.cli.main.support.RuntimeConstants; import ai.wanaku.cli.main.support.WanakuCliConfig; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.cli.runner.local.LocalRunner; import jakarta.inject.Inject; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Objects; @CommandLine.Command(name = "local", description = "Create a new tool service") public class StartLocal extends StartBase { private static final Logger LOG = Logger.getLogger(StartLocal.class); @Inject WanakuCliConfig config; @Override protected void startWanaku() { List<String> services; if (exclusive != null && exclusive.services != null) { services = exclusive.services; } else { services = config.defaultServices(); } LocalRunner localRunner = new LocalRunner(config); try { localRunner.start(services); } catch (WanakuException | IOException e) { LOG.errorf(e, e.getMessage()); } } public static void deleteDirectory(WanakuPrinter printer, File dir) { if (!dir.exists()) { return; } if (dir.isDirectory()) { String[] children = dir.list(); for (String child : Objects.requireNonNull(children)) { File childDir = new File(dir, child); deleteDirectory(printer,childDir); } } if (!dir.delete()) { printer.printErrorMessage("Failed to delete " + dir); } } @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { if (exclusive != null && exclusive.exclusiveNonStart != null) { if (exclusive.exclusiveNonStart.listServices) { Map<String, String> components = config.components(); for (String component : components.keySet()) { if (!component.equals("wanaku-router")) { printer.printInfoMessage(" - " + component); } } return EXIT_OK; } if (exclusive.exclusiveNonStart.clean) { printer.printWarningMessage("Removing Wanaku cache directory"); deleteDirectory(printer, new File(RuntimeConstants.WANAKU_CACHE_DIR)); printer.printWarningMessage("Removing Wanaku local instance directory"); deleteDirectory(printer, new File(RuntimeConstants.WANAKU_LOCAL_DIR)); return EXIT_OK; } } startWanaku(); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/AbstractTargets.java
package ai.wanaku.cli.main.commands.targets; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.TargetsService; import org.jline.terminal.Terminal; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; @Deprecated @Command(name = "state", description = "Get the state of the targeted services") public abstract class AbstractTargets extends BaseCommand { @Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; protected TargetsService targetsService; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { printer.printWarningMessage("`wanaku targets` is deprecated, use `wanaku capabilities` instead"); targetsService = initService(TargetsService.class, host); return doTargetCall(printer); } protected abstract Integer doTargetCall(WanakuPrinter printer) throws Exception; }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/Targets.java
package ai.wanaku.cli.main.commands.targets; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.commands.targets.resources.Resources; import ai.wanaku.cli.main.commands.targets.tools.Tools; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; @CommandLine.Command(name = "targets", description = "Manage targets", subcommands = { Tools.class, Resources.class}) @Deprecated public class Targets extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { CommandLine.usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/resources/Resources.java
package ai.wanaku.cli.main.commands.targets.resources; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; @CommandLine.Command(name = "resources", description = "Manage targets", subcommands = { ResourcesLinkedList.class, ResourcesConfigure.class, ResourcesState.class }) @Deprecated public class Resources extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { CommandLine.usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/resources/ResourcesConfigure.java
package ai.wanaku.cli.main.commands.targets.resources; import ai.wanaku.cli.main.commands.targets.AbstractTargets; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.TargetsService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import java.io.IOException; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; @Command(name = "configure", description = "Configure resources providers") @Deprecated public class ResourcesConfigure extends AbstractTargets { @Option(names = { "--service" }, description = "The service to link", required = true, arity = "0..1") protected String service; @Option(names = { "--option" }, description = "The option to set", required = true, arity = "0..1") protected String option; @Option(names = { "--value" }, description = "The value to set the option", required = true, arity = "0..1") protected String value; @Override public Integer doTargetCall(WanakuPrinter printer) throws IOException { targetsService = initService(TargetsService.class, host); try (Response ignored = targetsService.resourcesConfigure(service, option, value)) { } catch (WebApplicationException e) { Response response = e.getResponse(); if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { System.out.println("There is no configuration or service with that name"); return EXIT_ERROR; } else { commonResponseErrorHandler(response); return EXIT_ERROR; } } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/resources/ResourcesLinkedList.java
package ai.wanaku.cli.main.commands.targets.resources; import ai.wanaku.api.types.providers.ServiceTarget; import ai.wanaku.cli.main.commands.targets.AbstractTargets; import ai.wanaku.cli.main.support.WanakuPrinter; import picocli.CommandLine; import java.util.List; @CommandLine.Command(name = "list", description = "List targeted services") @Deprecated public class ResourcesLinkedList extends AbstractTargets { @Override protected Integer doTargetCall(WanakuPrinter printer) throws Exception { List<ServiceTarget> list = targetsService.resourcesList().data(); printer.printTable(list, "id", "service", "host"); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/resources/ResourcesState.java
package ai.wanaku.cli.main.commands.targets.resources; import ai.wanaku.api.types.discovery.ActivityRecord; import ai.wanaku.cli.main.commands.targets.AbstractTargets; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.TargetsService; import picocli.CommandLine; import java.io.IOException; import java.util.List; import java.util.Map; import static ai.wanaku.cli.main.support.TargetsHelper.getPrintableTargets; @CommandLine.Command(name = "state", description = "List service states") @Deprecated public class ResourcesState extends AbstractTargets { /** * Standard column names for resource states display. * <p>This array defines the order and names of columns when displaying * resources in table or map format. The order matches the fields * in {@link ResourcesState}. */ public static final String [] COLUMNS = {"id", "service", "active", "lastSeen"}; @Override public Integer doTargetCall(WanakuPrinter printer) throws IOException { TargetsService targetsService = initService(TargetsService.class, host); Map<String, List<ActivityRecord>> states = targetsService.resourcesState().data(); List<Map<String, String>> printableStates = getPrintableTargets(states); printer.printTable(printableStates, COLUMNS); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/tools/Tools.java
package ai.wanaku.cli.main.commands.targets.tools; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import static picocli.CommandLine.Command; import static picocli.CommandLine.usage; @Deprecated @Command(name = "tools", description = "Manage targets", subcommands = { ToolsLinkedList.class, ToolsConfigure.class, ToolsState.class }) public class Tools extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/tools/ToolsConfigure.java
package ai.wanaku.cli.main.commands.targets.tools; import ai.wanaku.cli.main.commands.targets.AbstractTargets; import ai.wanaku.cli.main.support.WanakuPrinter; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import java.io.IOException; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; @Deprecated @Command(name = "configure", description = "Configure services") public class ToolsConfigure extends AbstractTargets { @Option(names = { "--service" }, description = "The service to link", required = true, arity = "0..1") protected String service; @Option(names = { "--option" }, description = "The option to set", required = true, arity = "0..1") protected String option; @Option(names = { "--value" }, description = "The value to set the option", required = true, arity = "0..1") protected String value; @Override protected Integer doTargetCall(WanakuPrinter printer) throws IOException { try (Response ignored = targetsService.toolsConfigure(service, option, value)) { } catch (WebApplicationException e) { Response response = e.getResponse(); if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { System.out.println("There is no configuration or service with that name"); return EXIT_ERROR; } else { commonResponseErrorHandler(response); return EXIT_ERROR; } } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/tools/ToolsLinkedList.java
package ai.wanaku.cli.main.commands.targets.tools; import ai.wanaku.api.types.providers.ServiceTarget; import ai.wanaku.cli.main.commands.targets.AbstractTargets; import ai.wanaku.cli.main.support.WanakuPrinter; import picocli.CommandLine; import java.io.IOException; import java.util.List; @CommandLine.Command(name = "list", description = "List targeted services") @Deprecated public class ToolsLinkedList extends AbstractTargets { @Override protected Integer doTargetCall(WanakuPrinter printer) throws IOException { List<ServiceTarget> list = targetsService.toolsList().data(); printer.printTable(list); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/targets/tools/ToolsState.java
package ai.wanaku.cli.main.commands.targets.tools; import ai.wanaku.api.types.discovery.ActivityRecord; import ai.wanaku.cli.main.commands.targets.AbstractTargets; import ai.wanaku.cli.main.support.WanakuPrinter; import picocli.CommandLine.Command; import java.io.IOException; import java.util.List; import java.util.Map; import static ai.wanaku.cli.main.support.TargetsHelper.getPrintableTargets; @Command(name = "state", description = "List services states") @Deprecated public class ToolsState extends AbstractTargets { private static final String [] COLUMS = {"id","service", "active", "lastSeen"}; /** * Executes the tools state command. * * This method performs the following operations: * <ol> * <li>Initializes the targets service</li> * <li>Retrieves the current tools state from the service</li> * <li>Formats and prints the tools state in a tabular format</li> * </ol> * * @return {@link #EXIT_OK} (0) on successful execution, or appropriate error code * if an exception occurs during processing * @throws IOException if there's an I/O error while creating the terminal instance * or communicating with the targets service * @throws RuntimeException if the targets service initialization fails or * if there's an error retrieving the tools state */ @Override protected Integer doTargetCall(WanakuPrinter printer) throws Exception { Map<String, List<ActivityRecord>> states = targetsService.toolsState().data(); List<Map<String, String>> printableStates = getPrintableTargets(states); printer.printTable(printableStates, COLUMS); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/tools/Tools.java
package ai.wanaku.cli.main.commands.tools; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; @CommandLine.Command(name = "tools", description = "Manage tools", subcommands = { ToolsEdit.class,ToolsAdd.class, ToolsRemove.class, ToolsList.class, ToolsImport.class, ToolsGenerate.class}) public class Tools extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { CommandLine.usage(this, System.out); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/tools/ToolsAdd.java
package ai.wanaku.cli.main.commands.tools; import ai.wanaku.api.types.InputSchema; import ai.wanaku.api.types.Property; import ai.wanaku.api.types.ToolReference; import ai.wanaku.api.types.WanakuResponse; import ai.wanaku.api.types.io.ToolPayload; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.FileHelper; import ai.wanaku.cli.main.support.PropertyHelper; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ToolsService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.util.List; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; @CommandLine.Command(name = "add",description = "Add tools") public class ToolsAdd extends BaseCommand { private static final Logger LOG = Logger.getLogger(ToolsAdd.class); @CommandLine.Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @CommandLine.Option(names = {"-n", "--name"}, description="Name of the tool", required = true) private String name; @CommandLine.Option(names = {"-N", "--namespace"}, description="The namespace associated with the tool", defaultValue = "", required = true) private String namespace; @CommandLine.Option(names = {"-d", "--description"}, description="Description of the tool", required = true) private String description; @CommandLine.Option(names = {"-u", "--uri"}, description="URI of the tool", required = true) private String uri; @CommandLine.Option(names = {"--type"}, description="Type of the tool (i.e: http)", required = true) private String type; @CommandLine.Option(names = {"--input-schema-type"}, description = "Type of input schema (e.g., 'string', 'object')", defaultValue = "object") private String inputSchemaType; @CommandLine.Option(names = {"-p", "--property"}, description = "Property name and value (e.g., '--property name:type,description)") private List<String> properties; @CommandLine.Option(names = {"-r", "--required"}, description = "List of required property names (e.g., '-r foo bar')", arity = "0..*") private List<String> required; @CommandLine.Option(names = {"--configuration-from-file"}, description="Configure the capability provider using the given file", arity = "0..1") private String configurationFromFile; @CommandLine.Option(names = {"--secrets-from-file"}, description="Add the given secrets to the capability provider using the given file", arity = "0..1") private String secretsFromFile; ToolsService toolsService; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { ToolReference toolReference = new ToolReference(); toolReference.setName(name); toolReference.setDescription(description); toolReference.setUri(uri); toolReference.setType(type); toolReference.setNamespace(namespace); InputSchema inputSchema = new InputSchema(); inputSchema.setType(inputSchemaType); if (properties != null) { for (String propertyStr : properties) { PropertyHelper.PropertyDescription result = PropertyHelper.parseProperty(propertyStr); Property property = new Property(); property.setType(result.dataType()); property.setDescription(result.description()); inputSchema.getProperties().put(result.propertyName(), property); } } toolReference.setInputSchema(inputSchema); if (required != null) { inputSchema.setRequired(required); } ToolPayload toolPayload = new ToolPayload(); toolPayload.setPayload(toolReference); FileHelper.loadConfigurationSources(configurationFromFile, toolPayload::setConfigurationData); FileHelper.loadConfigurationSources(secretsFromFile, toolPayload::setSecretsData); toolsService = initService(ToolsService.class,host); try { WanakuResponse<ToolReference> data = toolsService.addWithPayload(toolPayload); } catch (WebApplicationException ex) { Response response = ex.getResponse(); if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { System.err.printf("There is no downstream service capable of handling requests of the given type (%s): %s%n", type, response.getStatusInfo().getReasonPhrase()); System.exit(1); } else { commonResponseErrorHandler(response); return EXIT_ERROR; } } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/tools/ToolsEdit.java
package ai.wanaku.cli.main.commands.tools; import ai.wanaku.api.types.ToolReference; import ai.wanaku.api.types.WanakuResponse; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ToolsService; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.core.Response; import org.jline.builtins.ConfigurationPath; import org.jline.builtins.Nano; import org.jline.builtins.Options; import org.jline.consoleui.elements.ConfirmChoice; import org.jline.consoleui.prompt.ConsolePrompt; import org.jline.consoleui.prompt.PromptResultItemIF; import org.jline.consoleui.prompt.builder.ListPromptBuilder; import org.jline.consoleui.prompt.builder.PromptBuilder; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import java.util.Map; import static io.netty.handler.codec.http.HttpResponseStatus.OK; @CommandLine.Command(name = "edit", description = "edit tool") public class ToolsEdit extends BaseCommand { @CommandLine.Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @CommandLine.Parameters(description = "Tool name that you want to edit", arity = "0..1") private String toolName; ToolsService toolsService; private static final String TEMP_FILE_PREFIX = "wanaku_edit"; private static final String TEMP_FILE_SUFFIX = ".json"; private static final String NANO_CONFIG_FILE = "/nano/jnanorc"; private record Item(String id, String text) { } ObjectMapper mapper = new ObjectMapper(); /** * This method is the entry point for the `edit` command. * It allows users to edit a tool's definition either by providing the tool name as a parameter * or by selecting from a list of registered tools. * It uses the Nano editor for modifying the tool definition and prompts for confirmation before saving. * * @return EXIT_OK; if the operation was successful, 1 otherwise. * @throws Exception if an error occurs during the operation. */ @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { toolsService = initService(ToolsService.class, host); List<ToolReference> list = toolsService.list().data(); // check if there is at least a tool registered if (list == null || list.isEmpty()) { System.out.println("No tools registered yet"); return EXIT_ERROR; } ToolReference tool; if (toolName == null) { // if no tool name provided as parameter, let the user choose from the list // of registered tools. tool = selectTool(terminal, list); } else { try { WanakuResponse<ToolReference> response = toolsService.getByName(toolName); tool = response.data(); } catch (RuntimeException e) { System.err.println("Error retrieving the tool '" + toolName + "': " + e.getMessage()); return EXIT_ERROR; } } //Run Nano Editor to modify the tool String toolString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(tool); String modifiedContent = edit(terminal, toolString, tool.getName()); boolean wasModified = !toolString.equals(modifiedContent); if (!wasModified) { printer.printWarningMessage("No changes detected!"); return EXIT_OK; } //Ask for confirmation boolean save = confirm(terminal, tool); if (save) { System.out.print("saving '" + tool.getName() + "' tool..."); ToolReference toolModified = mapper.readValue(modifiedContent, ToolReference.class); // Force the ID in case the user modified it. toolModified.setId(tool.getId()); Response response = toolsService.update(toolModified); if (response.getStatus() != OK.code()) { System.err.println("error!"); } System.out.println("done"); } return EXIT_OK; } /** * Prompts the user for confirmation to update the specified tool. * * @param terminal The JLine terminal instance. * @param tool The ToolReference object to be updated. * @return true if the user confirms the update, false otherwise. * @throws IOException if an I/O error occurs during the prompt. */ public boolean confirm(Terminal terminal, ToolReference tool) throws IOException { ConsolePrompt prompt = new ConsolePrompt(terminal); PromptBuilder builder = prompt.getPromptBuilder(); // Create a simple yes/no prompt builder.createConfirmPromp() .name("continue") .message("Do you want to update the '" + tool.getName() + "' tool?") .defaultValue(ConfirmChoice.ConfirmationValue.NO) .addPrompt(); Map<String, PromptResultItemIF> result = prompt.prompt(builder.build()); return "YES".equalsIgnoreCase(result.get("continue").getResult()); } /** * Runs the Nano editor to allow the user to modify the selected tool definition. * The tool definition is written to a temporary file, edited using Nano, and then the modified content is read back. * * @param terminal The JLine terminal instance. * @param toolString The initial JSON string representation of the tool. * @param toolName The name of the tool being edited. * @return The modified content of the tool definition as a String. * @throws IOException if an I/O error occurs during file operations or running Nano. */ public String edit(Terminal terminal, String toolString, String toolName) throws IOException { Path tempFile = Files.createTempFile(TEMP_FILE_PREFIX, TEMP_FILE_SUFFIX); ConfigurationPath configPath = ConfigurationPath.fromClasspath(NANO_CONFIG_FILE); Path root = tempFile.getParent(); Files.write(tempFile, toolString.getBytes()); Options options = Options.compile(Nano.usage()).parse(new String[0]); Nano nano = new Nano(terminal, root, options, configPath); nano.title = "Edit Tool " + toolName; nano.mouseSupport = true; nano.matchBrackets = "(<[{)>]}"; nano.printLineNumbers = true; nano.open(tempFile.toAbsolutePath().toString()); nano.run(); return Files.readString(tempFile); } /** * Presents a list of available tools to the user and allows them to select one. * The list is formatted for better readability in the terminal. * * @param terminal The JLine terminal instance. * @param list A list of ToolReference objects to choose from. * @return The selected ToolReference object. * @throws IOException if an I/O error occurs during the prompt. */ public ToolReference selectTool(Terminal terminal, List<ToolReference> list) throws IOException { ConsolePrompt.UiConfig uiConfig = new ConsolePrompt.UiConfig("=> ", "[]", "[x]", "-"); ConsolePrompt prompt = new ConsolePrompt(terminal, uiConfig); PromptBuilder builder = prompt.getPromptBuilder(); ListPromptBuilder lpb = builder.createListPrompt().name("tool") .message("Choose the tool you want to edit:").pageSize(5); List<Item> items = formatTable(list); items.stream().forEach( x -> lpb .newItem() .text(x.text) .name(x.id) .add() ); lpb.addPrompt(); Map<String, PromptResultItemIF> result = prompt.prompt(builder.build()); String toolId = result.get("tool").getResult(); ToolReference tool = list.stream().filter(x -> x.getId().equals(toolId)).findFirst().orElse(null); return tool; } /** * Formats a list of ToolReference objects into a human-readable table format * suitable for display in the terminal. It truncates long descriptions and aligns columns. * * @param list The list of ToolReference objects to format. * @return A list of `Item` records, where each `Item` contains the tool's ID and its formatted text representation. */ private List<Item> formatTable(List<ToolReference> list) { final int MAX_DESCRIPTION_DISPLAY_LENGTH = 60; final int COLUMN_PADDING = 3; final String TRUNCATE_INDICATOR = "..."; int maxNameLength = list.stream() .mapToInt(item -> item.getName().length()) .max() .orElse(0); int maxDescriptionDisplayLength = list.stream() .mapToInt(item -> Math.min(item.getDescription().length(), MAX_DESCRIPTION_DISPLAY_LENGTH)) .max() .orElse(0); final int nameColumnWidth = Math.max(maxNameLength + COLUMN_PADDING, "Name".length() + COLUMN_PADDING); final int descriptionColumnWidth = Math.max(maxDescriptionDisplayLength + COLUMN_PADDING, "Description".length() + COLUMN_PADDING); return list.stream().map( item -> { String name = item.getName(); String description = item.getDescription(); if (description.length() > MAX_DESCRIPTION_DISPLAY_LENGTH) { // Adjust for the length of the truncation indicator int truncateTo = MAX_DESCRIPTION_DISPLAY_LENGTH - TRUNCATE_INDICATOR.length(); description = description.substring(0, truncateTo) + TRUNCATE_INDICATOR; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); ps.printf("%-" + nameColumnWidth + "s %-" + descriptionColumnWidth + "s%n", name, description); return new Item(item.getId(), baos.toString()); } ).toList(); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/tools/ToolsGenerate.java
package ai.wanaku.cli.main.commands.tools; import ai.wanaku.api.types.ToolReference; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.converter.URLConverter; import ai.wanaku.cli.main.support.WanakuPrinter; import io.swagger.v3.oas.models.OpenAPI; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.net.URL; import java.util.HashMap; import java.util.List; import java.util.Map; import static ai.wanaku.cli.main.support.ToolHelper.importToolset; import static ai.wanaku.cli.main.support.ToolsGenerateHelper.determineBaseUrl; import static ai.wanaku.cli.main.support.ToolsGenerateHelper.generateToolReferences; import static ai.wanaku.cli.main.support.ToolsGenerateHelper.loadAndResolveOpenAPI; import static ai.wanaku.cli.main.support.ToolsGenerateHelper.writeOutput; @CommandLine.Command(name = "generate", description = "generate tools from an OpenApi specification") public class ToolsGenerate extends BaseCommand { private static final Logger LOG = Logger.getLogger(ToolsGenerate.class); @CommandLine.Option(names = {"--server-url", "-u"}, description = "Override the OpenAPI server base url", arity = "0..1") protected String serverUrl; @CommandLine.Option(names = {"--output-file", "-o"}, description = "path of the file where the toolset will be written. If not set, the toolset will be written to the STDOUT", arity = "0..1") private String outputFile; @CommandLine.Option(names = {"--server-index", "-i"}, description = "index of the server in the server object list in the OpenApi Spec. 0 is the first one.", arity = "0..1") private Integer serverIndex; @CommandLine.Option(names = {"--server-variable", "-v"}, description = "key-value pair for server object variable, can be specified multiple times. Ex '-v environment=prod -v region=us-east'", arity = "0..*") private Map<String, String> serverVariables = new HashMap<>(); @CommandLine.Option(names = {"--import", "-I"}, arity = "0", description = "Import the generated toolset in the registry") private boolean importToolset; @CommandLine.Option(names = {"--import-service-host", "-H"}, description = "The API host used to import the generated toolset ", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @CommandLine.Parameters(description = "location to the OpenAPI spec definition, can be a local path or an URL", arity = "1..1", converter = URLConverter.class) private URL specLocation; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { try { // Load and resolve OpenAPI Spec OpenAPI openAPI = loadAndResolveOpenAPI(specLocation.toString()); if (openAPI == null || openAPI.getPaths() == null || openAPI.getPaths().isEmpty()) { LOG.warn("No paths found in the OpenAPI specification"); return EXIT_ERROR; } // Determine base URL to use String baseUrl = determineBaseUrl(openAPI, serverUrl, serverIndex, serverVariables); // Generate tool references List<ToolReference> toolReferences = generateToolReferences(openAPI, baseUrl); // Write output writeOutput(toolReferences, outputFile); if (importToolset) { System.err.print("\n\nImporting toolset..."); importToolset(toolReferences, host); System.err.print("Done."); } } catch (Exception e) { System.err.println("Error processing OpenAPI specification: " + e.getMessage()); return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/tools/ToolsImport.java
package ai.wanaku.cli.main.commands.tools; import ai.wanaku.api.types.ToolReference; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.converter.URLConverter; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ToolsService; import ai.wanaku.core.util.ToolsetIndexHelper; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.net.URL; import java.util.List; import static ai.wanaku.cli.main.support.ToolHelper.importToolset; @CommandLine.Command(name = "import",description = "Import a toolset") public class ToolsImport extends BaseCommand { private static final Logger LOG = Logger.getLogger(ToolsImport.class); @CommandLine.Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @CommandLine.Parameters(description="location to the toolset, can be a local path or an URL", arity = "1..1", converter = URLConverter.class) private URL location; ToolsService toolsService; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { try { List<ToolReference> toolReferences = ToolsetIndexHelper.loadToolsIndex(location); importToolset(toolReferences, host); } catch (Exception e) { printer.printErrorMessage(String.format("Failed to load tools index: %s", e.getMessage())); throw new RuntimeException(e); } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/tools/ToolsList.java
package ai.wanaku.cli.main.commands.tools; import ai.wanaku.api.types.ToolReference; import ai.wanaku.api.types.WanakuResponse; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ToolsService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.util.List; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; @CommandLine.Command(name = "list", description = "List tools") public class ToolsList extends BaseCommand { private static final Logger LOG = Logger.getLogger(ToolsList.class); @CommandLine.Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; ToolsService toolsService; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { toolsService = initService(ToolsService.class, host); try { WanakuResponse<List<ToolReference>> response = toolsService.list(); List<ToolReference> list = response.data(); printer.printTable(list, "name","type","uri"); } catch (WebApplicationException ex) { Response response = ex.getResponse(); commonResponseErrorHandler(response); return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/tools/ToolsRemove.java
package ai.wanaku.cli.main.commands.tools; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ToolsService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import picocli.CommandLine; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; @CommandLine.Command(name = "remove",description = "Remove tools") public class ToolsRemove extends BaseCommand { private static final Logger LOG = Logger.getLogger(ToolsRemove.class); @CommandLine.Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @CommandLine.Option(names = {"-n", "--name"}, description="Name of the tool to remove", required = true) private String name; ToolsService toolsService; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { toolsService = initService(ToolsService.class, host); try (Response ignored = toolsService.remove(name)) { printer.printSuccessMessage("Successfully removed tool reference '" + name+"'"); } catch (WebApplicationException ex) { Response response = ex.getResponse(); if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { String warningMessage = String.format("Tool not found (%s): %s%n", name, response.getStatusInfo().getReasonPhrase()); printer.printWarningMessage(warningMessage); } else { commonResponseErrorHandler(response); } return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/toolset/ToolSet.java
package ai.wanaku.cli.main.commands.toolset; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.IOException; @CommandLine.Command(name = "toolset", description = "Manage toolsets", subcommands = { ToolSetAdd.class}) public class ToolSet extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { CommandLine.usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/toolset/ToolSetAdd.java
package ai.wanaku.cli.main.commands.toolset; import ai.wanaku.api.types.InputSchema; import ai.wanaku.api.types.Property; import ai.wanaku.api.types.ToolReference; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.PropertyHelper; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.util.ToolsetIndexHelper; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.File; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; @CommandLine.Command(name = "add",description = "Add tools to a toolset") public class ToolSetAdd extends BaseCommand { private static final Logger LOG = Logger.getLogger(ToolSetAdd.class); @CommandLine.Parameters(description="Path to the toolset", arity = "1..1") private String path; @CommandLine.Option(names = {"-n", "--name"}, description="Name of the tool reference", required = true) private String name; @CommandLine.Option(names = {"-d", "--description"}, description="Description of the tool reference", required = true) private String description; @CommandLine.Option(names = {"-u", "--uri"}, description="URI of the tool", required = true) private String uri; @CommandLine.Option(names = {"--type"}, description="Type of the tool reference (i.e: http)", required = true) private String type; @CommandLine.Option(names = {"--input-schema-type"}, description = "Type of input schema (e.g., 'string', 'object')", defaultValue = "object") private String inputSchemaType; @CommandLine.Option(names = {"-p", "--property"}, description = "Property name and value (e.g., '--property name:type,description)") private List<String> properties; @CommandLine.Option(names = {"-r", "--required"}, description = "List of required property names (e.g., '-r foo bar')", arity = "0..*") private List<String> required; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { ToolReference toolReference = new ToolReference(); toolReference.setName(name); toolReference.setDescription(description); toolReference.setUri(uri); toolReference.setType(type); InputSchema inputSchema = new InputSchema(); inputSchema.setType(inputSchemaType); if (properties != null) { for (String propertyStr : properties) { PropertyHelper.PropertyDescription result = PropertyHelper.parseProperty(propertyStr); Property property = new Property(); property.setType(result.dataType()); property.setDescription(result.description()); inputSchema.getProperties().put(result.propertyName(), property); } } toolReference.setInputSchema(inputSchema); if (required != null) { inputSchema.setRequired(required); } try { List<ToolReference> toolReferences; File indexFile = new File(path); if (indexFile.exists()) { toolReferences = ToolsetIndexHelper.loadToolsIndex(indexFile); } else { Files.createDirectories(indexFile.getParentFile().toPath()); toolReferences = new ArrayList<>(); } toolReferences.add(toolReference); ToolsetIndexHelper.saveToolsIndex(indexFile, toolReferences); } catch (Exception e) { printer.printErrorMessage(String.format("Failed to load tools index: %s", e.getMessage())); throw new RuntimeException(e); } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/converter/URLConverter.java
package ai.wanaku.cli.main.converter; import picocli.CommandLine; import java.io.File; import java.net.URL; public class URLConverter implements CommandLine.ITypeConverter<URL> { /** * * @param value the command line argument String value * @return the URL object * @throws Exception if any error occurs during the conversion. */ @Override public URL convert(String value) throws Exception { try { return new URL(value); } catch (Exception e){ // so it's not an URL, maybe a local path? } // try if is a local path return new File(value).toURI().toURL(); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/CapabilitiesHelper.java
package ai.wanaku.cli.main.support; import ai.wanaku.api.exceptions.WanakuException; import ai.wanaku.api.types.WanakuResponse; import ai.wanaku.api.types.discovery.ActivityRecord; import ai.wanaku.api.types.providers.ServiceTarget; import ai.wanaku.api.types.providers.ServiceType; import ai.wanaku.core.services.api.TargetsService; import io.quarkus.runtime.annotations.RegisterForReflection; import io.smallrye.mutiny.Uni; import java.time.Duration; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; /** * Utility class providing capabilities management functionality for the Wanaku CLI. * * <p>This class handles the fetching, merging, and processing of service capabilities * from various sources including management tools and resource providers. It provides * methods to combine activity states, format data for display, and create printable * representations of service capabilities. * * <p>The class follows a reactive programming model using Mutiny's {@link Uni} for * asynchronous operations and provides comprehensive error handling for API calls. * * @author Wanaku Team * @version 1.0 * @since 1.0 */ public final class CapabilitiesHelper { // Constants /** * Default timeout duration for API calls. */ public static final Duration API_TIMEOUT = Duration.ofSeconds(15); /** * Default status value used when actual status is unavailable. */ public static final String DEFAULT_STATUS = "-"; /** * Status value indicating an active service. */ public static final String ACTIVE_STATUS = "active"; /** * Status value indicating an inactive service. */ public static final String INACTIVE_STATUS = "inactive"; /** * Formatter for verbose timestamp display. * Format: "EEE, MMM dd, yyyy 'at' HH:mm:ss" (e.g., "Mon, Jan 15, 2024 at 14:30:45") */ public static final DateTimeFormatter VERBOSE_TIMESTAMP_FORMATTER = DateTimeFormatter.ofPattern("EEE, MMM dd, yyyy 'at' HH:mm:ss"); /** * Standard column names for capability display. * <p>This array defines the order and names of columns when displaying * capabilities in table or map format. The order matches the fields * in {@link PrintableCapability}. */ public static final String [] COLUMNS = {"service", "serviceType", "host", "port", "status", "lastSeen"}; /** * Private constructor to prevent instantiation of this utility class. * * @throws UnsupportedOperationException if instantiation is attempted */ private CapabilitiesHelper() { throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); } /** * Fetches and merges capabilities from multiple sources asynchronously. * * <p>This method combines data from management tools and resource providers, * along with their respective activity states, to create a unified list of * printable capabilities. * * @param targetsService the service used to fetch target information * @return a {@link Uni} emitting a list of {@link PrintableCapability} objects * @throws NullPointerException if targetsService is null * @see #combineDataIntoCapabilities(List) */ public static Uni<List<PrintableCapability>> fetchAndMergeCapabilities(TargetsService targetsService) { Objects.requireNonNull(targetsService, "TargetsService cannot be null"); return Uni.combine() .all() .unis( fetchManagementTools(targetsService), fetchToolsActivityState(targetsService), fetchResourceProviders(targetsService), fetchResourcesActivityState(targetsService) ) .with(CapabilitiesHelper::combineDataIntoCapabilities); } /** * Combines fetched data from multiple sources into a list of printable capabilities. * * <p>This method expects exactly 4 responses in the following order: * <ol> * <li>Management tools list</li> * <li>Tools activity state map</li> * <li>Resource providers list</li> * <li>Resources activity state map</li> * </ol> * * @param responses list containing exactly 4 responses from API calls * @return list of {@link PrintableCapability} objects * @throws IndexOutOfBoundsException if responses list doesn't contain exactly 4 elements * @throws ClassCastException if response types don't match expected types */ @SuppressWarnings("unchecked") public static List<PrintableCapability> combineDataIntoCapabilities(List<?> responses) { if (responses.size() != 4) { throw new IndexOutOfBoundsException("Expected exactly 4 responses, got: " + responses.size()); } var managementTools = (List<ServiceTarget>) responses.get(0); var toolsActivityState = (Map<String, List<ActivityRecord>>) responses.get(1); var resourceProviders = (List<ServiceTarget>) responses.get(2); var resourcesActivityState = (Map<String, List<ActivityRecord>>) responses.get(3); var mergedActivityStates = mergeActivityStates(toolsActivityState, resourcesActivityState); var allServiceTargets = Stream.concat( managementTools.stream(), resourceProviders.stream() ).toList(); return allServiceTargets.stream() .map(target -> createPrintableCapability(target, mergedActivityStates)) .toList(); } /** * Merges two activity state maps into a single map. * * <p>When duplicate keys are found, the activity records from both maps * are combined into a single list for that key. * * @param toolsActivityState activity state map for management tools * @param resourcesActivityState activity state map for resource providers * @return merged activity state map with immutable value lists * @throws NullPointerException if either parameter is null */ public static Map<String, List<ActivityRecord>> mergeActivityStates( Map<String, List<ActivityRecord>> toolsActivityState, Map<String, List<ActivityRecord>> resourcesActivityState) { Objects.requireNonNull(toolsActivityState, "Tools activity state map cannot be null"); Objects.requireNonNull(resourcesActivityState, "Resources activity state map cannot be null"); return Stream.concat( toolsActivityState.entrySet().stream(), resourcesActivityState.entrySet().stream() ) .collect(Collectors.toMap( Map.Entry::getKey, CapabilitiesHelper::getActivityRecords, // Create immutable copy (existingList, newList) -> Stream.concat( existingList.stream(), newList.stream() ).toList() )); } private static List<ActivityRecord> getActivityRecords(Map.Entry<String, List<ActivityRecord>> entry) { final List<ActivityRecord> value = entry.getValue(); if (!value.isEmpty()) { // We need to filter orphaned records without activity state return value.stream().filter(Objects::nonNull).toList(); } return List.of(); } /** * Finds the activity record for a specific service target. * * <p>Searches through the activity states map to find a matching activity record * based on service name and target ID. * * @param serviceTarget the service target to find activity record for * @param activityStates map of activity states indexed by service name * @return the matching {@link ActivityRecord} or null if not found * @throws NullPointerException if either parameter is null */ public static ActivityRecord findActivityRecord( ServiceTarget serviceTarget, Map<String, List<ActivityRecord>> activityStates) { Objects.requireNonNull(serviceTarget, "ServiceTarget cannot be null"); Objects.requireNonNull(activityStates, "Activity states map cannot be null"); return Optional.ofNullable(activityStates.get(serviceTarget.getService())) .orElse(List.of()) .stream() .filter(record -> record.getId().equals(serviceTarget.getId())) .findFirst() .orElse(null); } /** * Creates a printable capability from a service target and activity states. * * <p>This method combines service target information with its corresponding * activity record to create a formatted representation suitable for display. * * @param serviceTarget the service target containing basic service information * @param activityStates map of activity states to find matching activity record * @return a {@link PrintableCapability} with formatted service information * @throws NullPointerException if either parameter is null */ public static PrintableCapability createPrintableCapability( ServiceTarget serviceTarget, Map<String, List<ActivityRecord>> activityStates) { Objects.requireNonNull(serviceTarget, "ServiceTarget cannot be null"); Objects.requireNonNull(activityStates, "Activity states map cannot be null"); var activityRecord = findActivityRecord(serviceTarget, activityStates); return new PrintableCapability( Optional.ofNullable(serviceTarget.getService()).orElse(DEFAULT_STATUS), Optional.ofNullable(serviceTarget.getServiceType()) .map(ServiceType::asValue) .orElse(DEFAULT_STATUS), Optional.ofNullable(serviceTarget.getHost()).orElse(DEFAULT_STATUS), serviceTarget.getPort(), determineServiceStatus(activityRecord), formatLastSeenTimestamp(activityRecord), // TODO: Implement configuration processing when requirements are clarified processServiceConfigurations(Map.of()) ); } /** * Fetches the list of management tools from the targets service. * * @param targetsService the service to fetch management tools from * @return a {@link Uni} emitting a list of {@link ServiceTarget} objects * @throws NullPointerException if targetsService is null */ public static Uni<List<ServiceTarget>> fetchManagementTools(TargetsService targetsService) { Objects.requireNonNull(targetsService, "TargetsService cannot be null"); return executeApiCall(targetsService::toolsList, List.of()); } /** * Fetches the activity state for management tools. * * @param targetsService the service to fetch activity state from * @return a {@link Uni} emitting a map of service names to activity records * @throws NullPointerException if targetsService is null */ public static Uni<Map<String, List<ActivityRecord>>> fetchToolsActivityState(TargetsService targetsService) { Objects.requireNonNull(targetsService, "TargetsService cannot be null"); return executeApiCall(targetsService::toolsState, Map.of()); } /** * Fetches the list of resource providers from the targets service. * * @param targetsService the service to fetch resource providers from * @return a {@link Uni} emitting a list of {@link ServiceTarget} objects * @throws NullPointerException if targetsService is null */ public static Uni<List<ServiceTarget>> fetchResourceProviders(TargetsService targetsService) { Objects.requireNonNull(targetsService, "TargetsService cannot be null"); return executeApiCall(targetsService::resourcesList, List.of()); } /** * Fetches the activity state for resource providers. * * @param targetsService the service to fetch activity state from * @return a {@link Uni} emitting a map of service names to activity records * @throws NullPointerException if targetsService is null */ public static Uni<Map<String, List<ActivityRecord>>> fetchResourcesActivityState(TargetsService targetsService) { Objects.requireNonNull(targetsService, "TargetsService cannot be null"); return executeApiCall(targetsService::resourcesState, Map.of()); } /** * Executes an API call with error handling and fallback to default value. * * <p>This method provides a consistent way to handle API calls that return * {@link WanakuResponse} objects. If the response contains an error or if * an exception occurs, the method returns the provided default value. * * @param <T> the type of data returned by the API call * @param apiCall supplier that performs the API call * @param defaultValue value to return in case of error or exception * @return a {@link Uni} emitting either the API response data or the default value * @throws NullPointerException if apiCall is null * @throws WanakuException if the API call fails with an exception */ public static <T> Uni<T> executeApiCall(Supplier<WanakuResponse<T>> apiCall, T defaultValue) { Objects.requireNonNull(apiCall, "API call supplier cannot be null"); try { var response = apiCall.get(); return response.error() != null ? Uni.createFrom().item(defaultValue) : Uni.createFrom().item(response.data()); } catch (Exception e) { // Consider adding logging in production environment // Logger.warn("API call failed", e); throw new WanakuException("API call failed.", e); } } /** * Determines the service status based on activity record. * * @param activityRecord the activity record to check (may be null) * @return {@link #ACTIVE_STATUS}, {@link #INACTIVE_STATUS}, or {@link #DEFAULT_STATUS} */ public static String determineServiceStatus(ActivityRecord activityRecord) { if (activityRecord == null) { return DEFAULT_STATUS; } return activityRecord.isActive() ? ACTIVE_STATUS : INACTIVE_STATUS; } /** * Formats the last seen timestamp from an activity record. * * <p>The timestamp is formatted using the system default timezone and the * {@link #VERBOSE_TIMESTAMP_FORMATTER} pattern. * * @param activityRecord the activity record containing the timestamp (may be null) * @return formatted timestamp string or empty string if record is null or has no timestamp */ public static String formatLastSeenTimestamp(ActivityRecord activityRecord) { return Optional.ofNullable(activityRecord) .map(ActivityRecord::getLastSeen) .map(instant -> instant.atZone(ZoneId.systemDefault())) .map(zonedDateTime -> zonedDateTime.format(VERBOSE_TIMESTAMP_FORMATTER)) .orElse(""); } /** * Processes service configurations into printable format. * * <p><strong>Note:</strong> This method currently returns an empty list as * configuration processing requirements are not yet finalized. * * @param configurations map of configuration key-value pairs * @return list of {@link PrintableCapabilityConfiguration} objects (currently empty) */ public static List<PrintableCapabilityConfiguration> processServiceConfigurations( Map<String, String> configurations) { if (configurations == null || configurations.isEmpty()) { return List.of(); } return configurations.entrySet() .stream() .map(entry -> new PrintableCapabilityConfiguration( entry.getKey(), entry.getValue())) .toList(); } /** * Prints a list of capabilities in table format. * * @param capabilities list of capabilities to print * @param printer the printer to use for output * @throws NullPointerException if either parameter is null */ public static void printCapabilities(List<PrintableCapability> capabilities, WanakuPrinter printer) { Objects.requireNonNull(capabilities, "Capabilities list cannot be null"); Objects.requireNonNull(printer, "Printer cannot be null"); printer.printTable(capabilities, COLUMNS); } /** * Prints a single capability in map format. * * @param capability the capability to print * @param printer the printer to use for output * @throws NullPointerException if either parameter is null */ public static void printCapability(PrintableCapability capability, WanakuPrinter printer) { Objects.requireNonNull(capability, "Capability cannot be null"); Objects.requireNonNull(printer, "Printer cannot be null"); printer.printAsMap(capability, COLUMNS); } /** * Record representing a printable capability with all necessary display information. * * <p>This record encapsulates service information in a format suitable for * display in CLI output, including service details, status, and timestamp information. * * @param service the service name * @param serviceType the type of service * @param host the host address * @param port the port number * @param status the current status of the service * @param lastSeen formatted timestamp of last activity * @param configurations list of service configurations */ @RegisterForReflection public record PrintableCapability( String service, String serviceType, String host, int port, String status, String lastSeen, List<PrintableCapabilityConfiguration> configurations) { /** * Compact constructor that ensures all string fields are non-null. * * <p>Null values are replaced with empty strings, and null configurations * list is replaced with an empty list. */ public PrintableCapability { service = Objects.requireNonNullElse(service, ""); serviceType = Objects.requireNonNullElse(serviceType, ""); host = Objects.requireNonNullElse(host, ""); status = Objects.requireNonNullElse(status, ""); lastSeen = Objects.requireNonNullElse(lastSeen, ""); configurations = Objects.requireNonNullElse(configurations, List.of()); } } /** * Record representing a service configuration in printable format. * * @param name the configuration name/key * @param description the configuration description/value */ @RegisterForReflection public record PrintableCapabilityConfiguration(String name, String description) { /** * Compact constructor that ensures all fields are non-null. * * <p>Null values are replaced with empty strings. */ public PrintableCapabilityConfiguration { name = Objects.requireNonNullElse(name, ""); description = Objects.requireNonNullElse(description, ""); } } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/Downloader.java
package ai.wanaku.cli.main.support; import ai.wanaku.api.exceptions.WanakuException; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.net.MalformedURLException; import java.net.URL; import org.jboss.logging.Logger; public class Downloader { private static final Logger LOG = Logger.getLogger(Downloader.class); private static String getFileNameFromUrl(String url) { int lastIndex = url.lastIndexOf("/"); if (lastIndex != -1) { return url.substring(lastIndex + 1); } throw new WanakuException("Invalid url: " + url); } public static File downloadFile(String url, File directory) throws MalformedURLException { String fileName = getFileNameFromUrl(url); File localFile = new File(directory, fileName); if (localFile.exists()) { LOG.infof("Local file %s already exists", fileName); return localFile; } URL remoteFile = new URL(url); try (InputStream in = remoteFile.openStream()) { File parentDir = localFile.getParentFile(); Files.createDirectories(parentDir.toPath()); try (OutputStream out = new FileOutputStream(localFile)) { in.transferTo(out); } } catch (IOException e) { throw new WanakuException(e); } LOG.infof("File downloaded successfully to: %s", localFile.getAbsolutePath()); return localFile; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/FileHelper.java
package ai.wanaku.cli.main.support; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.function.Consumer; public class FileHelper { private FileHelper() {} public static boolean canWriteToDirectory(Path dir) { if (dir == null) { return false; } try { Path tempFile = Files.createTempFile(dir, "wanaku-test", ".tmp"); Files.delete(tempFile); return true; } catch (IOException e) { return false; } } public static boolean cannotWriteToDirectory(Path dir) { return !canWriteToDirectory(dir); } public static void loadConfigurationSources(String source, Consumer<String> configSourceConsumer) { if (source != null) { try { final String data = Files.readString(Path.of(source)); configSourceConsumer.accept(data); } catch (IOException e) { throw new RuntimeException(e); } } } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/PropertyHelper.java
package ai.wanaku.cli.main.support; public class PropertyHelper { public record PropertyDescription(String propertyName, String dataType, String description) { } public static PropertyDescription parseProperty(String propertyStr) { int nameDelimiter = propertyStr.indexOf(":"); int typeDelimiter = propertyStr.indexOf(","); String propertyName = propertyStr.substring(0, nameDelimiter); String dataType = propertyStr.substring(nameDelimiter + 1, typeDelimiter); String description = propertyStr.substring(typeDelimiter + 1); return new PropertyDescription(propertyName, dataType, description); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/ResponseHelper.java
package ai.wanaku.cli.main.support; import jakarta.ws.rs.core.Response; import org.jline.terminal.Terminal; import java.io.IOException; public final class ResponseHelper { private ResponseHelper() {} public static void commonResponseErrorHandler(Response response) throws IOException { try (Terminal terminal = WanakuPrinter.terminalInstance()) { WanakuPrinter printer = new WanakuPrinter(null, terminal); String message; if (response.getStatus() == Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()) { message = String.format("The server was unable to handle the request: %s%n", response.getStatusInfo().getReasonPhrase()); printer.printErrorMessage(message); } else { message = String.format("Unspecified error (status: %d, reason: %s)%n", response.getStatus(), response.getStatusInfo().getReasonPhrase()); printer.printErrorMessage(message); } } } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/RuntimeConstants.java
package ai.wanaku.cli.main.support; import java.io.File; public class RuntimeConstants { public static final String WANAKU_HOME_DIR; public static final String WANAKU_CACHE_DIR; public static final String WANAKU_LOCAL_DIR; public static final String WANAKU_ROUTER = "wanaku-router"; static { WANAKU_HOME_DIR = System.getProperty("user.home") + File.separator + ".wanaku"; WANAKU_CACHE_DIR = WANAKU_HOME_DIR + File.separator + "cache"; WANAKU_LOCAL_DIR = WANAKU_HOME_DIR + File.separator + "local"; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/StringHelper.java
package ai.wanaku.cli.main.support; /** * Helper methods for working with Strings. */ public class StringHelper { /** * Constructor of utility class should be private. */ private StringHelper() { } /** * Asserts whether the string is <b>not</b> empty. * * @param value the string to test * @return {@code true} if {@code value} is not null and not blank, {@code false} otherwise. */ public static boolean isNotEmpty(String value) { return !isEmpty(value); } /** * Asserts whether the string is empty. * * @param value the string to test * @return {@code true} if {@code value} is null and blank, {@code false} otherwise. */ public static boolean isEmpty(String value) { return value == null || value.isBlank(); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/TargetsHelper.java
package ai.wanaku.cli.main.support; import ai.wanaku.api.types.discovery.ActivityRecord; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import static ai.wanaku.cli.main.support.CapabilitiesHelper.formatLastSeenTimestamp; public class TargetsHelper { /** * Private constructor to prevent instantiation of this utility class. */ private TargetsHelper(){} /** * Converts a map of service states to a list of printable target representations. * Each target is represented as a map containing display-friendly key-value pairs * suitable for reporting or user interface purposes. * * @param states a map where keys are service names and values are lists of * {@link ActivityRecord} objects representing the activities * for each service. Must not be null. * @return a list of maps, where each map represents a single target with the * following keys: * <ul> * <li>"id" - the activity record ID</li> * <li>"service" - the service name</li> * <li>"active" - string representation of the activity status ("true"/"false")</li> * <li>"last_seen" - formatted timestamp of when the activity was last seen</li> * </ul> * Returns an empty list if the input map is empty or contains no activities. * @throws NullPointerException if {@code states} is null or contains null values * @throws RuntimeException if {@code formatLastSeenTimestamp} fails for any activity record * * @see ActivityRecord * @since 1.0 */ public static List<Map<String, String>> getPrintableTargets( Map<String, List<ActivityRecord>> states) { if (states == null) { throw new IllegalArgumentException("States map cannot be null"); } return states.entrySet() .stream() .filter(entry -> entry.getValue() != null) .flatMap(entry -> entry.getValue() .stream() .filter(Objects::nonNull) .map(activityRecord -> createTargetMap(entry.getKey(), activityRecord)) ) .toList(); } /** * Creates a printable target map from a service name and activity record. * This is a helper method to improve readability and maintainability. * * @param serviceName the name of the service * @param activityRecord the activity record to convert * @return a map containing the printable representation of the target */ public static Map<String, String> createTargetMap(String serviceName, ActivityRecord activityRecord) { Map<String, String> targetMap = new HashMap<>(); targetMap.put("id", activityRecord.getId()); targetMap.put("service", serviceName); targetMap.put("active", String.valueOf(activityRecord.isActive())); targetMap.put("last_seen", formatLastSeenTimestamp(activityRecord)); // Note: underscore for consistency return targetMap; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/ToolHelper.java
package ai.wanaku.cli.main.support; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import ai.wanaku.api.types.ToolReference; import ai.wanaku.api.types.WanakuResponse; import ai.wanaku.core.services.api.ToolsService; import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder; import java.io.IOException; import java.net.URI; import java.util.List; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; public class ToolHelper { /** * Private constructor to prevent instantiation of this utility class. */ private ToolHelper(){} /** * Imports a list of tool references to the specified host. * <p> * Creates a Quarkus REST client for the {@link ToolsService} at the given host * and adds each tool reference from the provided list to the service. * </p> * * @param toolReferences a list of tool references to import * @param host the base URI of the host where the ToolsService is deployed * @throws IllegalArgumentException if the host URI is invalid * @throws RuntimeException if there's an error connecting to or communicating with the service */ public static void importToolset (List<ToolReference> toolReferences, String host) throws IOException { ToolsService toolsService = QuarkusRestClientBuilder.newBuilder() .baseUri(URI.create(host)) .build(ToolsService.class); for (var toolReference : toolReferences) { try { WanakuResponse<ToolReference> ignored = toolsService.add(toolReference); } catch (WebApplicationException ex) { Response response = ex.getResponse(); if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { System.err.printf("There is no downstream service capable of handling requests of the given type (%s): %s%n", toolReference.getType(), response.getStatusInfo().getReasonPhrase()); System.exit(1); } else { commonResponseErrorHandler(response); } } } } /** * Imports a single tool reference to the specified host. * <p> * Convenience method that wraps the single tool reference in a list * and delegates to {@link #importToolset(List, String)}. * </p> * * @param toolReference the tool reference to import * @param host the base URI of the host where the ToolsService is deployed * @throws IllegalArgumentException if the host URI is invalid * @throws RuntimeException if there's an error connecting to or communicating with the service * @see #importToolset(List, String) */ public static void importToolset (ToolReference toolReference, String host) throws IOException { importToolset(List.of(toolReference), host); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/ToolsGenerateHelper.java
package ai.wanaku.cli.main.support; import ai.wanaku.api.types.InputSchema; import ai.wanaku.api.types.Property; import ai.wanaku.api.types.ToolReference; import ai.wanaku.core.util.CollectionsHelper; import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.OpenAPIV3Parser; import io.swagger.v3.parser.core.models.ParseOptions; import io.swagger.v3.parser.util.ResolverFully; import org.jboss.logging.Logger; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.regex.Pattern; import java.util.stream.Stream; import static ai.wanaku.cli.main.support.FileHelper.cannotWriteToDirectory; import static ai.wanaku.cli.main.support.StringHelper.isEmpty; import static ai.wanaku.cli.main.support.StringHelper.isNotEmpty; import static ai.wanaku.core.util.ReservedArgumentNames.BODY; import static ai.wanaku.core.util.ReservedPropertyNames.SCOPE_SERVICE; import static ai.wanaku.core.util.ReservedPropertyNames.TARGET_COOKIE; import static ai.wanaku.core.util.ReservedPropertyNames.TARGET_HEADER; import static java.util.stream.Collectors.toMap; import static org.apache.commons.lang3.StringUtils.isNotBlank; public class ToolsGenerateHelper { private static final Logger LOG = Logger.getLogger(ToolsGenerateHelper.class); private static final String HTTP_TOOL_TYPE = "http"; private static final String DEFAULT_OUTPUT_FILENAME = "out.json"; private static final Pattern PARAMETER_PATTERN = Pattern.compile("\\{(.+?)\\}"); private ToolsGenerateHelper() { } /** * Loads and resolves an OpenAPI specification from the given location. * * @param specLocation The file path or URL of the OpenAPI specification * @return A fully resolved OpenAPI object */ public static OpenAPI loadAndResolveOpenAPI(String specLocation) { ParseOptions options = new ParseOptions(); options.setResolve(true); options.setResolveFully(true); OpenAPI openAPI = new OpenAPIV3Parser().read(specLocation, null, options); if (openAPI != null) { new ResolverFully().resolveFully(openAPI); } return openAPI; } /** * Determines the base URL to use for API calls based on available information. * First checks if a server URL is explicitly provided, then falls back to servers defined in the OpenAPI spec. * * @param openAPI The OpenAPI specification object * @param serverUrl A server URL that overrides the ones in the OpenAPI spec (may be null) * @param serverIndex The index of the server to use from the OpenAPI spec's servers list (if serverUrl is not provided) * @param serverVariables Map of variable names to values for server URL templating * @return The resolved base URL for API calls */ public static String determineBaseUrl(OpenAPI openAPI, String serverUrl, Integer serverIndex, Map<String, String> serverVariables) { // If serverUrl is specified, use it if (isNotBlank(serverUrl)) { return serverUrl; } // Otherwise, use servers from the OpenAPI specification if (CollectionsHelper.isEmpty(openAPI.getServers())) { LOG.error("No servers found in the OpenAPI specification"); System.err.println("No servers found in the OpenAPI specification or specified in the 'serverUrl' parameter"); System.exit(-1); } int index = serverIndex != null ? serverIndex : 0; Server server = openAPI.getServers().get(index); // If no server variables, just return the URL if (server.getVariables() == null || server.getVariables().isEmpty()) { return server.getUrl(); } // Otherwise, interpolate the server URL with variables return interpolateServerUrl(server, serverVariables); } /** * Generates tool references for all paths and operations in the OpenAPI specification. * * @param openAPI The OpenAPI specification object * @param baseUrl The base URL to use for API calls * @return A list of tool references */ public static List<ToolReference> generateToolReferences(OpenAPI openAPI, String baseUrl) { return openAPI.getPaths().entrySet().stream() .filter(entry -> Objects.nonNull(entry.getValue())) .map(entry -> pathItem2ToolReferences(baseUrl, entry.getKey(), entry.getValue())) .flatMap(List::stream) .toList(); } /** * Writes the tool references to the specified output location as JSON. * * @param toolReferences The list of tool references to write * @param output The output path or null to write to standard output * @throws Exception If an error occurs during writing */ public static void writeOutput(List<ToolReference> toolReferences, String output) throws Exception { try (PrintWriter out = getOutputPrintWriter(output)) { new ObjectMapper() .writerWithDefaultPrettyPrinter() .writeValue(out, toolReferences); } catch (Exception e) { LOG.trace("Error writing toolset", e); throw e; } } /** * Converts a PathItem and its operations into a list of tool references. * * @param baseUrl The base URL for the API * @param path The path from the OpenAPI specification * @param pathItem The PathItem object containing the operations * @return A list of tool references, one for each operation in the PathItem */ public static List<ToolReference> pathItem2ToolReferences(String baseUrl, String path, PathItem pathItem) { if (pathItem == null) { return List.of(); } record OperationEntry(String method, Operation operation) {} return Stream.of( new OperationEntry("GET", pathItem.getGet()), new OperationEntry("POST", pathItem.getPost()), new OperationEntry("PUT", pathItem.getPut()), new OperationEntry("DELETE", pathItem.getDelete()), new OperationEntry("PATCH", pathItem.getPatch()), new OperationEntry("OPTIONS", pathItem.getOptions()), new OperationEntry("HEAD", pathItem.getHead()), new OperationEntry("TRACE", pathItem.getTrace()) ) .filter(entry -> entry.operation() != null) .map(entry -> operation2ToolReference(pathItem, entry.operation(), baseUrl, path, entry.method())) .toList(); } /** * Converts an operation to a tool reference. * * @param pathItem The PathItem containing the operation * @param operation The Operation to convert * @param baseUrl The base URL for the API * @param path The path from the OpenAPI specification * @param method The HTTP method for this operation * @return A ToolReference representing the operation */ public static ToolReference operation2ToolReference(PathItem pathItem, Operation operation, String baseUrl, String path, String method) { ToolReference toolReference = new ToolReference(); // Set basic properties toolReference.setName(operation.getOperationId()); toolReference.setDescription(operation.getDescription()); toolReference.setType(HTTP_TOOL_TYPE); // Determine URI String uri = determineOperationUri(operation, baseUrl); toolReference.setUri(toolReferenceUrl(uri, path)); List<Parameter> parameters = pathItem.getParameters() != null ? pathItem.getParameters() : List.of(); if (operation.getParameters() != null) { parameters = Stream.concat(operation.getParameters().stream(),parameters.stream()).toList(); } // Set input schema InputSchema inputSchema = parameters2InputSchema(parameters, operation.getRequestBody()); // Add HTTP method parameter addHttpMethodProperty(inputSchema, method); toolReference.setInputSchema(inputSchema); return toolReference; } /** * Determines the URI to use for an operation. * First checks if a base URL is provided, then falls back to servers defined in the operation. * * @param operation The Operation object * @param baseUrl The default base URL to use * @return The URI to use for this operation */ public static String determineOperationUri(Operation operation, String baseUrl) { return Optional.ofNullable(baseUrl) .orElseGet(() -> Optional.ofNullable(operation.getServers()) .filter(CollectionsHelper::isNotEmpty) .flatMap(servers -> servers.stream() .filter(server -> isNotEmpty(server.getUrl())) .findFirst() .map(Server::getUrl)) .orElse(baseUrl) ); } /** * Adds the HTTP method as a property to the input schema. * * @param inputSchema The input schema to modify * @param method The HTTP method to add */ public static void addHttpMethodProperty(InputSchema inputSchema, String method) { Property property = new Property(); property.setTarget(TARGET_HEADER); property.setType("string"); property.setScope(SCOPE_SERVICE); property.setDescription("HTTP method to use when call the service."); property.setValue(method); inputSchema.getProperties().put("CamelHttpMethod", property); } /** * Converts OpenAPI parameters and request body to an input schema for the tool reference. * * @param parameters The list of parameters from the OpenAPI specification * @param requestBody The request body from the OpenAPI specification * @return An InputSchema object representing the parameters and request body */ public static InputSchema parameters2InputSchema(List<Parameter> parameters, RequestBody requestBody) { List<String> requiredParams = new ArrayList<>(); Map<String, Property> properties = new HashMap<>(); InputSchema inputSchema = new InputSchema(); inputSchema.setType("object"); inputSchema.setRequired(requiredParams); inputSchema.setProperties(properties); // Process parameters parameters.forEach(parameter -> { properties.put(parameter.getName(), parameter2Property(parameter)); if (Boolean.TRUE.equals(parameter.getRequired())) { requiredParams.add(parameter.getName()); } }); // Process request body if present if (requestBody != null) { if (Boolean.TRUE.equals(requestBody.getRequired())) { requiredParams.add(BODY); } Property body = new Property(); body.setType("string"); properties.put(BODY, body); } return inputSchema; } /** * Converts an OpenAPI parameter to a tool reference property. * * @param parameter The OpenAPI parameter to convert * @return A Property object representing the parameter */ public static Property parameter2Property(Parameter parameter) { Property property = new Property(); property.setDescription(parameter.getDescription()); property.setType("string"); property.setScope(SCOPE_SERVICE); // Set target based on parameter location switch (parameter.getIn()) { case "header" -> property.setTarget(TARGET_HEADER); case "cookie" -> property.setTarget(TARGET_COOKIE); // Other cases (query, path) don't need special handling } return property; } /** * Creates a URL template for the tool reference by replacing path parameters with the tool reference format. * * @param baseUrl The base URL for the API * @param path The path from the OpenAPI specification * @return A URL template for the tool reference */ public static String toolReferenceUrl(String baseUrl, String path) { return baseUrl + PARAMETER_PATTERN.matcher(path) .replaceAll(matchResult -> String.format("{parameter.value('%s')}", matchResult.group(1)) ); } /** * Interpolates the server URL with the provided variables. * Uses default values for any variables not explicitly provided. * * @param server The Server object containing the URL template and variables * @param variables Map of variable names to values (may be null or empty) * @return The interpolated server URL */ public static String interpolateServerUrl(Server server, Map<String, String> variables) { String result = server.getUrl(); if (CollectionsHelper.isEmpty(server.getVariables())) { return result; } Map<String, String> replacements = server.getVariables().entrySet() .stream() .map(e -> Map.entry(e.getKey(), e.getValue().getDefault())) .collect(toMap(Map.Entry::getKey, Map.Entry::getValue)); if (CollectionsHelper.isNotEmpty(variables)) { variables = variables.entrySet().stream() .filter(e -> isNotEmpty(e.getKey()) && isNotEmpty(e.getValue())) .collect(toMap(Map.Entry::getKey, Map.Entry::getValue)); //Replace replacements.putAll(variables); } for (var entry : replacements.entrySet()) { result = result.replace("{" + entry.getKey() + "}", entry.getValue()); } return result; } /** * Gets a PrintWriter for the specified outputFile location. * If outputFile is null or empty, returns a PrintWriter for standard outputFile. * Otherwise, returns a PrintWriter for the specified file. * * @param output The outputFile path or null for standard outputFile * @return A PrintWriter for the specified outputFile * @throws Exception If the outputFile file cannot be created or written to */ public static PrintWriter getOutputPrintWriter(String output) throws Exception { if (isEmpty(output)) { // Write to STDOUT return new PrintWriter(System.out); } Path outputPath = Paths.get(output); // Handle directory case if (Files.isDirectory(outputPath)) { String newFilePath = outputPath.resolve(DEFAULT_OUTPUT_FILENAME).toString(); System.err.println("Warning: outputFile file " + output + " is a directory. The tools list will be written to " + newFilePath); outputPath = Paths.get(newFilePath); } // Check if file exists if (Files.exists(outputPath)) { String errorMessage = "Output file " + output + " already exists."; System.err.println(errorMessage); throw new Exception(errorMessage); } Path parent = outputPath.getParent() == null ? Path.of(".") : outputPath.getParent(); // Check if parent directory is writable if (cannotWriteToDirectory(parent)) { String errorMessage = "Cannot write to directory: " + parent; System.err.println(errorMessage); throw new Exception(errorMessage); } try { return new PrintWriter(new FileWriter(outputPath.toString())); } catch (IOException e) { String errorMessage = "Could not open outputFile file "+ output + " :" + e.getMessage(); LOG.error(errorMessage); System.err.println(errorMessage); throw new Exception(errorMessage); } } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/WanakuCliConfig.java
package ai.wanaku.cli.main.support; import ai.wanaku.core.config.WanakuConfig; import io.smallrye.config.ConfigMapping; import io.smallrye.config.WithDefault; import java.util.List; import java.util.Map; @ConfigMapping(prefix = "wanaku.cli") public interface WanakuCliConfig extends WanakuConfig { interface Tool { String createCmd(); } interface Resource { String createCmd(); } Tool tool(); Resource resource(); @WithDefault("early-access") String earlyAccessTag(); List<String> defaultServices(); /** * Returns a map of components that can be used in the getting started * * @return A map of component */ Map<String, String> components(); /** * Every service needs its own gRPC port. The CLI increases it automatically * starting from this port number * @return the port */ @WithDefault("9000") int initialGrpcPort(); @WithDefault("5") int routerStartWaitSecs(); }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/WanakuPrinter.java
package ai.wanaku.cli.main.support; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import org.jline.builtins.ConfigurationPath; import org.jline.builtins.Styles; import org.jline.console.impl.DefaultPrinter; import org.jline.terminal.Terminal; import org.jline.terminal.TerminalBuilder; import org.jline.utils.AttributedString; import org.jline.utils.AttributedStringBuilder; import org.jline.utils.AttributedStyle; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.function.Function; import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; import static java.util.stream.Collectors.toMap; import static org.jline.console.Printer.TableRows.EVEN; /** * Enhanced printer utility for the Wanaku CLI application that provides formatted output capabilities. * * <p>This class extends JLine's {@link DefaultPrinter} to provide a rich set of printing methods * with consistent styling and formatting for terminal output. It supports various output formats * including styled messages, tables, and object representations.</p> * * <p>Key features include:</p> * <ul> * <li>Styled message printing (error, warning, info, success)</li> * <li>Table printing with customizable options and column selection</li> * <li>Object-to-map conversion and printing</li> * <li>Exception highlighting with configurable display modes</li> * <li>Terminal color and ANSI support</li> * </ul> * * <p>Example usage:</p> * <pre>{@code * WanakuPrinter printer = new WanakuPrinter(configPath, terminal); * printer.printSuccessMessage("Operation completed successfully"); * printer.printTable(dataList, "name", "status", "timestamp"); * printer.printAsMap(configuration, "host", "port", "enabled"); * }</pre> * * @author Wanaku CLI Team * @version 1.0 * @since 1.0 * @see DefaultPrinter * @see Terminal */ public class WanakuPrinter extends DefaultPrinter { // Styling constants for different message types /** Style for error messages - bold red text. */ private static final AttributedStyle ERROR_STYLE = AttributedStyle.BOLD.foreground(AttributedStyle.RED); /** Style for warning messages - yellow text. */ private static final AttributedStyle WARNING_STYLE = AttributedStyle.DEFAULT.foreground(AttributedStyle.YELLOW); /** Style for informational messages - blue text. */ private static final AttributedStyle INFO_STYLE = AttributedStyle.DEFAULT.foreground(AttributedStyle.BLUE); /** Style for success messages - bold green text. */ private static final AttributedStyle SUCCESS_STYLE = AttributedStyle.BOLD.foreground(AttributedStyle.GREEN); // Table formatting constants /** Exception display mode for stack trace output. */ private static final String EXCEPTION_MODE_STACK = "stack"; /** Default exception display mode configuration key. */ private static final String EXCEPTION_OPTION_KEY = "exception"; /** * Default options for table printing. * Configures structured table display with row highlighting and single-row table support. */ private static final Map<String, Object> DEFAULT_TABLE_OPTIONS = Collections.unmodifiableMap( Map.of( STRUCT_ON_TABLE, TRUE, ROW_HIGHLIGHT, EVEN, ONE_ROW_TABLE, TRUE ) ); /** * Default options for map printing. * Configures unstructured display without special table formatting. */ private static final Map<String, Object> DEFAULT_MAP_OPTIONS = Map.of( STRUCT_ON_TABLE, FALSE, ROW_HIGHLIGHT, EVEN, ONE_ROW_TABLE, FALSE ); /** The terminal instance used for all output operations. */ private final Terminal terminal; /** Jackson ObjectMapper instance for converting objects to maps for table display. */ private final ObjectMapper objectMapper; /** * Constructs a new WanakuPrinter with the specified configuration and terminal. * * @param configPath the configuration path for printer settings * @param terminal the terminal instance to use for output operations * @throws IllegalArgumentException if terminal is null */ public WanakuPrinter(ConfigurationPath configPath, Terminal terminal) { super(configPath); this.terminal = validateNotNull(terminal, "Terminal cannot be null"); this.objectMapper = new ObjectMapper(); } /** * Creates a new terminal instance with system integration, Jansi support, and color support enabled. * * <p>This factory method provides a pre-configured terminal suitable for CLI applications * that require color output and system integration.</p> * * @return a new terminal instance with standard CLI configuration * @throws IOException if the terminal cannot be created due to I/O issues */ public static Terminal terminalInstance() throws IOException { return TerminalBuilder .builder() .system(true) .jansi(true) .color(true) .build(); } /** * Returns the terminal instance used by this printer. * * @return the terminal instance for output operations */ @Override protected Terminal terminal() { return terminal; } /** * Prints a list of objects as a table with all available columns. * * <p>This is a convenience method that displays all properties of the objects * in the list as table columns using default table formatting options.</p> * * @param <T> the type of objects in the list * @param printables the list of objects to display as a table */ public <T> void printTable(List<T> printables) { printTable(printables, new String[]{}); } /** * Prints a list of objects as a table with specified columns. * * <p>Displays only the specified columns from the objects in the list. * Uses default table formatting options.</p> * * @param <T> the type of objects in the list * @param printables the list of objects to display as a table * @param columns the column names to include in the table output */ public <T> void printTable(List<T> printables, String... columns) { printTable(DEFAULT_TABLE_OPTIONS, printables, columns); } /** * Prints a list of objects as a table with custom formatting options and specified columns. * * <p>Provides full control over table appearance through custom options while * using the default object-to-map conversion strategy.</p> * * @param <T> the type of objects in the list * @param options custom formatting options for table display * @param printables the list of objects to display as a table * @param columns the column names to include in the table output */ public <T> void printTable(Map<String, Object> options, List<T> printables, String... columns) { printTable(options, printables, this::convertToMap, columns); } /** * Prints a list of objects as a table with full customization options. * * <p>This is the most flexible table printing method, allowing custom formatting options, * custom object-to-map conversion logic, and column selection. Handles empty or null * input gracefully and provides error handling for conversion failures.</p> * * @param <T> the type of objects in the list * @param options custom formatting options for table display * @param objectsToPrint the list of objects to display as a table * @param toMap function to convert objects to map representation * @param columns the column names to include in the table output */ public <T> void printTable(Map<String, Object> options, List<T> objectsToPrint, Function<T, Map<String, Object>> toMap, String... columns) { if (objectsToPrint == null || objectsToPrint.isEmpty()) { return; } try { List<Map<String, Object>> mappedObjects = objectsToPrint.stream() .map(toMap) .toList(); Map<String, Object> mergedOptions = createMergedOptions(options); if (columns != null && columns.length > 0) { mergedOptions.put(COLUMNS, Arrays.asList(columns)); } println(mergedOptions, mappedObjects); } catch (Exception e) { printErrorMessage("Failed to print table: " + e.getMessage()); } } /** * Prints an object as a map with all available properties. * * <p>Converts the object to a map representation and displays all key-value pairs * using default map formatting options.</p> * * @param <T> the type of the object to print * @param object the object to display as a map */ public <T> void printAsMap(T object) { printAsMap(object, new String[]{}); } /** * Prints an object as a map with only specified keys. * * <p>Converts the object to a map representation and displays only the key-value * pairs for the specified keys. Keys not present in the object are silently ignored.</p> * * @param <T> the type of the object to print * @param object the object to display as a map * @param keys the specific keys to include in the output */ public <T> void printAsMap(T object, String... keys) { if (object == null) { return; } Map<String, Object> map = convertToMap(object); if (keys != null && keys.length > 0) { Set<String> keySet = Set.of(keys); map = map.entrySet() .stream() .filter(entry -> keySet.contains(entry.getKey())) .collect(toMap(Map.Entry::getKey, Map.Entry::getValue)); } try { println(DEFAULT_MAP_OPTIONS, map); } catch (Exception e) { printErrorMessage("Failed to print object: " + e.getMessage()); } } /** * Prints an error message with red styling. * * <p>Uses bold red text to display error messages. Null messages are silently ignored.</p> * * @param message the error message to display, null values are ignored */ public void printErrorMessage(String message) { if (message != null) { printStyledMessage(message, ERROR_STYLE); } } /** * Prints a warning message with yellow styling. * * <p>Uses yellow text to display warning messages. Null messages are silently ignored.</p> * * @param message the warning message to display, null values are ignored */ public void printWarningMessage(String message) { if (message != null) { printStyledMessage(message, WARNING_STYLE); } } /** * Prints an informational message with blue styling. * * <p>Uses blue text to display informational messages. Null messages are silently ignored.</p> * * @param message the informational message to display, null values are ignored */ public void printInfoMessage(String message) { if (message != null) { printStyledMessage(message, INFO_STYLE); } } /** * Prints a success message with green styling. * * <p>Uses bold green text to display success messages. Null messages are silently ignored.</p> * * @param message the success message to display, null values are ignored */ public void printSuccessMessage(String message) { if (message != null) { printStyledMessage(message, SUCCESS_STYLE); } } /** * Highlights and prints exception information based on configured display mode. * * <p>Supports two display modes:</p> * <ul> * <li><strong>stack</strong> (default): Prints full stack trace to stderr</li> * <li><strong>message</strong>: Prints only the exception message with emphasis styling</li> * </ul> * * <p>The display mode is controlled by the "exception" option in the provided options map.</p> * * @param options configuration options including exception display mode * @param exception the exception to display, null exceptions are silently ignored */ @Override protected void highlightAndPrint(Map<String, Object> options, Throwable exception) { if (exception == null) { return; } String exceptionMode = (String) options.getOrDefault(EXCEPTION_OPTION_KEY, EXCEPTION_MODE_STACK); if (EXCEPTION_MODE_STACK.equals(exceptionMode)) { exception.printStackTrace(); } else { AttributedStringBuilder builder = new AttributedStringBuilder(); builder.append(exception.getMessage(), Styles.prntStyle().resolve(".em")); builder.toAttributedString().println(terminal()); } } /** * Converts an object to a Map representation for table/map display. * * <p>Uses Jackson ObjectMapper to perform the conversion, which handles most * Java objects including POJOs, records, and collections. The conversion * respects Jackson annotations if present on the object.</p> * * @param obj the object to convert to a map * @return a map representation of the object, empty map if input is null * @throws IllegalArgumentException if the object cannot be converted to a map */ private Map<String, Object> convertToMap(Object obj) { if (obj == null) { return Map.of(); } try { return objectMapper.convertValue(obj, new TypeReference<Map<String, Object>>() {}); } catch (Exception e) { throw new IllegalArgumentException("Failed to convert object to map: " + e.getMessage(), e); } } /** * Prints a message with the specified styling. * * <p>Applies the given AttributedStyle to the message and outputs it to the terminal * with proper ANSI escape sequences. Ensures the output is immediately flushed.</p> * * @param message the message to print * @param style the styling to apply to the message */ private void printStyledMessage(String message, AttributedStyle style) { AttributedString styledMessage = new AttributedStringBuilder() .style(style) .append(message) .toAttributedString(); terminal.writer().println(styledMessage.toAnsi()); terminal.flush(); } /** * Creates a new options map by merging custom options with default table options. * * <p>Default options are applied first, then custom options override any conflicting * settings. This ensures consistent baseline behavior while allowing customization.</p> * * @param customOptions custom options to merge with defaults, null is handled gracefully * @return a new map containing merged options */ private Map<String, Object> createMergedOptions(Map<String, Object> customOptions) { Map<String, Object> merged = new HashMap<>(DEFAULT_TABLE_OPTIONS); if (customOptions != null) { merged.putAll(customOptions); } return merged; } /** * Validates that an object is not null and returns it. * * <p>This utility method provides consistent null validation with custom error messages * throughout the class.</p> * * @param <T> the type of the object to validate * @param object the object to validate * @param message the error message to use if validation fails * @return the validated object * @throws IllegalArgumentException if the object is null */ private static <T> T validateNotNull(T object, String message) { if (object == null) { throw new IllegalArgumentException(message); } return object; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/support/ZipHelper.java
package ai.wanaku.cli.main.support; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import org.jboss.logging.Logger; public class ZipHelper { private static final Logger LOG = Logger.getLogger(ZipHelper.class); public static void unzip(File zipFilePath, String destination, String componentName) throws IOException { unzip(zipFilePath, new File(destination), componentName); } public static void unzip(File zipFilePath, File destination, String componentName) throws IOException { // Create a ZipInputStream object from the specified ZIP file try (ZipFile zipFile = new ZipFile(zipFilePath)) { Enumeration<? extends ZipEntry> entries = zipFile.entries(); // Iterate over each entry in the ZIP file while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); LOG.debugf("Unpacking %s", entry.getName()); String name = finalEntryName(componentName, entry); // Create a file for the current entry in the unzip folder File unzippedFile = new File(destination, name); if (!entry.isDirectory()) { // Open an input stream to read from the entry try (InputStream in = zipFile.getInputStream(entry)) { // Open an output stream to write to the local file try (OutputStream out = new FileOutputStream(unzippedFile)) { in.transferTo(out); } catch (IOException e) { LOG.errorf(e,"Error writing to file: %s", e.getMessage()); } } catch (IOException e) { LOG.errorf(e, "Error reading from entry: %s", e.getMessage()); } } else { if (unzippedFile.exists()) { return; } Files.createDirectories(unzippedFile.toPath()); } } } LOG.infof("ZIP file contents extracted successfully to: %s", destination.getAbsolutePath()); } /** * Remove the first part of the entry name, so that the directories do not contain the version part * @param componentName * @param entry * @return */ private static String finalEntryName(String componentName, ZipEntry entry) { int idx = entry.getName().indexOf("/"); String entryName = entry.getName().substring(idx); return String.format("%s/%s", componentName, entryName); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/runner
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/runner/local/LocalRunner.java
package ai.wanaku.cli.runner.local; import ai.wanaku.cli.main.support.Downloader; import ai.wanaku.cli.main.support.RuntimeConstants; import ai.wanaku.cli.main.support.WanakuCliConfig; import ai.wanaku.cli.main.support.ZipHelper; import ai.wanaku.core.util.ProcessRunner; import ai.wanaku.core.util.VersionHelper; import java.io.File; import java.io.IOException; import java.time.Duration; import java.util.List; import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.jboss.logging.Logger; public class LocalRunner { private static final Logger LOG = Logger.getLogger(LocalRunner.class); private final WanakuCliConfig config; private int activeServices = 0; public LocalRunner(WanakuCliConfig config) { this.config = config; } public void start(List<String> services) throws IOException { Map<String, String> components = config.components(); deploy(services, components); run(services, components); } private void run(List<String> services, Map<String, String> components) { ExecutorService executorService = Executors.newCachedThreadPool(); CountDownLatch countDownLatch = new CountDownLatch(activeServices); int grpcPort = config.initialGrpcPort(); startRouter(RuntimeConstants.WANAKU_ROUTER, executorService, countDownLatch); LOG.infof("Waiting %d seconds for the Wanaku Router to start", config.routerStartWaitSecs()); try { Thread.sleep(Duration.ofSeconds(config.routerStartWaitSecs()).toMillis()); } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.warn("Interrupted while waiting for Wanaku Router to start ... Aborting"); return; } for (Map.Entry<String, String> component : components.entrySet()) { if (isEnabled(services, component)) { startService(component, grpcPort, executorService, countDownLatch); grpcPort++; } } try { countDownLatch.await(); } catch (InterruptedException e) { LOG.infof("Interrupted while waiting for services to run"); } } private static void startRouter(String component, ExecutorService executorService, CountDownLatch countDownLatch) { File componentDir = new File(RuntimeConstants.WANAKU_LOCAL_DIR, component); executorService.submit(() -> { ProcessRunner.run(componentDir, "java", "-jar", "quarkus-run.jar"); countDownLatch.countDown(); }); } private static void startService( Map.Entry<String, String> component, int grpcPort, ExecutorService executorService, CountDownLatch countDownLatch) { LOG.infof("Starting Wanaku Service %s on port %d", component.getKey(), grpcPort); File componentDir = new File(RuntimeConstants.WANAKU_LOCAL_DIR, component.getKey()); String grpcPortArg = String.format("-Dquarkus.grpc.server.port=%d", grpcPort); executorService.submit(() -> { ProcessRunner.run(componentDir, "java", grpcPortArg, "-jar", "quarkus-run.jar"); countDownLatch.countDown(); }); } private void deploy(List<String> services, Map<String, String> components) throws IOException { downloadService(RuntimeConstants.WANAKU_ROUTER, components.get(RuntimeConstants.WANAKU_ROUTER)); for (Map.Entry<String, String> component : components.entrySet()) { if (isEnabled(services, component)) { activeServices++; downloadService(component.getKey(), component.getValue()); } } } private void downloadService(String componentName, String urlFormat) throws IOException { String downloadUrl = getDownloadURL(urlFormat); File destinationDir = new File(RuntimeConstants.WANAKU_CACHE_DIR); LOG.infof("Downloading %s at %s", componentName, downloadUrl); File downloadedFile = Downloader.downloadFile(downloadUrl, destinationDir); LOG.infof("Unpacking %s at %s", componentName, destinationDir); ZipHelper.unzip(downloadedFile, RuntimeConstants.WANAKU_LOCAL_DIR, componentName); } private String getDownloadURL(String urlFormat) { String tag; if (VersionHelper.VERSION.contains("SNAPSHOT")) { tag = config.earlyAccessTag(); } else { tag = String.format("v%s", VersionHelper.VERSION); } return String.format(urlFormat, tag, VersionHelper.VERSION); } private static boolean isEnabled(List<String> services, Map.Entry<String, String> component) { if (!services.isEmpty()) { return services.contains(component.getKey()); } return true; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/types/Container.java
package ai.wanaku.cli.types; public class Container { private String name; private String image; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/types/Environment.java
package ai.wanaku.cli.types; import java.util.List; public class Environment { private List<String> variables; public List<String> getVariables() { return variables; } public void setVariables(List<String> variables) { this.variables = variables; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/types/Service.java
package ai.wanaku.cli.types; public class Service { private String name; private String image; private Environment environment; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public Environment getEnvironment() { return environment; } public void setEnvironment(Environment environment) { this.environment = environment; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/types/WanakuDeployment.java
package ai.wanaku.cli.types; import java.util.List; public class WanakuDeployment { private Environment environment; private List<Service> infrastructure; private List<Service> services; private List<Service> server; public Environment getEnvironment() { return environment; } public void setEnvironment(Environment environment) { this.environment = environment; } public List<Service> getInfrastructure() { return infrastructure; } public void setInfrastructure(List<Service> infrastructure) { this.infrastructure = infrastructure; } public List<Service> getServices() { return services; } public void setServices(List<Service> services) { this.services = services; } public List<Service> getServer() { return server; } public void setServer(List<Service> server) { this.server = server; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/Configuration.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * Represents a configuration reference * </pre> * * Protobuf type {@code tool.Configuration} */ public final class Configuration extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tool.Configuration) ConfigurationOrBuilder { private static final long serialVersionUID = 0L; // Use Configuration.newBuilder() to construct. private Configuration(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Configuration() { type_ = 0; name_ = ""; payload_ = ""; } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new Configuration(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Configuration_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Configuration_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.Configuration.class, ai.wanaku.core.exchange.Configuration.Builder.class); } public static final int TYPE_FIELD_NUMBER = 1; private int type_ = 0; /** * <code>.tool.PayloadType type = 1;</code> * @return The enum numeric value on the wire for type. */ @java.lang.Override public int getTypeValue() { return type_; } /** * <code>.tool.PayloadType type = 1;</code> * @return The type. */ @java.lang.Override public ai.wanaku.core.exchange.PayloadType getType() { ai.wanaku.core.exchange.PayloadType result = ai.wanaku.core.exchange.PayloadType.forNumber(type_); return result == null ? ai.wanaku.core.exchange.PayloadType.UNRECOGNIZED : result; } public static final int NAME_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object name_ = ""; /** * <code>string name = 2;</code> * @return The name. */ @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <code>string name = 2;</code> * @return The bytes for name. */ @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PAYLOAD_FIELD_NUMBER = 3; @SuppressWarnings("serial") private volatile java.lang.Object payload_ = ""; /** * <code>string payload = 3;</code> * @return The payload. */ @java.lang.Override public java.lang.String getPayload() { java.lang.Object ref = payload_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); payload_ = s; return s; } } /** * <code>string payload = 3;</code> * @return The bytes for payload. */ @java.lang.Override public com.google.protobuf.ByteString getPayloadBytes() { java.lang.Object ref = payload_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); payload_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (type_ != ai.wanaku.core.exchange.PayloadType.REFERENCE.getNumber()) { output.writeEnum(1, type_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payload_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, payload_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (type_ != ai.wanaku.core.exchange.PayloadType.REFERENCE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payload_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, payload_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.Configuration)) { return super.equals(obj); } ai.wanaku.core.exchange.Configuration other = (ai.wanaku.core.exchange.Configuration) obj; if (type_ != other.type_) return false; if (!getName().equals(other.getName())) return false; if (!getPayload().equals(other.getPayload())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; hash = (53 * hash) + getPayload().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.Configuration parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.Configuration parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.Configuration parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.Configuration parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.Configuration parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.Configuration parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.Configuration parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.Configuration parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.Configuration parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.Configuration parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.Configuration parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.Configuration parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.Configuration prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * Represents a configuration reference * </pre> * * Protobuf type {@code tool.Configuration} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:tool.Configuration) ai.wanaku.core.exchange.ConfigurationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Configuration_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Configuration_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.Configuration.class, ai.wanaku.core.exchange.Configuration.Builder.class); } // Construct using ai.wanaku.core.exchange.Configuration.newBuilder() private Builder() { } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; type_ = 0; name_ = ""; payload_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Configuration_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.Configuration getDefaultInstanceForType() { return ai.wanaku.core.exchange.Configuration.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.Configuration build() { ai.wanaku.core.exchange.Configuration result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.Configuration buildPartial() { ai.wanaku.core.exchange.Configuration result = new ai.wanaku.core.exchange.Configuration(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.Configuration result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.type_ = type_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.name_ = name_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.payload_ = payload_; } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.Configuration) { return mergeFrom((ai.wanaku.core.exchange.Configuration) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.Configuration other) { if (other == ai.wanaku.core.exchange.Configuration.getDefaultInstance()) return this; if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } if (!other.getName().isEmpty()) { name_ = other.name_; bitField0_ |= 0x00000002; onChanged(); } if (!other.getPayload().isEmpty()) { payload_ = other.payload_; bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 8: { type_ = input.readEnum(); bitField0_ |= 0x00000001; break; } // case 8 case 18: { name_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 case 26: { payload_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000004; break; } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private int type_ = 0; /** * <code>.tool.PayloadType type = 1;</code> * @return The enum numeric value on the wire for type. */ @java.lang.Override public int getTypeValue() { return type_; } /** * <code>.tool.PayloadType type = 1;</code> * @param value The enum numeric value on the wire for type to set. * @return This builder for chaining. */ public Builder setTypeValue(int value) { type_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>.tool.PayloadType type = 1;</code> * @return The type. */ @java.lang.Override public ai.wanaku.core.exchange.PayloadType getType() { ai.wanaku.core.exchange.PayloadType result = ai.wanaku.core.exchange.PayloadType.forNumber(type_); return result == null ? ai.wanaku.core.exchange.PayloadType.UNRECOGNIZED : result; } /** * <code>.tool.PayloadType type = 1;</code> * @param value The type to set. * @return This builder for chaining. */ public Builder setType(ai.wanaku.core.exchange.PayloadType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; type_ = value.getNumber(); onChanged(); return this; } /** * <code>.tool.PayloadType type = 1;</code> * @return This builder for chaining. */ public Builder clearType() { bitField0_ = (bitField0_ & ~0x00000001); type_ = 0; onChanged(); return this; } private java.lang.Object name_ = ""; /** * <code>string name = 2;</code> * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string name = 2;</code> * @return The bytes for name. */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string name = 2;</code> * @param value The name to set. * @return This builder for chaining. */ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>string name = 2;</code> * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * <code>string name = 2;</code> * @param value The bytes for name to set. * @return This builder for chaining. */ public Builder setNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object payload_ = ""; /** * <code>string payload = 3;</code> * @return The payload. */ public java.lang.String getPayload() { java.lang.Object ref = payload_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); payload_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string payload = 3;</code> * @return The bytes for payload. */ public com.google.protobuf.ByteString getPayloadBytes() { java.lang.Object ref = payload_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); payload_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string payload = 3;</code> * @param value The payload to set. * @return This builder for chaining. */ public Builder setPayload(java.lang.String value) { if (value == null) { throw new NullPointerException(); } payload_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * <code>string payload = 3;</code> * @return This builder for chaining. */ public Builder clearPayload() { payload_ = getDefaultInstance().getPayload(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * <code>string payload = 3;</code> * @param value The bytes for payload to set. * @return This builder for chaining. */ public Builder setPayloadBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); payload_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:tool.Configuration) } // @@protoc_insertion_point(class_scope:tool.Configuration) private static final ai.wanaku.core.exchange.Configuration DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.Configuration(); } public static ai.wanaku.core.exchange.Configuration getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Configuration> PARSER = new com.google.protobuf.AbstractParser<Configuration>() { @java.lang.Override public Configuration parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<Configuration> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Configuration> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.Configuration getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ConfigurationOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface ConfigurationOrBuilder extends // @@protoc_insertion_point(interface_extends:tool.Configuration) com.google.protobuf.MessageOrBuilder { /** * <code>.tool.PayloadType type = 1;</code> * @return The enum numeric value on the wire for type. */ int getTypeValue(); /** * <code>.tool.PayloadType type = 1;</code> * @return The type. */ ai.wanaku.core.exchange.PayloadType getType(); /** * <code>string name = 2;</code> * @return The name. */ java.lang.String getName(); /** * <code>string name = 2;</code> * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); /** * <code>string payload = 3;</code> * @return The payload. */ java.lang.String getPayload(); /** * <code>string payload = 3;</code> * @return The bytes for payload. */ com.google.protobuf.ByteString getPayloadBytes(); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/InvocationDelegate.java
package ai.wanaku.core.exchange; /** * A delegate that can be used by services that invoke tools */ public interface InvocationDelegate extends RegisterAware, ProvisionAware { /** * Invokes the tool * @param request the tool invocation request, including the body and parameters passed * @return A ToolInvokeReply instance with details about the tool execution status */ ToolInvokeReply invoke(ToolInvokeRequest request); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/MutinyProvisionerGrpc.java
package ai.wanaku.core.exchange; import static ai.wanaku.core.exchange.ProvisionerGrpc.getServiceDescriptor; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: provision.proto") public final class MutinyProvisionerGrpc implements io.quarkus.grpc.MutinyGrpc { private MutinyProvisionerGrpc() { } public static MutinyProvisionerStub newMutinyStub(io.grpc.Channel channel) { return new MutinyProvisionerStub(channel); } /** * <pre> * The inquirer exchange service definition. * </pre> */ public static class MutinyProvisionerStub extends io.grpc.stub.AbstractStub<MutinyProvisionerStub> implements io.quarkus.grpc.MutinyStub { private ProvisionerGrpc.ProvisionerStub delegateStub; private MutinyProvisionerStub(io.grpc.Channel channel) { super(channel); delegateStub = ProvisionerGrpc.newStub(channel); } private MutinyProvisionerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); delegateStub = ProvisionerGrpc.newStub(channel).build(channel, callOptions); } @Override protected MutinyProvisionerStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new MutinyProvisionerStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ProvisionReply> provision(ai.wanaku.core.exchange.ProvisionRequest request) { return io.quarkus.grpc.stubs.ClientCalls.oneToOne(request, delegateStub::provision); } } /** * <pre> * The inquirer exchange service definition. * </pre> */ public static abstract class ProvisionerImplBase implements io.grpc.BindableService { private String compression; /** * Set whether the server will try to use a compressed response. * * @param compression the compression, e.g {@code gzip} */ public ProvisionerImplBase withCompression(String compression) { this.compression = compression; return this; } /** * <pre> * Invokes a tool * </pre> */ public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ProvisionReply> provision(ai.wanaku.core.exchange.ProvisionRequest request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).addMethod(ai.wanaku.core.exchange.ProvisionerGrpc.getProvisionMethod(), asyncUnaryCall(new MethodHandlers<ai.wanaku.core.exchange.ProvisionRequest, ai.wanaku.core.exchange.ProvisionReply>(this, METHODID_PROVISION, compression))).build(); } } private static final int METHODID_PROVISION = 0; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final ProvisionerImplBase serviceImpl; private final int methodId; private final String compression; MethodHandlers(ProvisionerImplBase serviceImpl, int methodId, String compression) { this.serviceImpl = serviceImpl; this.methodId = methodId; this.compression = compression; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { case METHODID_PROVISION: io.quarkus.grpc.stubs.ServerCalls.oneToOne((ai.wanaku.core.exchange.ProvisionRequest) request, (io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ProvisionReply>) responseObserver, compression, serviceImpl::provision); break; default: throw new java.lang.AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { default: throw new java.lang.AssertionError(); } } } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/MutinyResourceAcquirerGrpc.java
package ai.wanaku.core.exchange; import static ai.wanaku.core.exchange.ResourceAcquirerGrpc.getServiceDescriptor; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: resourcerequest.proto") public final class MutinyResourceAcquirerGrpc implements io.quarkus.grpc.MutinyGrpc { private MutinyResourceAcquirerGrpc() { } public static MutinyResourceAcquirerStub newMutinyStub(io.grpc.Channel channel) { return new MutinyResourceAcquirerStub(channel); } /** * <pre> * The tool exchange service definition. * </pre> */ public static class MutinyResourceAcquirerStub extends io.grpc.stub.AbstractStub<MutinyResourceAcquirerStub> implements io.quarkus.grpc.MutinyStub { private ResourceAcquirerGrpc.ResourceAcquirerStub delegateStub; private MutinyResourceAcquirerStub(io.grpc.Channel channel) { super(channel); delegateStub = ResourceAcquirerGrpc.newStub(channel); } private MutinyResourceAcquirerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); delegateStub = ResourceAcquirerGrpc.newStub(channel).build(channel, callOptions); } @Override protected MutinyResourceAcquirerStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new MutinyResourceAcquirerStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ResourceReply> resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request) { return io.quarkus.grpc.stubs.ClientCalls.oneToOne(request, delegateStub::resourceAcquire); } } /** * <pre> * The tool exchange service definition. * </pre> */ public static abstract class ResourceAcquirerImplBase implements io.grpc.BindableService { private String compression; /** * Set whether the server will try to use a compressed response. * * @param compression the compression, e.g {@code gzip} */ public ResourceAcquirerImplBase withCompression(String compression) { this.compression = compression; return this; } /** * <pre> * Invokes a tool * </pre> */ public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ResourceReply> resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).addMethod(ai.wanaku.core.exchange.ResourceAcquirerGrpc.getResourceAcquireMethod(), asyncUnaryCall(new MethodHandlers<ai.wanaku.core.exchange.ResourceRequest, ai.wanaku.core.exchange.ResourceReply>(this, METHODID_RESOURCE_ACQUIRE, compression))).build(); } } private static final int METHODID_RESOURCE_ACQUIRE = 0; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final ResourceAcquirerImplBase serviceImpl; private final int methodId; private final String compression; MethodHandlers(ResourceAcquirerImplBase serviceImpl, int methodId, String compression) { this.serviceImpl = serviceImpl; this.methodId = methodId; this.compression = compression; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { case METHODID_RESOURCE_ACQUIRE: io.quarkus.grpc.stubs.ServerCalls.oneToOne((ai.wanaku.core.exchange.ResourceRequest) request, (io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ResourceReply>) responseObserver, compression, serviceImpl::resourceAcquire); break; default: throw new java.lang.AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { default: throw new java.lang.AssertionError(); } } } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/MutinyToolInvokerGrpc.java
package ai.wanaku.core.exchange; import static ai.wanaku.core.exchange.ToolInvokerGrpc.getServiceDescriptor; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: toolrequest.proto") public final class MutinyToolInvokerGrpc implements io.quarkus.grpc.MutinyGrpc { private MutinyToolInvokerGrpc() { } public static MutinyToolInvokerStub newMutinyStub(io.grpc.Channel channel) { return new MutinyToolInvokerStub(channel); } /** * <pre> * The tool exchange service definition. * </pre> */ public static class MutinyToolInvokerStub extends io.grpc.stub.AbstractStub<MutinyToolInvokerStub> implements io.quarkus.grpc.MutinyStub { private ToolInvokerGrpc.ToolInvokerStub delegateStub; private MutinyToolInvokerStub(io.grpc.Channel channel) { super(channel); delegateStub = ToolInvokerGrpc.newStub(channel); } private MutinyToolInvokerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); delegateStub = ToolInvokerGrpc.newStub(channel).build(channel, callOptions); } @Override protected MutinyToolInvokerStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new MutinyToolInvokerStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ToolInvokeReply> invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request) { return io.quarkus.grpc.stubs.ClientCalls.oneToOne(request, delegateStub::invokeTool); } } /** * <pre> * The tool exchange service definition. * </pre> */ public static abstract class ToolInvokerImplBase implements io.grpc.BindableService { private String compression; /** * Set whether the server will try to use a compressed response. * * @param compression the compression, e.g {@code gzip} */ public ToolInvokerImplBase withCompression(String compression) { this.compression = compression; return this; } /** * <pre> * Invokes a tool * </pre> */ public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ToolInvokeReply> invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).addMethod(ai.wanaku.core.exchange.ToolInvokerGrpc.getInvokeToolMethod(), asyncUnaryCall(new MethodHandlers<ai.wanaku.core.exchange.ToolInvokeRequest, ai.wanaku.core.exchange.ToolInvokeReply>(this, METHODID_INVOKE_TOOL, compression))).build(); } } private static final int METHODID_INVOKE_TOOL = 0; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final ToolInvokerImplBase serviceImpl; private final int methodId; private final String compression; MethodHandlers(ToolInvokerImplBase serviceImpl, int methodId, String compression) { this.serviceImpl = serviceImpl; this.methodId = methodId; this.compression = compression; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { case METHODID_INVOKE_TOOL: io.quarkus.grpc.stubs.ServerCalls.oneToOne((ai.wanaku.core.exchange.ToolInvokeRequest) request, (io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ToolInvokeReply>) responseObserver, compression, serviceImpl::invokeTool); break; default: throw new java.lang.AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { default: throw new java.lang.AssertionError(); } } } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/PayloadType.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * * * Defines the type of payload (i.e.: if it's a reference to a configuration, or the configuration * itself, etc * </pre> * * Protobuf enum {@code tool.PayloadType} */ public enum PayloadType implements com.google.protobuf.ProtocolMessageEnum { /** * <code>REFERENCE = 0;</code> */ REFERENCE(0), /** * <pre> * * * Invokes tools * </pre> * * <code>BUILTIN = 1;</code> */ BUILTIN(1), UNRECOGNIZED(-1); /** * <code>REFERENCE = 0;</code> */ public static final int REFERENCE_VALUE = 0; /** * <pre> * * * Invokes tools * </pre> * * <code>BUILTIN = 1;</code> */ public static final int BUILTIN_VALUE = 1; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException("Can't get the number of an unknown enum value."); } return value; } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static PayloadType valueOf(int value) { return forNumber(value); } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ public static PayloadType forNumber(int value) { switch(value) { case 0: return REFERENCE; case 1: return BUILTIN; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap<PayloadType> internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap<PayloadType> internalValueMap = new com.google.protobuf.Internal.EnumLiteMap<PayloadType>() { public PayloadType findValueByNumber(int number) { return PayloadType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalStateException("Can't get the descriptor of an unrecognized enum value."); } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.getDescriptor().getEnumTypes().get(0); } private static final PayloadType[] VALUES = values(); public static PayloadType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); } if (desc.getIndex() == -1) { return UNRECOGNIZED; } return VALUES[desc.getIndex()]; } private final int value; private PayloadType(int value) { this.value = value; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/PropertySchema.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * Protobuf type {@code tool.PropertySchema} */ public final class PropertySchema extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tool.PropertySchema) PropertySchemaOrBuilder { private static final long serialVersionUID = 0L; // Use PropertySchema.newBuilder() to construct. private PropertySchema(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private PropertySchema() { type_ = ""; description_ = ""; } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new PropertySchema(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_PropertySchema_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_PropertySchema_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.PropertySchema.class, ai.wanaku.core.exchange.PropertySchema.Builder.class); } public static final int TYPE_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object type_ = ""; /** * <code>string type = 1;</code> * @return The type. */ @java.lang.Override public java.lang.String getType() { java.lang.Object ref = type_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); type_ = s; return s; } } /** * <code>string type = 1;</code> * @return The bytes for type. */ @java.lang.Override public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); type_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DESCRIPTION_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object description_ = ""; /** * <code>string description = 2;</code> * @return The description. */ @java.lang.Override public java.lang.String getDescription() { java.lang.Object ref = description_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); description_ = s; return s; } } /** * <code>string description = 2;</code> * @return The bytes for description. */ @java.lang.Override public com.google.protobuf.ByteString getDescriptionBytes() { java.lang.Object ref = description_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); description_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int REQUIRED_FIELD_NUMBER = 3; private boolean required_ = false; /** * <code>bool required = 3;</code> * @return The required. */ @java.lang.Override public boolean getRequired() { return required_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); } if (required_ != false) { output.writeBool(3, required_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); } if (required_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, required_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.PropertySchema)) { return super.equals(obj); } ai.wanaku.core.exchange.PropertySchema other = (ai.wanaku.core.exchange.PropertySchema) obj; if (!getType().equals(other.getType())) return false; if (!getDescription().equals(other.getDescription())) return false; if (getRequired() != other.getRequired()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + getType().hashCode(); hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; hash = (53 * hash) + getDescription().hashCode(); hash = (37 * hash) + REQUIRED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequired()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.PropertySchema parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.PropertySchema parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.PropertySchema parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.PropertySchema parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.PropertySchema prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code tool.PropertySchema} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:tool.PropertySchema) ai.wanaku.core.exchange.PropertySchemaOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_PropertySchema_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_PropertySchema_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.PropertySchema.class, ai.wanaku.core.exchange.PropertySchema.Builder.class); } // Construct using ai.wanaku.core.exchange.PropertySchema.newBuilder() private Builder() { } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; type_ = ""; description_ = ""; required_ = false; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_PropertySchema_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.PropertySchema getDefaultInstanceForType() { return ai.wanaku.core.exchange.PropertySchema.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.PropertySchema build() { ai.wanaku.core.exchange.PropertySchema result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.PropertySchema buildPartial() { ai.wanaku.core.exchange.PropertySchema result = new ai.wanaku.core.exchange.PropertySchema(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.PropertySchema result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.type_ = type_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.description_ = description_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.required_ = required_; } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.PropertySchema) { return mergeFrom((ai.wanaku.core.exchange.PropertySchema) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.PropertySchema other) { if (other == ai.wanaku.core.exchange.PropertySchema.getDefaultInstance()) return this; if (!other.getType().isEmpty()) { type_ = other.type_; bitField0_ |= 0x00000001; onChanged(); } if (!other.getDescription().isEmpty()) { description_ = other.description_; bitField0_ |= 0x00000002; onChanged(); } if (other.getRequired() != false) { setRequired(other.getRequired()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 10: { type_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { description_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 case 24: { required_ = input.readBool(); bitField0_ |= 0x00000004; break; } // case 24 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object type_ = ""; /** * <code>string type = 1;</code> * @return The type. */ public java.lang.String getType() { java.lang.Object ref = type_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); type_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string type = 1;</code> * @return The bytes for type. */ public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); type_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string type = 1;</code> * @param value The type to set. * @return This builder for chaining. */ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } type_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>string type = 1;</code> * @return This builder for chaining. */ public Builder clearType() { type_ = getDefaultInstance().getType(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * <code>string type = 1;</code> * @param value The bytes for type to set. * @return This builder for chaining. */ public Builder setTypeBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); type_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object description_ = ""; /** * <code>string description = 2;</code> * @return The description. */ public java.lang.String getDescription() { java.lang.Object ref = description_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); description_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string description = 2;</code> * @return The bytes for description. */ public com.google.protobuf.ByteString getDescriptionBytes() { java.lang.Object ref = description_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); description_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string description = 2;</code> * @param value The description to set. * @return This builder for chaining. */ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } description_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>string description = 2;</code> * @return This builder for chaining. */ public Builder clearDescription() { description_ = getDefaultInstance().getDescription(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * <code>string description = 2;</code> * @param value The bytes for description to set. * @return This builder for chaining. */ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); description_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private boolean required_; /** * <code>bool required = 3;</code> * @return The required. */ @java.lang.Override public boolean getRequired() { return required_; } /** * <code>bool required = 3;</code> * @param value The required to set. * @return This builder for chaining. */ public Builder setRequired(boolean value) { required_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * <code>bool required = 3;</code> * @return This builder for chaining. */ public Builder clearRequired() { bitField0_ = (bitField0_ & ~0x00000004); required_ = false; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:tool.PropertySchema) } // @@protoc_insertion_point(class_scope:tool.PropertySchema) private static final ai.wanaku.core.exchange.PropertySchema DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.PropertySchema(); } public static ai.wanaku.core.exchange.PropertySchema getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<PropertySchema> PARSER = new com.google.protobuf.AbstractParser<PropertySchema>() { @java.lang.Override public PropertySchema parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<PropertySchema> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<PropertySchema> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.PropertySchema getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/PropertySchemaOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface PropertySchemaOrBuilder extends // @@protoc_insertion_point(interface_extends:tool.PropertySchema) com.google.protobuf.MessageOrBuilder { /** * <code>string type = 1;</code> * @return The type. */ java.lang.String getType(); /** * <code>string type = 1;</code> * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); /** * <code>string description = 2;</code> * @return The description. */ java.lang.String getDescription(); /** * <code>string description = 2;</code> * @return The bytes for description. */ com.google.protobuf.ByteString getDescriptionBytes(); /** * <code>bool required = 3;</code> * @return The required. */ boolean getRequired(); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionAware.java
package ai.wanaku.core.exchange; /** * Interface used by delegates that can provide access to exchange-related properties. * <p> * Implementors of this interface should supply a {@code Map} of available properties, which are identified by their respective names or keys. * <p> * These properties will often be defined in the `application.properties` file and accessed via configuration wrappers. */ public interface ProvisionAware { /** * Provisions a resource or tool for usage with the downstream/capability service * * @return A {@code Map} representation of valid properties keyed by name. These properties will be passed to the model as * acceptable arguments for the tools using this service. */ ProvisionReply provision(ProvisionRequest request); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionExchange.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public final class ProvisionExchange { private ProvisionExchange() { } public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_Configuration_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_Configuration_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_Secret_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_Secret_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_ProvisionRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_ProvisionRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_PropertySchema_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_PropertySchema_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_ProvisionReply_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_ProvisionReply_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_ProvisionReply_PropertiesEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_ProvisionReply_PropertiesEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\017provision.proto\022\004tool\"O\n\rConfiguration" + "\022\037\n\004type\030\001 \001(\0162\021.tool.PayloadType\022\014\n\004nam" + "e\030\002 \001(\t\022\017\n\007payload\030\003 \001(\t\"H\n\006Secret\022\037\n\004ty" + "pe\030\001 \001(\0162\021.tool.PayloadType\022\014\n\004name\030\002 \001(" + "\t\022\017\n\007payload\030\003 \001(\t\"i\n\020ProvisionRequest\022\013" + "\n\003uri\030\001 \001(\t\022*\n\rconfiguration\030\002 \001(\0132\023.too" + "l.Configuration\022\034\n\006secret\030\003 \001(\0132\014.tool.S" + "ecret\"E\n\016PropertySchema\022\014\n\004type\030\001 \001(\t\022\023\n" + "\013description\030\002 \001(\t\022\020\n\010required\030\003 \001(\010\"\300\001\n" + "\016ProvisionReply\022\030\n\020configurationUri\030\001 \001(" + "\t\022\021\n\tsecretUri\030\002 \001(\t\0228\n\nproperties\030\003 \003(\013" + "2$.tool.ProvisionReply.PropertiesEntry\032G" + "\n\017PropertiesEntry\022\013\n\003key\030\001 \001(\t\022#\n\005value\030" + "\002 \001(\0132\024.tool.PropertySchema:\0028\001*)\n\013Paylo" + "adType\022\r\n\tREFERENCE\020\000\022\013\n\007BUILTIN\020\0012J\n\013Pr" + "ovisioner\022;\n\tProvision\022\026.tool.ProvisionR" + "equest\032\024.tool.ProvisionReply\"\000B.\n\027ai.wan" + "aku.core.exchangeB\021ProvisionExchangeP\001b\006" + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_tool_Configuration_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tool_Configuration_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_Configuration_descriptor, new java.lang.String[] { "Type", "Name", "Payload" }); internal_static_tool_Secret_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tool_Secret_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_Secret_descriptor, new java.lang.String[] { "Type", "Name", "Payload" }); internal_static_tool_ProvisionRequest_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tool_ProvisionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_ProvisionRequest_descriptor, new java.lang.String[] { "Uri", "Configuration", "Secret" }); internal_static_tool_PropertySchema_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_tool_PropertySchema_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_PropertySchema_descriptor, new java.lang.String[] { "Type", "Description", "Required" }); internal_static_tool_ProvisionReply_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_tool_ProvisionReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_ProvisionReply_descriptor, new java.lang.String[] { "ConfigurationUri", "SecretUri", "Properties" }); internal_static_tool_ProvisionReply_PropertiesEntry_descriptor = internal_static_tool_ProvisionReply_descriptor.getNestedTypes().get(0); internal_static_tool_ProvisionReply_PropertiesEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_ProvisionReply_PropertiesEntry_descriptor, new java.lang.String[] { "Key", "Value" }); } // @@protoc_insertion_point(outer_class_scope) }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionReply.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * The invocation response message * </pre> * * Protobuf type {@code tool.ProvisionReply} */ public final class ProvisionReply extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tool.ProvisionReply) ProvisionReplyOrBuilder { private static final long serialVersionUID = 0L; // Use ProvisionReply.newBuilder() to construct. private ProvisionReply(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ProvisionReply() { configurationUri_ = ""; secretUri_ = ""; } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ProvisionReply(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionReply_descriptor; } @SuppressWarnings({ "rawtypes" }) @java.lang.Override protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) { switch(number) { case 3: return internalGetProperties(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionReply_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ProvisionReply.class, ai.wanaku.core.exchange.ProvisionReply.Builder.class); } public static final int CONFIGURATIONURI_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object configurationUri_ = ""; /** * <code>string configurationUri = 1;</code> * @return The configurationUri. */ @java.lang.Override public java.lang.String getConfigurationUri() { java.lang.Object ref = configurationUri_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); configurationUri_ = s; return s; } } /** * <code>string configurationUri = 1;</code> * @return The bytes for configurationUri. */ @java.lang.Override public com.google.protobuf.ByteString getConfigurationUriBytes() { java.lang.Object ref = configurationUri_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); configurationUri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SECRETURI_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object secretUri_ = ""; /** * <code>string secretUri = 2;</code> * @return The secretUri. */ @java.lang.Override public java.lang.String getSecretUri() { java.lang.Object ref = secretUri_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); secretUri_ = s; return s; } } /** * <code>string secretUri = 2;</code> * @return The bytes for secretUri. */ @java.lang.Override public com.google.protobuf.ByteString getSecretUriBytes() { java.lang.Object ref = secretUri_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); secretUri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PROPERTIES_FIELD_NUMBER = 3; private static final class PropertiesDefaultEntryHolder { static final com.google.protobuf.MapEntry<java.lang.String, ai.wanaku.core.exchange.PropertySchema> defaultEntry = com.google.protobuf.MapEntry.<java.lang.String, ai.wanaku.core.exchange.PropertySchema>newDefaultInstance(ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionReply_PropertiesEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.MESSAGE, ai.wanaku.core.exchange.PropertySchema.getDefaultInstance()); } @SuppressWarnings("serial") private com.google.protobuf.MapField<java.lang.String, ai.wanaku.core.exchange.PropertySchema> properties_; private com.google.protobuf.MapField<java.lang.String, ai.wanaku.core.exchange.PropertySchema> internalGetProperties() { if (properties_ == null) { return com.google.protobuf.MapField.emptyMapField(PropertiesDefaultEntryHolder.defaultEntry); } return properties_; } public int getPropertiesCount() { return internalGetProperties().getMap().size(); } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ @java.lang.Override public boolean containsProperties(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetProperties().getMap().containsKey(key); } /** * Use {@link #getPropertiesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> getProperties() { return getPropertiesMap(); } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ @java.lang.Override public java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> getPropertiesMap() { return internalGetProperties().getMap(); } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ @java.lang.Override public /* nullable */ ai.wanaku.core.exchange.PropertySchema getPropertiesOrDefault(java.lang.String key, /* nullable */ ai.wanaku.core.exchange.PropertySchema defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> map = internalGetProperties().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ @java.lang.Override public ai.wanaku.core.exchange.PropertySchema getPropertiesOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> map = internalGetProperties().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(configurationUri_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, configurationUri_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secretUri_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, secretUri_); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(output, internalGetProperties(), PropertiesDefaultEntryHolder.defaultEntry, 3); getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(configurationUri_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, configurationUri_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secretUri_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, secretUri_); } for (java.util.Map.Entry<java.lang.String, ai.wanaku.core.exchange.PropertySchema> entry : internalGetProperties().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, ai.wanaku.core.exchange.PropertySchema> properties__ = PropertiesDefaultEntryHolder.defaultEntry.newBuilderForType().setKey(entry.getKey()).setValue(entry.getValue()).build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, properties__); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.ProvisionReply)) { return super.equals(obj); } ai.wanaku.core.exchange.ProvisionReply other = (ai.wanaku.core.exchange.ProvisionReply) obj; if (!getConfigurationUri().equals(other.getConfigurationUri())) return false; if (!getSecretUri().equals(other.getSecretUri())) return false; if (!internalGetProperties().equals(other.internalGetProperties())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONFIGURATIONURI_FIELD_NUMBER; hash = (53 * hash) + getConfigurationUri().hashCode(); hash = (37 * hash) + SECRETURI_FIELD_NUMBER; hash = (53 * hash) + getSecretUri().hashCode(); if (!internalGetProperties().getMap().isEmpty()) { hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; hash = (53 * hash) + internalGetProperties().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionReply parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ProvisionReply parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ProvisionReply parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.ProvisionReply prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * The invocation response message * </pre> * * Protobuf type {@code tool.ProvisionReply} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:tool.ProvisionReply) ai.wanaku.core.exchange.ProvisionReplyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionReply_descriptor; } @SuppressWarnings({ "rawtypes" }) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) { switch(number) { case 3: return internalGetProperties(); default: throw new RuntimeException("Invalid map field number: " + number); } } @SuppressWarnings({ "rawtypes" }) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number) { switch(number) { case 3: return internalGetMutableProperties(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionReply_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ProvisionReply.class, ai.wanaku.core.exchange.ProvisionReply.Builder.class); } // Construct using ai.wanaku.core.exchange.ProvisionReply.newBuilder() private Builder() { } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; configurationUri_ = ""; secretUri_ = ""; internalGetMutableProperties().clear(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionReply_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.ProvisionReply getDefaultInstanceForType() { return ai.wanaku.core.exchange.ProvisionReply.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.ProvisionReply build() { ai.wanaku.core.exchange.ProvisionReply result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.ProvisionReply buildPartial() { ai.wanaku.core.exchange.ProvisionReply result = new ai.wanaku.core.exchange.ProvisionReply(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.ProvisionReply result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.configurationUri_ = configurationUri_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.secretUri_ = secretUri_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.properties_ = internalGetProperties().build(PropertiesDefaultEntryHolder.defaultEntry); } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.ProvisionReply) { return mergeFrom((ai.wanaku.core.exchange.ProvisionReply) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.ProvisionReply other) { if (other == ai.wanaku.core.exchange.ProvisionReply.getDefaultInstance()) return this; if (!other.getConfigurationUri().isEmpty()) { configurationUri_ = other.configurationUri_; bitField0_ |= 0x00000001; onChanged(); } if (!other.getSecretUri().isEmpty()) { secretUri_ = other.secretUri_; bitField0_ |= 0x00000002; onChanged(); } internalGetMutableProperties().mergeFrom(other.internalGetProperties()); bitField0_ |= 0x00000004; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 10: { configurationUri_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { secretUri_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 case 26: { com.google.protobuf.MapEntry<java.lang.String, ai.wanaku.core.exchange.PropertySchema> properties__ = input.readMessage(PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableProperties().ensureBuilderMap().put(properties__.getKey(), properties__.getValue()); bitField0_ |= 0x00000004; break; } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object configurationUri_ = ""; /** * <code>string configurationUri = 1;</code> * @return The configurationUri. */ public java.lang.String getConfigurationUri() { java.lang.Object ref = configurationUri_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); configurationUri_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string configurationUri = 1;</code> * @return The bytes for configurationUri. */ public com.google.protobuf.ByteString getConfigurationUriBytes() { java.lang.Object ref = configurationUri_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); configurationUri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string configurationUri = 1;</code> * @param value The configurationUri to set. * @return This builder for chaining. */ public Builder setConfigurationUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } configurationUri_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>string configurationUri = 1;</code> * @return This builder for chaining. */ public Builder clearConfigurationUri() { configurationUri_ = getDefaultInstance().getConfigurationUri(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * <code>string configurationUri = 1;</code> * @param value The bytes for configurationUri to set. * @return This builder for chaining. */ public Builder setConfigurationUriBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); configurationUri_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object secretUri_ = ""; /** * <code>string secretUri = 2;</code> * @return The secretUri. */ public java.lang.String getSecretUri() { java.lang.Object ref = secretUri_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); secretUri_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string secretUri = 2;</code> * @return The bytes for secretUri. */ public com.google.protobuf.ByteString getSecretUriBytes() { java.lang.Object ref = secretUri_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); secretUri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string secretUri = 2;</code> * @param value The secretUri to set. * @return This builder for chaining. */ public Builder setSecretUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } secretUri_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>string secretUri = 2;</code> * @return This builder for chaining. */ public Builder clearSecretUri() { secretUri_ = getDefaultInstance().getSecretUri(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * <code>string secretUri = 2;</code> * @param value The bytes for secretUri to set. * @return This builder for chaining. */ public Builder setSecretUriBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); secretUri_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private static final class PropertiesConverter implements com.google.protobuf.MapFieldBuilder.Converter<java.lang.String, ai.wanaku.core.exchange.PropertySchemaOrBuilder, ai.wanaku.core.exchange.PropertySchema> { @java.lang.Override public ai.wanaku.core.exchange.PropertySchema build(ai.wanaku.core.exchange.PropertySchemaOrBuilder val) { if (val instanceof ai.wanaku.core.exchange.PropertySchema) { return (ai.wanaku.core.exchange.PropertySchema) val; } return ((ai.wanaku.core.exchange.PropertySchema.Builder) val).build(); } @java.lang.Override public com.google.protobuf.MapEntry<java.lang.String, ai.wanaku.core.exchange.PropertySchema> defaultEntry() { return PropertiesDefaultEntryHolder.defaultEntry; } } private static final PropertiesConverter propertiesConverter = new PropertiesConverter(); private com.google.protobuf.MapFieldBuilder<java.lang.String, ai.wanaku.core.exchange.PropertySchemaOrBuilder, ai.wanaku.core.exchange.PropertySchema, ai.wanaku.core.exchange.PropertySchema.Builder> properties_; private com.google.protobuf.MapFieldBuilder<java.lang.String, ai.wanaku.core.exchange.PropertySchemaOrBuilder, ai.wanaku.core.exchange.PropertySchema, ai.wanaku.core.exchange.PropertySchema.Builder> internalGetProperties() { if (properties_ == null) { return new com.google.protobuf.MapFieldBuilder<>(propertiesConverter); } return properties_; } private com.google.protobuf.MapFieldBuilder<java.lang.String, ai.wanaku.core.exchange.PropertySchemaOrBuilder, ai.wanaku.core.exchange.PropertySchema, ai.wanaku.core.exchange.PropertySchema.Builder> internalGetMutableProperties() { if (properties_ == null) { properties_ = new com.google.protobuf.MapFieldBuilder<>(propertiesConverter); } bitField0_ |= 0x00000004; onChanged(); return properties_; } public int getPropertiesCount() { return internalGetProperties().ensureBuilderMap().size(); } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ @java.lang.Override public boolean containsProperties(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetProperties().ensureBuilderMap().containsKey(key); } /** * Use {@link #getPropertiesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> getProperties() { return getPropertiesMap(); } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ @java.lang.Override public java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> getPropertiesMap() { return internalGetProperties().getImmutableMap(); } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ @java.lang.Override public /* nullable */ ai.wanaku.core.exchange.PropertySchema getPropertiesOrDefault(java.lang.String key, /* nullable */ ai.wanaku.core.exchange.PropertySchema defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchemaOrBuilder> map = internalGetMutableProperties().ensureBuilderMap(); return map.containsKey(key) ? propertiesConverter.build(map.get(key)) : defaultValue; } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ @java.lang.Override public ai.wanaku.core.exchange.PropertySchema getPropertiesOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchemaOrBuilder> map = internalGetMutableProperties().ensureBuilderMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return propertiesConverter.build(map.get(key)); } public Builder clearProperties() { bitField0_ = (bitField0_ & ~0x00000004); internalGetMutableProperties().clear(); return this; } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ public Builder removeProperties(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableProperties().ensureBuilderMap().remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> getMutableProperties() { bitField0_ |= 0x00000004; return internalGetMutableProperties().ensureMessageMap(); } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ public Builder putProperties(java.lang.String key, ai.wanaku.core.exchange.PropertySchema value) { if (key == null) { throw new NullPointerException("map key"); } if (value == null) { throw new NullPointerException("map value"); } internalGetMutableProperties().ensureBuilderMap().put(key, value); bitField0_ |= 0x00000004; return this; } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ public Builder putAllProperties(java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> values) { for (java.util.Map.Entry<java.lang.String, ai.wanaku.core.exchange.PropertySchema> e : values.entrySet()) { if (e.getKey() == null || e.getValue() == null) { throw new NullPointerException(); } } internalGetMutableProperties().ensureBuilderMap().putAll(values); bitField0_ |= 0x00000004; return this; } /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ public ai.wanaku.core.exchange.PropertySchema.Builder putPropertiesBuilderIfAbsent(java.lang.String key) { java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchemaOrBuilder> builderMap = internalGetMutableProperties().ensureBuilderMap(); ai.wanaku.core.exchange.PropertySchemaOrBuilder entry = builderMap.get(key); if (entry == null) { entry = ai.wanaku.core.exchange.PropertySchema.newBuilder(); builderMap.put(key, entry); } if (entry instanceof ai.wanaku.core.exchange.PropertySchema) { entry = ((ai.wanaku.core.exchange.PropertySchema) entry).toBuilder(); builderMap.put(key, entry); } return (ai.wanaku.core.exchange.PropertySchema.Builder) entry; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:tool.ProvisionReply) } // @@protoc_insertion_point(class_scope:tool.ProvisionReply) private static final ai.wanaku.core.exchange.ProvisionReply DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.ProvisionReply(); } public static ai.wanaku.core.exchange.ProvisionReply getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ProvisionReply> PARSER = new com.google.protobuf.AbstractParser<ProvisionReply>() { @java.lang.Override public ProvisionReply parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<ProvisionReply> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ProvisionReply> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.ProvisionReply getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionReplyOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface ProvisionReplyOrBuilder extends // @@protoc_insertion_point(interface_extends:tool.ProvisionReply) com.google.protobuf.MessageOrBuilder { /** * <code>string configurationUri = 1;</code> * @return The configurationUri. */ java.lang.String getConfigurationUri(); /** * <code>string configurationUri = 1;</code> * @return The bytes for configurationUri. */ com.google.protobuf.ByteString getConfigurationUriBytes(); /** * <code>string secretUri = 2;</code> * @return The secretUri. */ java.lang.String getSecretUri(); /** * <code>string secretUri = 2;</code> * @return The bytes for secretUri. */ com.google.protobuf.ByteString getSecretUriBytes(); /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ int getPropertiesCount(); /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ boolean containsProperties(java.lang.String key); /** * Use {@link #getPropertiesMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> getProperties(); /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ java.util.Map<java.lang.String, ai.wanaku.core.exchange.PropertySchema> getPropertiesMap(); /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ /* nullable */ ai.wanaku.core.exchange.PropertySchema getPropertiesOrDefault(java.lang.String key, /* nullable */ ai.wanaku.core.exchange.PropertySchema defaultValue); /** * <code>map&lt;string, .tool.PropertySchema&gt; properties = 3;</code> */ ai.wanaku.core.exchange.PropertySchema getPropertiesOrThrow(java.lang.String key); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionRequest.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * The provision request message * </pre> * * Protobuf type {@code tool.ProvisionRequest} */ public final class ProvisionRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tool.ProvisionRequest) ProvisionRequestOrBuilder { private static final long serialVersionUID = 0L; // Use ProvisionRequest.newBuilder() to construct. private ProvisionRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ProvisionRequest() { uri_ = ""; } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ProvisionRequest(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionRequest_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ProvisionRequest.class, ai.wanaku.core.exchange.ProvisionRequest.Builder.class); } private int bitField0_; public static final int URI_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object uri_ = ""; /** * <code>string uri = 1;</code> * @return The uri. */ @java.lang.Override public java.lang.String getUri() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); uri_ = s; return s; } } /** * <code>string uri = 1;</code> * @return The bytes for uri. */ @java.lang.Override public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); uri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int CONFIGURATION_FIELD_NUMBER = 2; private ai.wanaku.core.exchange.Configuration configuration_; /** * <code>.tool.Configuration configuration = 2;</code> * @return Whether the configuration field is set. */ @java.lang.Override public boolean hasConfiguration() { return ((bitField0_ & 0x00000001) != 0); } /** * <code>.tool.Configuration configuration = 2;</code> * @return The configuration. */ @java.lang.Override public ai.wanaku.core.exchange.Configuration getConfiguration() { return configuration_ == null ? ai.wanaku.core.exchange.Configuration.getDefaultInstance() : configuration_; } /** * <code>.tool.Configuration configuration = 2;</code> */ @java.lang.Override public ai.wanaku.core.exchange.ConfigurationOrBuilder getConfigurationOrBuilder() { return configuration_ == null ? ai.wanaku.core.exchange.Configuration.getDefaultInstance() : configuration_; } public static final int SECRET_FIELD_NUMBER = 3; private ai.wanaku.core.exchange.Secret secret_; /** * <code>.tool.Secret secret = 3;</code> * @return Whether the secret field is set. */ @java.lang.Override public boolean hasSecret() { return ((bitField0_ & 0x00000002) != 0); } /** * <code>.tool.Secret secret = 3;</code> * @return The secret. */ @java.lang.Override public ai.wanaku.core.exchange.Secret getSecret() { return secret_ == null ? ai.wanaku.core.exchange.Secret.getDefaultInstance() : secret_; } /** * <code>.tool.Secret secret = 3;</code> */ @java.lang.Override public ai.wanaku.core.exchange.SecretOrBuilder getSecretOrBuilder() { return secret_ == null ? ai.wanaku.core.exchange.Secret.getDefaultInstance() : secret_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); } if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getConfiguration()); } if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getSecret()); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConfiguration()); } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSecret()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.ProvisionRequest)) { return super.equals(obj); } ai.wanaku.core.exchange.ProvisionRequest other = (ai.wanaku.core.exchange.ProvisionRequest) obj; if (!getUri().equals(other.getUri())) return false; if (hasConfiguration() != other.hasConfiguration()) return false; if (hasConfiguration()) { if (!getConfiguration().equals(other.getConfiguration())) return false; } if (hasSecret() != other.hasSecret()) return false; if (hasSecret()) { if (!getSecret().equals(other.getSecret())) return false; } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + URI_FIELD_NUMBER; hash = (53 * hash) + getUri().hashCode(); if (hasConfiguration()) { hash = (37 * hash) + CONFIGURATION_FIELD_NUMBER; hash = (53 * hash) + getConfiguration().hashCode(); } if (hasSecret()) { hash = (37 * hash) + SECRET_FIELD_NUMBER; hash = (53 * hash) + getSecret().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ProvisionRequest parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ProvisionRequest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.ProvisionRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * The provision request message * </pre> * * Protobuf type {@code tool.ProvisionRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:tool.ProvisionRequest) ai.wanaku.core.exchange.ProvisionRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionRequest_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ProvisionRequest.class, ai.wanaku.core.exchange.ProvisionRequest.Builder.class); } // Construct using ai.wanaku.core.exchange.ProvisionRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getConfigurationFieldBuilder(); getSecretFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; uri_ = ""; configuration_ = null; if (configurationBuilder_ != null) { configurationBuilder_.dispose(); configurationBuilder_ = null; } secret_ = null; if (secretBuilder_ != null) { secretBuilder_.dispose(); secretBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_ProvisionRequest_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.ProvisionRequest getDefaultInstanceForType() { return ai.wanaku.core.exchange.ProvisionRequest.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.ProvisionRequest build() { ai.wanaku.core.exchange.ProvisionRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.ProvisionRequest buildPartial() { ai.wanaku.core.exchange.ProvisionRequest result = new ai.wanaku.core.exchange.ProvisionRequest(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.ProvisionRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.uri_ = uri_; } int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000002) != 0)) { result.configuration_ = configurationBuilder_ == null ? configuration_ : configurationBuilder_.build(); to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000004) != 0)) { result.secret_ = secretBuilder_ == null ? secret_ : secretBuilder_.build(); to_bitField0_ |= 0x00000002; } result.bitField0_ |= to_bitField0_; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.ProvisionRequest) { return mergeFrom((ai.wanaku.core.exchange.ProvisionRequest) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.ProvisionRequest other) { if (other == ai.wanaku.core.exchange.ProvisionRequest.getDefaultInstance()) return this; if (!other.getUri().isEmpty()) { uri_ = other.uri_; bitField0_ |= 0x00000001; onChanged(); } if (other.hasConfiguration()) { mergeConfiguration(other.getConfiguration()); } if (other.hasSecret()) { mergeSecret(other.getSecret()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 10: { uri_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { input.readMessage(getConfigurationFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000002; break; } // case 18 case 26: { input.readMessage(getSecretFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000004; break; } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object uri_ = ""; /** * <code>string uri = 1;</code> * @return The uri. */ public java.lang.String getUri() { java.lang.Object ref = uri_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); uri_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string uri = 1;</code> * @return The bytes for uri. */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); uri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string uri = 1;</code> * @param value The uri to set. * @return This builder for chaining. */ public Builder setUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } uri_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>string uri = 1;</code> * @return This builder for chaining. */ public Builder clearUri() { uri_ = getDefaultInstance().getUri(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * <code>string uri = 1;</code> * @param value The bytes for uri to set. * @return This builder for chaining. */ public Builder setUriBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); uri_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private ai.wanaku.core.exchange.Configuration configuration_; private com.google.protobuf.SingleFieldBuilderV3<ai.wanaku.core.exchange.Configuration, ai.wanaku.core.exchange.Configuration.Builder, ai.wanaku.core.exchange.ConfigurationOrBuilder> configurationBuilder_; /** * <code>.tool.Configuration configuration = 2;</code> * @return Whether the configuration field is set. */ public boolean hasConfiguration() { return ((bitField0_ & 0x00000002) != 0); } /** * <code>.tool.Configuration configuration = 2;</code> * @return The configuration. */ public ai.wanaku.core.exchange.Configuration getConfiguration() { if (configurationBuilder_ == null) { return configuration_ == null ? ai.wanaku.core.exchange.Configuration.getDefaultInstance() : configuration_; } else { return configurationBuilder_.getMessage(); } } /** * <code>.tool.Configuration configuration = 2;</code> */ public Builder setConfiguration(ai.wanaku.core.exchange.Configuration value) { if (configurationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } configuration_ = value; } else { configurationBuilder_.setMessage(value); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>.tool.Configuration configuration = 2;</code> */ public Builder setConfiguration(ai.wanaku.core.exchange.Configuration.Builder builderForValue) { if (configurationBuilder_ == null) { configuration_ = builderForValue.build(); } else { configurationBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>.tool.Configuration configuration = 2;</code> */ public Builder mergeConfiguration(ai.wanaku.core.exchange.Configuration value) { if (configurationBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) && configuration_ != null && configuration_ != ai.wanaku.core.exchange.Configuration.getDefaultInstance()) { getConfigurationBuilder().mergeFrom(value); } else { configuration_ = value; } } else { configurationBuilder_.mergeFrom(value); } if (configuration_ != null) { bitField0_ |= 0x00000002; onChanged(); } return this; } /** * <code>.tool.Configuration configuration = 2;</code> */ public Builder clearConfiguration() { bitField0_ = (bitField0_ & ~0x00000002); configuration_ = null; if (configurationBuilder_ != null) { configurationBuilder_.dispose(); configurationBuilder_ = null; } onChanged(); return this; } /** * <code>.tool.Configuration configuration = 2;</code> */ public ai.wanaku.core.exchange.Configuration.Builder getConfigurationBuilder() { bitField0_ |= 0x00000002; onChanged(); return getConfigurationFieldBuilder().getBuilder(); } /** * <code>.tool.Configuration configuration = 2;</code> */ public ai.wanaku.core.exchange.ConfigurationOrBuilder getConfigurationOrBuilder() { if (configurationBuilder_ != null) { return configurationBuilder_.getMessageOrBuilder(); } else { return configuration_ == null ? ai.wanaku.core.exchange.Configuration.getDefaultInstance() : configuration_; } } /** * <code>.tool.Configuration configuration = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3<ai.wanaku.core.exchange.Configuration, ai.wanaku.core.exchange.Configuration.Builder, ai.wanaku.core.exchange.ConfigurationOrBuilder> getConfigurationFieldBuilder() { if (configurationBuilder_ == null) { configurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<ai.wanaku.core.exchange.Configuration, ai.wanaku.core.exchange.Configuration.Builder, ai.wanaku.core.exchange.ConfigurationOrBuilder>(getConfiguration(), getParentForChildren(), isClean()); configuration_ = null; } return configurationBuilder_; } private ai.wanaku.core.exchange.Secret secret_; private com.google.protobuf.SingleFieldBuilderV3<ai.wanaku.core.exchange.Secret, ai.wanaku.core.exchange.Secret.Builder, ai.wanaku.core.exchange.SecretOrBuilder> secretBuilder_; /** * <code>.tool.Secret secret = 3;</code> * @return Whether the secret field is set. */ public boolean hasSecret() { return ((bitField0_ & 0x00000004) != 0); } /** * <code>.tool.Secret secret = 3;</code> * @return The secret. */ public ai.wanaku.core.exchange.Secret getSecret() { if (secretBuilder_ == null) { return secret_ == null ? ai.wanaku.core.exchange.Secret.getDefaultInstance() : secret_; } else { return secretBuilder_.getMessage(); } } /** * <code>.tool.Secret secret = 3;</code> */ public Builder setSecret(ai.wanaku.core.exchange.Secret value) { if (secretBuilder_ == null) { if (value == null) { throw new NullPointerException(); } secret_ = value; } else { secretBuilder_.setMessage(value); } bitField0_ |= 0x00000004; onChanged(); return this; } /** * <code>.tool.Secret secret = 3;</code> */ public Builder setSecret(ai.wanaku.core.exchange.Secret.Builder builderForValue) { if (secretBuilder_ == null) { secret_ = builderForValue.build(); } else { secretBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000004; onChanged(); return this; } /** * <code>.tool.Secret secret = 3;</code> */ public Builder mergeSecret(ai.wanaku.core.exchange.Secret value) { if (secretBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0) && secret_ != null && secret_ != ai.wanaku.core.exchange.Secret.getDefaultInstance()) { getSecretBuilder().mergeFrom(value); } else { secret_ = value; } } else { secretBuilder_.mergeFrom(value); } if (secret_ != null) { bitField0_ |= 0x00000004; onChanged(); } return this; } /** * <code>.tool.Secret secret = 3;</code> */ public Builder clearSecret() { bitField0_ = (bitField0_ & ~0x00000004); secret_ = null; if (secretBuilder_ != null) { secretBuilder_.dispose(); secretBuilder_ = null; } onChanged(); return this; } /** * <code>.tool.Secret secret = 3;</code> */ public ai.wanaku.core.exchange.Secret.Builder getSecretBuilder() { bitField0_ |= 0x00000004; onChanged(); return getSecretFieldBuilder().getBuilder(); } /** * <code>.tool.Secret secret = 3;</code> */ public ai.wanaku.core.exchange.SecretOrBuilder getSecretOrBuilder() { if (secretBuilder_ != null) { return secretBuilder_.getMessageOrBuilder(); } else { return secret_ == null ? ai.wanaku.core.exchange.Secret.getDefaultInstance() : secret_; } } /** * <code>.tool.Secret secret = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3<ai.wanaku.core.exchange.Secret, ai.wanaku.core.exchange.Secret.Builder, ai.wanaku.core.exchange.SecretOrBuilder> getSecretFieldBuilder() { if (secretBuilder_ == null) { secretBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<ai.wanaku.core.exchange.Secret, ai.wanaku.core.exchange.Secret.Builder, ai.wanaku.core.exchange.SecretOrBuilder>(getSecret(), getParentForChildren(), isClean()); secret_ = null; } return secretBuilder_; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:tool.ProvisionRequest) } // @@protoc_insertion_point(class_scope:tool.ProvisionRequest) private static final ai.wanaku.core.exchange.ProvisionRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.ProvisionRequest(); } public static ai.wanaku.core.exchange.ProvisionRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ProvisionRequest> PARSER = new com.google.protobuf.AbstractParser<ProvisionRequest>() { @java.lang.Override public ProvisionRequest parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<ProvisionRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ProvisionRequest> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.ProvisionRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionRequestOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface ProvisionRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:tool.ProvisionRequest) com.google.protobuf.MessageOrBuilder { /** * <code>string uri = 1;</code> * @return The uri. */ java.lang.String getUri(); /** * <code>string uri = 1;</code> * @return The bytes for uri. */ com.google.protobuf.ByteString getUriBytes(); /** * <code>.tool.Configuration configuration = 2;</code> * @return Whether the configuration field is set. */ boolean hasConfiguration(); /** * <code>.tool.Configuration configuration = 2;</code> * @return The configuration. */ ai.wanaku.core.exchange.Configuration getConfiguration(); /** * <code>.tool.Configuration configuration = 2;</code> */ ai.wanaku.core.exchange.ConfigurationOrBuilder getConfigurationOrBuilder(); /** * <code>.tool.Secret secret = 3;</code> * @return Whether the secret field is set. */ boolean hasSecret(); /** * <code>.tool.Secret secret = 3;</code> * @return The secret. */ ai.wanaku.core.exchange.Secret getSecret(); /** * <code>.tool.Secret secret = 3;</code> */ ai.wanaku.core.exchange.SecretOrBuilder getSecretOrBuilder(); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/Provisioner.java
package ai.wanaku.core.exchange; import io.quarkus.grpc.MutinyService; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: provision.proto") public interface Provisioner extends MutinyService { /** * <pre> * Invokes a tool * </pre> */ io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ProvisionReply> provision(ai.wanaku.core.exchange.ProvisionRequest request); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionerBean.java
package ai.wanaku.core.exchange; import io.grpc.BindableService; import io.quarkus.grpc.GrpcService; import io.quarkus.grpc.MutinyBean; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: provision.proto") public class ProvisionerBean extends MutinyProvisionerGrpc.ProvisionerImplBase implements BindableService, MutinyBean { private final Provisioner delegate; ProvisionerBean(@GrpcService Provisioner delegate) { this.delegate = delegate; } @Override public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ProvisionReply> provision(ai.wanaku.core.exchange.ProvisionRequest request) { try { return delegate.provision(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionerClient.java
package ai.wanaku.core.exchange; import java.util.function.BiFunction; import io.quarkus.grpc.MutinyClient; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: provision.proto") public class ProvisionerClient implements Provisioner, MutinyClient<MutinyProvisionerGrpc.MutinyProvisionerStub> { private final MutinyProvisionerGrpc.MutinyProvisionerStub stub; public ProvisionerClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyProvisionerGrpc.MutinyProvisionerStub, MutinyProvisionerGrpc.MutinyProvisionerStub> stubConfigurator) { this.stub = stubConfigurator.apply(name, MutinyProvisionerGrpc.newMutinyStub(channel)); } private ProvisionerClient(MutinyProvisionerGrpc.MutinyProvisionerStub stub) { this.stub = stub; } public ProvisionerClient newInstanceWithStub(MutinyProvisionerGrpc.MutinyProvisionerStub stub) { return new ProvisionerClient(stub); } @Override public MutinyProvisionerGrpc.MutinyProvisionerStub getStub() { return stub; } @Override public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ProvisionReply> provision(ai.wanaku.core.exchange.ProvisionRequest request) { return stub.provision(request); } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ProvisionerGrpc.java
package ai.wanaku.core.exchange; import static io.grpc.MethodDescriptor.generateFullMethodName; /** * <pre> * The inquirer exchange service definition. * </pre> */ @io.quarkus.Generated(value = "by gRPC proto compiler (version 1.69.1)", comments = "Source: provision.proto") @io.grpc.stub.annotations.GrpcGenerated public final class ProvisionerGrpc { private ProvisionerGrpc() { } public static final java.lang.String SERVICE_NAME = "tool.Provisioner"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ProvisionRequest, ai.wanaku.core.exchange.ProvisionReply> getProvisionMethod; @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + "Provision", requestType = ai.wanaku.core.exchange.ProvisionRequest.class, responseType = ai.wanaku.core.exchange.ProvisionReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ProvisionRequest, ai.wanaku.core.exchange.ProvisionReply> getProvisionMethod() { io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ProvisionRequest, ai.wanaku.core.exchange.ProvisionReply> getProvisionMethod; if ((getProvisionMethod = ProvisionerGrpc.getProvisionMethod) == null) { synchronized (ProvisionerGrpc.class) { if ((getProvisionMethod = ProvisionerGrpc.getProvisionMethod) == null) { ProvisionerGrpc.getProvisionMethod = getProvisionMethod = io.grpc.MethodDescriptor.<ai.wanaku.core.exchange.ProvisionRequest, ai.wanaku.core.exchange.ProvisionReply>newBuilder().setType(io.grpc.MethodDescriptor.MethodType.UNARY).setFullMethodName(generateFullMethodName(SERVICE_NAME, "Provision")).setSampledToLocalTracing(true).setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(ai.wanaku.core.exchange.ProvisionRequest.getDefaultInstance())).setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(ai.wanaku.core.exchange.ProvisionReply.getDefaultInstance())).setSchemaDescriptor(new ProvisionerMethodDescriptorSupplier("Provision")).build(); } } } return getProvisionMethod; } /** * Creates a new async stub that supports all call types for the service */ public static ProvisionerStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ProvisionerStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ProvisionerStub>() { @java.lang.Override public ProvisionerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ProvisionerStub(channel, callOptions); } }; return ProvisionerStub.newStub(factory, channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static ProvisionerBlockingStub newBlockingStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ProvisionerBlockingStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ProvisionerBlockingStub>() { @java.lang.Override public ProvisionerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ProvisionerBlockingStub(channel, callOptions); } }; return ProvisionerBlockingStub.newStub(factory, channel); } /** * Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static ProvisionerFutureStub newFutureStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ProvisionerFutureStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ProvisionerFutureStub>() { @java.lang.Override public ProvisionerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ProvisionerFutureStub(channel, callOptions); } }; return ProvisionerFutureStub.newStub(factory, channel); } /** * <pre> * The inquirer exchange service definition. * </pre> */ public interface AsyncService { /** * <pre> * Invokes a tool * </pre> */ default void provision(ai.wanaku.core.exchange.ProvisionRequest request, io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ProvisionReply> responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getProvisionMethod(), responseObserver); } } /** * Base class for the server implementation of the service Provisioner. * <pre> * The inquirer exchange service definition. * </pre> */ public static abstract class ProvisionerImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { return ProvisionerGrpc.bindService(this); } } /** * A stub to allow clients to do asynchronous rpc calls to service Provisioner. * <pre> * The inquirer exchange service definition. * </pre> */ public static class ProvisionerStub extends io.grpc.stub.AbstractAsyncStub<ProvisionerStub> { private ProvisionerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ProvisionerStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ProvisionerStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public void provision(ai.wanaku.core.exchange.ProvisionRequest request, io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ProvisionReply> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall(getChannel().newCall(getProvisionMethod(), getCallOptions()), request, responseObserver); } } /** * A stub to allow clients to do synchronous rpc calls to service Provisioner. * <pre> * The inquirer exchange service definition. * </pre> */ public static class ProvisionerBlockingStub extends io.grpc.stub.AbstractBlockingStub<ProvisionerBlockingStub> { private ProvisionerBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ProvisionerBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ProvisionerBlockingStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public ai.wanaku.core.exchange.ProvisionReply provision(ai.wanaku.core.exchange.ProvisionRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall(getChannel(), getProvisionMethod(), getCallOptions(), request); } } /** * A stub to allow clients to do ListenableFuture-style rpc calls to service Provisioner. * <pre> * The inquirer exchange service definition. * </pre> */ public static class ProvisionerFutureStub extends io.grpc.stub.AbstractFutureStub<ProvisionerFutureStub> { private ProvisionerFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ProvisionerFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ProvisionerFutureStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public com.google.common.util.concurrent.ListenableFuture<ai.wanaku.core.exchange.ProvisionReply> provision(ai.wanaku.core.exchange.ProvisionRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall(getChannel().newCall(getProvisionMethod(), getCallOptions()), request); } } private static final int METHODID_PROVISION = 0; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final AsyncService serviceImpl; private final int methodId; MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { case METHODID_PROVISION: serviceImpl.provision((ai.wanaku.core.exchange.ProvisionRequest) request, (io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ProvisionReply>) responseObserver); break; default: throw new AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { default: throw new AssertionError(); } } } public static io.grpc.ServerServiceDefinition bindService(AsyncService service) { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).addMethod(getProvisionMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall(new MethodHandlers<ai.wanaku.core.exchange.ProvisionRequest, ai.wanaku.core.exchange.ProvisionReply>(service, METHODID_PROVISION))).build(); } private static abstract class ProvisionerBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ProvisionerBaseDescriptorSupplier() { } @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("Provisioner"); } } private static final class ProvisionerFileDescriptorSupplier extends ProvisionerBaseDescriptorSupplier { ProvisionerFileDescriptorSupplier() { } } private static final class ProvisionerMethodDescriptorSupplier extends ProvisionerBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final java.lang.String methodName; ProvisionerMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } @java.lang.Override public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { return getServiceDescriptor().findMethodByName(methodName); } } private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (ProvisionerGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME).setSchemaDescriptor(new ProvisionerFileDescriptorSupplier()).addMethod(getProvisionMethod()).build(); } } } return result; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/RegisterAware.java
package ai.wanaku.core.exchange; /** * Defines services that can be registered with the router */ public interface RegisterAware { /** * Register a service with the router */ void register(); /** * Deregister a service with the router */ void deregister(); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceAcquirer.java
package ai.wanaku.core.exchange; import io.quarkus.grpc.MutinyService; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: resourcerequest.proto") public interface ResourceAcquirer extends MutinyService { /** * <pre> * Invokes a tool * </pre> */ io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ResourceReply> resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceAcquirerBean.java
package ai.wanaku.core.exchange; import io.grpc.BindableService; import io.quarkus.grpc.GrpcService; import io.quarkus.grpc.MutinyBean; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: resourcerequest.proto") public class ResourceAcquirerBean extends MutinyResourceAcquirerGrpc.ResourceAcquirerImplBase implements BindableService, MutinyBean { private final ResourceAcquirer delegate; ResourceAcquirerBean(@GrpcService ResourceAcquirer delegate) { this.delegate = delegate; } @Override public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ResourceReply> resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request) { try { return delegate.resourceAcquire(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceAcquirerClient.java
package ai.wanaku.core.exchange; import java.util.function.BiFunction; import io.quarkus.grpc.MutinyClient; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: resourcerequest.proto") public class ResourceAcquirerClient implements ResourceAcquirer, MutinyClient<MutinyResourceAcquirerGrpc.MutinyResourceAcquirerStub> { private final MutinyResourceAcquirerGrpc.MutinyResourceAcquirerStub stub; public ResourceAcquirerClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyResourceAcquirerGrpc.MutinyResourceAcquirerStub, MutinyResourceAcquirerGrpc.MutinyResourceAcquirerStub> stubConfigurator) { this.stub = stubConfigurator.apply(name, MutinyResourceAcquirerGrpc.newMutinyStub(channel)); } private ResourceAcquirerClient(MutinyResourceAcquirerGrpc.MutinyResourceAcquirerStub stub) { this.stub = stub; } public ResourceAcquirerClient newInstanceWithStub(MutinyResourceAcquirerGrpc.MutinyResourceAcquirerStub stub) { return new ResourceAcquirerClient(stub); } @Override public MutinyResourceAcquirerGrpc.MutinyResourceAcquirerStub getStub() { return stub; } @Override public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ResourceReply> resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request) { return stub.resourceAcquire(request); } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceAcquirerDelegate.java
package ai.wanaku.core.exchange; /** * A delegate that can be used by services that provide resources */ public interface ResourceAcquirerDelegate extends RegisterAware, ProvisionAware { /** * Acquire the resource and provide it to the requester * @param request the resource request * @return the resource data and associated metadata about the request */ ResourceReply acquire(ResourceRequest request); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceAcquirerGrpc.java
package ai.wanaku.core.exchange; import static io.grpc.MethodDescriptor.generateFullMethodName; /** * <pre> * The tool exchange service definition. * </pre> */ @io.quarkus.Generated(value = "by gRPC proto compiler (version 1.69.1)", comments = "Source: resourcerequest.proto") @io.grpc.stub.annotations.GrpcGenerated public final class ResourceAcquirerGrpc { private ResourceAcquirerGrpc() { } public static final java.lang.String SERVICE_NAME = "resource.ResourceAcquirer"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ResourceRequest, ai.wanaku.core.exchange.ResourceReply> getResourceAcquireMethod; @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + "ResourceAcquire", requestType = ai.wanaku.core.exchange.ResourceRequest.class, responseType = ai.wanaku.core.exchange.ResourceReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ResourceRequest, ai.wanaku.core.exchange.ResourceReply> getResourceAcquireMethod() { io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ResourceRequest, ai.wanaku.core.exchange.ResourceReply> getResourceAcquireMethod; if ((getResourceAcquireMethod = ResourceAcquirerGrpc.getResourceAcquireMethod) == null) { synchronized (ResourceAcquirerGrpc.class) { if ((getResourceAcquireMethod = ResourceAcquirerGrpc.getResourceAcquireMethod) == null) { ResourceAcquirerGrpc.getResourceAcquireMethod = getResourceAcquireMethod = io.grpc.MethodDescriptor.<ai.wanaku.core.exchange.ResourceRequest, ai.wanaku.core.exchange.ResourceReply>newBuilder().setType(io.grpc.MethodDescriptor.MethodType.UNARY).setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResourceAcquire")).setSampledToLocalTracing(true).setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(ai.wanaku.core.exchange.ResourceRequest.getDefaultInstance())).setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(ai.wanaku.core.exchange.ResourceReply.getDefaultInstance())).setSchemaDescriptor(new ResourceAcquirerMethodDescriptorSupplier("ResourceAcquire")).build(); } } } return getResourceAcquireMethod; } /** * Creates a new async stub that supports all call types for the service */ public static ResourceAcquirerStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ResourceAcquirerStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ResourceAcquirerStub>() { @java.lang.Override public ResourceAcquirerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ResourceAcquirerStub(channel, callOptions); } }; return ResourceAcquirerStub.newStub(factory, channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static ResourceAcquirerBlockingStub newBlockingStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ResourceAcquirerBlockingStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ResourceAcquirerBlockingStub>() { @java.lang.Override public ResourceAcquirerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ResourceAcquirerBlockingStub(channel, callOptions); } }; return ResourceAcquirerBlockingStub.newStub(factory, channel); } /** * Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static ResourceAcquirerFutureStub newFutureStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ResourceAcquirerFutureStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ResourceAcquirerFutureStub>() { @java.lang.Override public ResourceAcquirerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ResourceAcquirerFutureStub(channel, callOptions); } }; return ResourceAcquirerFutureStub.newStub(factory, channel); } /** * <pre> * The tool exchange service definition. * </pre> */ public interface AsyncService { /** * <pre> * Invokes a tool * </pre> */ default void resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request, io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ResourceReply> responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getResourceAcquireMethod(), responseObserver); } } /** * Base class for the server implementation of the service ResourceAcquirer. * <pre> * The tool exchange service definition. * </pre> */ public static abstract class ResourceAcquirerImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { return ResourceAcquirerGrpc.bindService(this); } } /** * A stub to allow clients to do asynchronous rpc calls to service ResourceAcquirer. * <pre> * The tool exchange service definition. * </pre> */ public static class ResourceAcquirerStub extends io.grpc.stub.AbstractAsyncStub<ResourceAcquirerStub> { private ResourceAcquirerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ResourceAcquirerStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ResourceAcquirerStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public void resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request, io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ResourceReply> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall(getChannel().newCall(getResourceAcquireMethod(), getCallOptions()), request, responseObserver); } } /** * A stub to allow clients to do synchronous rpc calls to service ResourceAcquirer. * <pre> * The tool exchange service definition. * </pre> */ public static class ResourceAcquirerBlockingStub extends io.grpc.stub.AbstractBlockingStub<ResourceAcquirerBlockingStub> { private ResourceAcquirerBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ResourceAcquirerBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ResourceAcquirerBlockingStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public ai.wanaku.core.exchange.ResourceReply resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall(getChannel(), getResourceAcquireMethod(), getCallOptions(), request); } } /** * A stub to allow clients to do ListenableFuture-style rpc calls to service ResourceAcquirer. * <pre> * The tool exchange service definition. * </pre> */ public static class ResourceAcquirerFutureStub extends io.grpc.stub.AbstractFutureStub<ResourceAcquirerFutureStub> { private ResourceAcquirerFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ResourceAcquirerFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ResourceAcquirerFutureStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public com.google.common.util.concurrent.ListenableFuture<ai.wanaku.core.exchange.ResourceReply> resourceAcquire(ai.wanaku.core.exchange.ResourceRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall(getChannel().newCall(getResourceAcquireMethod(), getCallOptions()), request); } } private static final int METHODID_RESOURCE_ACQUIRE = 0; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final AsyncService serviceImpl; private final int methodId; MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { case METHODID_RESOURCE_ACQUIRE: serviceImpl.resourceAcquire((ai.wanaku.core.exchange.ResourceRequest) request, (io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ResourceReply>) responseObserver); break; default: throw new AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { default: throw new AssertionError(); } } } public static io.grpc.ServerServiceDefinition bindService(AsyncService service) { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).addMethod(getResourceAcquireMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall(new MethodHandlers<ai.wanaku.core.exchange.ResourceRequest, ai.wanaku.core.exchange.ResourceReply>(service, METHODID_RESOURCE_ACQUIRE))).build(); } private static abstract class ResourceAcquirerBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ResourceAcquirerBaseDescriptorSupplier() { } @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return ai.wanaku.core.exchange.ResourceExchange.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("ResourceAcquirer"); } } private static final class ResourceAcquirerFileDescriptorSupplier extends ResourceAcquirerBaseDescriptorSupplier { ResourceAcquirerFileDescriptorSupplier() { } } private static final class ResourceAcquirerMethodDescriptorSupplier extends ResourceAcquirerBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final java.lang.String methodName; ResourceAcquirerMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } @java.lang.Override public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { return getServiceDescriptor().findMethodByName(methodName); } } private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (ResourceAcquirerGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME).setSchemaDescriptor(new ResourceAcquirerFileDescriptorSupplier()).addMethod(getResourceAcquireMethod()).build(); } } } return result; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceExchange.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: resourcerequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public final class ResourceExchange { private ResourceExchange() { } public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } static final com.google.protobuf.Descriptors.Descriptor internal_static_resource_ResourceRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_resource_ResourceRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_resource_ResourceRequest_ParamsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_resource_ResourceRequest_ParamsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_resource_ResourceReply_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_resource_ResourceReply_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\025resourcerequest.proto\022\010resource\"\323\001\n\017Re" + "sourceRequest\022\020\n\010location\030\001 \001(\t\022\014\n\004type\030" + "\002 \001(\t\022\014\n\004name\030\003 \001(\t\0225\n\006params\030\004 \003(\0132%.re" + "source.ResourceRequest.ParamsEntry\022\030\n\020co" + "nfigurationURI\030\005 \001(\t\022\022\n\nsecretsURI\030\006 \001(\t" + "\032-\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + "\001(\t:\0028\001\"1\n\rResourceReply\022\017\n\007isError\030\001 \001(" + "\010\022\017\n\007content\030\002 \003(\t2[\n\020ResourceAcquirer\022G" + "\n\017ResourceAcquire\022\031.resource.ResourceReq" + "uest\032\027.resource.ResourceReply\"\000B-\n\027ai.wa" + "naku.core.exchangeB\020ResourceExchangeP\001b\006" + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_resource_ResourceRequest_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_resource_ResourceRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_resource_ResourceRequest_descriptor, new java.lang.String[] { "Location", "Type", "Name", "Params", "ConfigurationURI", "SecretsURI" }); internal_static_resource_ResourceRequest_ParamsEntry_descriptor = internal_static_resource_ResourceRequest_descriptor.getNestedTypes().get(0); internal_static_resource_ResourceRequest_ParamsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_resource_ResourceRequest_ParamsEntry_descriptor, new java.lang.String[] { "Key", "Value" }); internal_static_resource_ResourceReply_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_resource_ResourceReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_resource_ResourceReply_descriptor, new java.lang.String[] { "IsError", "Content" }); } // @@protoc_insertion_point(outer_class_scope) }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceReply.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: resourcerequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * The invocation response message * </pre> * * Protobuf type {@code resource.ResourceReply} */ public final class ResourceReply extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:resource.ResourceReply) ResourceReplyOrBuilder { private static final long serialVersionUID = 0L; // Use ResourceReply.newBuilder() to construct. private ResourceReply(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ResourceReply() { content_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ResourceReply(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceReply_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceReply_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ResourceReply.class, ai.wanaku.core.exchange.ResourceReply.Builder.class); } public static final int ISERROR_FIELD_NUMBER = 1; private boolean isError_ = false; /** * <code>bool isError = 1;</code> * @return The isError. */ @java.lang.Override public boolean getIsError() { return isError_; } public static final int CONTENT_FIELD_NUMBER = 2; @SuppressWarnings("serial") private com.google.protobuf.LazyStringArrayList content_ = com.google.protobuf.LazyStringArrayList.emptyList(); /** * <code>repeated string content = 2;</code> * @return A list containing the content. */ public com.google.protobuf.ProtocolStringList getContentList() { return content_; } /** * <code>repeated string content = 2;</code> * @return The count of content. */ public int getContentCount() { return content_.size(); } /** * <code>repeated string content = 2;</code> * @param index The index of the element to return. * @return The content at the given index. */ public java.lang.String getContent(int index) { return content_.get(index); } /** * <code>repeated string content = 2;</code> * @param index The index of the value to return. * @return The bytes of the content at the given index. */ public com.google.protobuf.ByteString getContentBytes(int index) { return content_.getByteString(index); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (isError_ != false) { output.writeBool(1, isError_); } for (int i = 0; i < content_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_.getRaw(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (isError_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, isError_); } { int dataSize = 0; for (int i = 0; i < content_.size(); i++) { dataSize += computeStringSizeNoTag(content_.getRaw(i)); } size += dataSize; size += 1 * getContentList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.ResourceReply)) { return super.equals(obj); } ai.wanaku.core.exchange.ResourceReply other = (ai.wanaku.core.exchange.ResourceReply) obj; if (getIsError() != other.getIsError()) return false; if (!getContentList().equals(other.getContentList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ISERROR_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsError()); if (getContentCount() > 0) { hash = (37 * hash) + CONTENT_FIELD_NUMBER; hash = (53 * hash) + getContentList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.ResourceReply parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceReply parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ResourceReply parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ResourceReply parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.ResourceReply prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * The invocation response message * </pre> * * Protobuf type {@code resource.ResourceReply} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:resource.ResourceReply) ai.wanaku.core.exchange.ResourceReplyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceReply_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceReply_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ResourceReply.class, ai.wanaku.core.exchange.ResourceReply.Builder.class); } // Construct using ai.wanaku.core.exchange.ResourceReply.newBuilder() private Builder() { } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; isError_ = false; content_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceReply_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.ResourceReply getDefaultInstanceForType() { return ai.wanaku.core.exchange.ResourceReply.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.ResourceReply build() { ai.wanaku.core.exchange.ResourceReply result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.ResourceReply buildPartial() { ai.wanaku.core.exchange.ResourceReply result = new ai.wanaku.core.exchange.ResourceReply(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.ResourceReply result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.isError_ = isError_; } if (((from_bitField0_ & 0x00000002) != 0)) { content_.makeImmutable(); result.content_ = content_; } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.ResourceReply) { return mergeFrom((ai.wanaku.core.exchange.ResourceReply) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.ResourceReply other) { if (other == ai.wanaku.core.exchange.ResourceReply.getDefaultInstance()) return this; if (other.getIsError() != false) { setIsError(other.getIsError()); } if (!other.content_.isEmpty()) { if (content_.isEmpty()) { content_ = other.content_; bitField0_ |= 0x00000002; } else { ensureContentIsMutable(); content_.addAll(other.content_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 8: { isError_ = input.readBool(); bitField0_ |= 0x00000001; break; } // case 8 case 18: { java.lang.String s = input.readStringRequireUtf8(); ensureContentIsMutable(); content_.add(s); break; } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private boolean isError_; /** * <code>bool isError = 1;</code> * @return The isError. */ @java.lang.Override public boolean getIsError() { return isError_; } /** * <code>bool isError = 1;</code> * @param value The isError to set. * @return This builder for chaining. */ public Builder setIsError(boolean value) { isError_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>bool isError = 1;</code> * @return This builder for chaining. */ public Builder clearIsError() { bitField0_ = (bitField0_ & ~0x00000001); isError_ = false; onChanged(); return this; } private com.google.protobuf.LazyStringArrayList content_ = com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureContentIsMutable() { if (!content_.isModifiable()) { content_ = new com.google.protobuf.LazyStringArrayList(content_); } bitField0_ |= 0x00000002; } /** * <code>repeated string content = 2;</code> * @return A list containing the content. */ public com.google.protobuf.ProtocolStringList getContentList() { content_.makeImmutable(); return content_; } /** * <code>repeated string content = 2;</code> * @return The count of content. */ public int getContentCount() { return content_.size(); } /** * <code>repeated string content = 2;</code> * @param index The index of the element to return. * @return The content at the given index. */ public java.lang.String getContent(int index) { return content_.get(index); } /** * <code>repeated string content = 2;</code> * @param index The index of the value to return. * @return The bytes of the content at the given index. */ public com.google.protobuf.ByteString getContentBytes(int index) { return content_.getByteString(index); } /** * <code>repeated string content = 2;</code> * @param index The index to set the value at. * @param value The content to set. * @return This builder for chaining. */ public Builder setContent(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureContentIsMutable(); content_.set(index, value); bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>repeated string content = 2;</code> * @param value The content to add. * @return This builder for chaining. */ public Builder addContent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureContentIsMutable(); content_.add(value); bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>repeated string content = 2;</code> * @param values The content to add. * @return This builder for chaining. */ public Builder addAllContent(java.lang.Iterable<java.lang.String> values) { ensureContentIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, content_); bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>repeated string content = 2;</code> * @return This builder for chaining. */ public Builder clearContent() { content_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); ; onChanged(); return this; } /** * <code>repeated string content = 2;</code> * @param value The bytes of the content to add. * @return This builder for chaining. */ public Builder addContentBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureContentIsMutable(); content_.add(value); bitField0_ |= 0x00000002; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:resource.ResourceReply) } // @@protoc_insertion_point(class_scope:resource.ResourceReply) private static final ai.wanaku.core.exchange.ResourceReply DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.ResourceReply(); } public static ai.wanaku.core.exchange.ResourceReply getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ResourceReply> PARSER = new com.google.protobuf.AbstractParser<ResourceReply>() { @java.lang.Override public ResourceReply parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<ResourceReply> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ResourceReply> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.ResourceReply getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceReplyOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: resourcerequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface ResourceReplyOrBuilder extends // @@protoc_insertion_point(interface_extends:resource.ResourceReply) com.google.protobuf.MessageOrBuilder { /** * <code>bool isError = 1;</code> * @return The isError. */ boolean getIsError(); /** * <code>repeated string content = 2;</code> * @return A list containing the content. */ java.util.List<java.lang.String> getContentList(); /** * <code>repeated string content = 2;</code> * @return The count of content. */ int getContentCount(); /** * <code>repeated string content = 2;</code> * @param index The index of the element to return. * @return The content at the given index. */ java.lang.String getContent(int index); /** * <code>repeated string content = 2;</code> * @param index The index of the value to return. * @return The bytes of the content at the given index. */ com.google.protobuf.ByteString getContentBytes(int index); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceRequest.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: resourcerequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * The invocation request message * </pre> * * Protobuf type {@code resource.ResourceRequest} */ public final class ResourceRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:resource.ResourceRequest) ResourceRequestOrBuilder { private static final long serialVersionUID = 0L; // Use ResourceRequest.newBuilder() to construct. private ResourceRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ResourceRequest() { location_ = ""; type_ = ""; name_ = ""; configurationURI_ = ""; secretsURI_ = ""; } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ResourceRequest(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceRequest_descriptor; } @SuppressWarnings({ "rawtypes" }) @java.lang.Override protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) { switch(number) { case 4: return internalGetParams(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceRequest_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ResourceRequest.class, ai.wanaku.core.exchange.ResourceRequest.Builder.class); } public static final int LOCATION_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object location_ = ""; /** * <code>string location = 1;</code> * @return The location. */ @java.lang.Override public java.lang.String getLocation() { java.lang.Object ref = location_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); location_ = s; return s; } } /** * <code>string location = 1;</code> * @return The bytes for location. */ @java.lang.Override public com.google.protobuf.ByteString getLocationBytes() { java.lang.Object ref = location_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); location_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int TYPE_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object type_ = ""; /** * <code>string type = 2;</code> * @return The type. */ @java.lang.Override public java.lang.String getType() { java.lang.Object ref = type_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); type_ = s; return s; } } /** * <code>string type = 2;</code> * @return The bytes for type. */ @java.lang.Override public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); type_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int NAME_FIELD_NUMBER = 3; @SuppressWarnings("serial") private volatile java.lang.Object name_ = ""; /** * <code>string name = 3;</code> * @return The name. */ @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <code>string name = 3;</code> * @return The bytes for name. */ @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PARAMS_FIELD_NUMBER = 4; private static final class ParamsDefaultEntryHolder { static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceRequest_ParamsEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, ""); } @SuppressWarnings("serial") private com.google.protobuf.MapField<java.lang.String, java.lang.String> params_; private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetParams() { if (params_ == null) { return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); } return params_; } public int getParamsCount() { return internalGetParams().getMap().size(); } /** * <code>map&lt;string, string&gt; params = 4;</code> */ @java.lang.Override public boolean containsParams(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetParams().getMap().containsKey(key); } /** * Use {@link #getParamsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getParams() { return getParamsMap(); } /** * <code>map&lt;string, string&gt; params = 4;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.String> getParamsMap() { return internalGetParams().getMap(); } /** * <code>map&lt;string, string&gt; params = 4;</code> */ @java.lang.Override public /* nullable */ java.lang.String getParamsOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetParams().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, string&gt; params = 4;</code> */ @java.lang.Override public java.lang.String getParamsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetParams().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int CONFIGURATIONURI_FIELD_NUMBER = 5; @SuppressWarnings("serial") private volatile java.lang.Object configurationURI_ = ""; /** * <code>string configurationURI = 5;</code> * @return The configurationURI. */ @java.lang.Override public java.lang.String getConfigurationURI() { java.lang.Object ref = configurationURI_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); configurationURI_ = s; return s; } } /** * <code>string configurationURI = 5;</code> * @return The bytes for configurationURI. */ @java.lang.Override public com.google.protobuf.ByteString getConfigurationURIBytes() { java.lang.Object ref = configurationURI_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); configurationURI_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SECRETSURI_FIELD_NUMBER = 6; @SuppressWarnings("serial") private volatile java.lang.Object secretsURI_ = ""; /** * <code>string secretsURI = 6;</code> * @return The secretsURI. */ @java.lang.Override public java.lang.String getSecretsURI() { java.lang.Object ref = secretsURI_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); secretsURI_ = s; return s; } } /** * <code>string secretsURI = 6;</code> * @return The bytes for secretsURI. */ @java.lang.Override public com.google.protobuf.ByteString getSecretsURIBytes() { java.lang.Object ref = secretsURI_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); secretsURI_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 4); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(configurationURI_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, configurationURI_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secretsURI_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, secretsURI_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); } for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : internalGetParams().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> params__ = ParamsDefaultEntryHolder.defaultEntry.newBuilderForType().setKey(entry.getKey()).setValue(entry.getValue()).build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, params__); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(configurationURI_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, configurationURI_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secretsURI_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, secretsURI_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.ResourceRequest)) { return super.equals(obj); } ai.wanaku.core.exchange.ResourceRequest other = (ai.wanaku.core.exchange.ResourceRequest) obj; if (!getLocation().equals(other.getLocation())) return false; if (!getType().equals(other.getType())) return false; if (!getName().equals(other.getName())) return false; if (!internalGetParams().equals(other.internalGetParams())) return false; if (!getConfigurationURI().equals(other.getConfigurationURI())) return false; if (!getSecretsURI().equals(other.getSecretsURI())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + LOCATION_FIELD_NUMBER; hash = (53 * hash) + getLocation().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + getType().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (!internalGetParams().getMap().isEmpty()) { hash = (37 * hash) + PARAMS_FIELD_NUMBER; hash = (53 * hash) + internalGetParams().hashCode(); } hash = (37 * hash) + CONFIGURATIONURI_FIELD_NUMBER; hash = (53 * hash) + getConfigurationURI().hashCode(); hash = (37 * hash) + SECRETSURI_FIELD_NUMBER; hash = (53 * hash) + getSecretsURI().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ResourceRequest parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ResourceRequest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.ResourceRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * The invocation request message * </pre> * * Protobuf type {@code resource.ResourceRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:resource.ResourceRequest) ai.wanaku.core.exchange.ResourceRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceRequest_descriptor; } @SuppressWarnings({ "rawtypes" }) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) { switch(number) { case 4: return internalGetParams(); default: throw new RuntimeException("Invalid map field number: " + number); } } @SuppressWarnings({ "rawtypes" }) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number) { switch(number) { case 4: return internalGetMutableParams(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceRequest_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ResourceRequest.class, ai.wanaku.core.exchange.ResourceRequest.Builder.class); } // Construct using ai.wanaku.core.exchange.ResourceRequest.newBuilder() private Builder() { } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; location_ = ""; type_ = ""; name_ = ""; internalGetMutableParams().clear(); configurationURI_ = ""; secretsURI_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ResourceExchange.internal_static_resource_ResourceRequest_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.ResourceRequest getDefaultInstanceForType() { return ai.wanaku.core.exchange.ResourceRequest.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.ResourceRequest build() { ai.wanaku.core.exchange.ResourceRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.ResourceRequest buildPartial() { ai.wanaku.core.exchange.ResourceRequest result = new ai.wanaku.core.exchange.ResourceRequest(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.ResourceRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.location_ = location_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.type_ = type_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.name_ = name_; } if (((from_bitField0_ & 0x00000008) != 0)) { result.params_ = internalGetParams(); result.params_.makeImmutable(); } if (((from_bitField0_ & 0x00000010) != 0)) { result.configurationURI_ = configurationURI_; } if (((from_bitField0_ & 0x00000020) != 0)) { result.secretsURI_ = secretsURI_; } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.ResourceRequest) { return mergeFrom((ai.wanaku.core.exchange.ResourceRequest) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.ResourceRequest other) { if (other == ai.wanaku.core.exchange.ResourceRequest.getDefaultInstance()) return this; if (!other.getLocation().isEmpty()) { location_ = other.location_; bitField0_ |= 0x00000001; onChanged(); } if (!other.getType().isEmpty()) { type_ = other.type_; bitField0_ |= 0x00000002; onChanged(); } if (!other.getName().isEmpty()) { name_ = other.name_; bitField0_ |= 0x00000004; onChanged(); } internalGetMutableParams().mergeFrom(other.internalGetParams()); bitField0_ |= 0x00000008; if (!other.getConfigurationURI().isEmpty()) { configurationURI_ = other.configurationURI_; bitField0_ |= 0x00000010; onChanged(); } if (!other.getSecretsURI().isEmpty()) { secretsURI_ = other.secretsURI_; bitField0_ |= 0x00000020; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 10: { location_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { type_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 case 26: { name_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000004; break; } // case 26 case 34: { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> params__ = input.readMessage(ParamsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableParams().getMutableMap().put(params__.getKey(), params__.getValue()); bitField0_ |= 0x00000008; break; } // case 34 case 42: { configurationURI_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000010; break; } // case 42 case 50: { secretsURI_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000020; break; } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object location_ = ""; /** * <code>string location = 1;</code> * @return The location. */ public java.lang.String getLocation() { java.lang.Object ref = location_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); location_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string location = 1;</code> * @return The bytes for location. */ public com.google.protobuf.ByteString getLocationBytes() { java.lang.Object ref = location_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); location_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string location = 1;</code> * @param value The location to set. * @return This builder for chaining. */ public Builder setLocation(java.lang.String value) { if (value == null) { throw new NullPointerException(); } location_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>string location = 1;</code> * @return This builder for chaining. */ public Builder clearLocation() { location_ = getDefaultInstance().getLocation(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * <code>string location = 1;</code> * @param value The bytes for location to set. * @return This builder for chaining. */ public Builder setLocationBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); location_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object type_ = ""; /** * <code>string type = 2;</code> * @return The type. */ public java.lang.String getType() { java.lang.Object ref = type_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); type_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string type = 2;</code> * @return The bytes for type. */ public com.google.protobuf.ByteString getTypeBytes() { java.lang.Object ref = type_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); type_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string type = 2;</code> * @param value The type to set. * @return This builder for chaining. */ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } type_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>string type = 2;</code> * @return This builder for chaining. */ public Builder clearType() { type_ = getDefaultInstance().getType(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * <code>string type = 2;</code> * @param value The bytes for type to set. * @return This builder for chaining. */ public Builder setTypeBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); type_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object name_ = ""; /** * <code>string name = 3;</code> * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string name = 3;</code> * @return The bytes for name. */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string name = 3;</code> * @param value The name to set. * @return This builder for chaining. */ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * <code>string name = 3;</code> * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * <code>string name = 3;</code> * @param value The bytes for name to set. * @return This builder for chaining. */ public Builder setNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } private com.google.protobuf.MapField<java.lang.String, java.lang.String> params_; private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetParams() { if (params_ == null) { return com.google.protobuf.MapField.emptyMapField(ParamsDefaultEntryHolder.defaultEntry); } return params_; } private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableParams() { if (params_ == null) { params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); } if (!params_.isMutable()) { params_ = params_.copy(); } bitField0_ |= 0x00000008; onChanged(); return params_; } public int getParamsCount() { return internalGetParams().getMap().size(); } /** * <code>map&lt;string, string&gt; params = 4;</code> */ @java.lang.Override public boolean containsParams(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetParams().getMap().containsKey(key); } /** * Use {@link #getParamsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getParams() { return getParamsMap(); } /** * <code>map&lt;string, string&gt; params = 4;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.String> getParamsMap() { return internalGetParams().getMap(); } /** * <code>map&lt;string, string&gt; params = 4;</code> */ @java.lang.Override public /* nullable */ java.lang.String getParamsOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetParams().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, string&gt; params = 4;</code> */ @java.lang.Override public java.lang.String getParamsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetParams().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearParams() { bitField0_ = (bitField0_ & ~0x00000008); internalGetMutableParams().getMutableMap().clear(); return this; } /** * <code>map&lt;string, string&gt; params = 4;</code> */ public Builder removeParams(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableParams().getMutableMap().remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getMutableParams() { bitField0_ |= 0x00000008; return internalGetMutableParams().getMutableMap(); } /** * <code>map&lt;string, string&gt; params = 4;</code> */ public Builder putParams(java.lang.String key, java.lang.String value) { if (key == null) { throw new NullPointerException("map key"); } if (value == null) { throw new NullPointerException("map value"); } internalGetMutableParams().getMutableMap().put(key, value); bitField0_ |= 0x00000008; return this; } /** * <code>map&lt;string, string&gt; params = 4;</code> */ public Builder putAllParams(java.util.Map<java.lang.String, java.lang.String> values) { internalGetMutableParams().getMutableMap().putAll(values); bitField0_ |= 0x00000008; return this; } private java.lang.Object configurationURI_ = ""; /** * <code>string configurationURI = 5;</code> * @return The configurationURI. */ public java.lang.String getConfigurationURI() { java.lang.Object ref = configurationURI_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); configurationURI_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string configurationURI = 5;</code> * @return The bytes for configurationURI. */ public com.google.protobuf.ByteString getConfigurationURIBytes() { java.lang.Object ref = configurationURI_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); configurationURI_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string configurationURI = 5;</code> * @param value The configurationURI to set. * @return This builder for chaining. */ public Builder setConfigurationURI(java.lang.String value) { if (value == null) { throw new NullPointerException(); } configurationURI_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } /** * <code>string configurationURI = 5;</code> * @return This builder for chaining. */ public Builder clearConfigurationURI() { configurationURI_ = getDefaultInstance().getConfigurationURI(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** * <code>string configurationURI = 5;</code> * @param value The bytes for configurationURI to set. * @return This builder for chaining. */ public Builder setConfigurationURIBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); configurationURI_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } private java.lang.Object secretsURI_ = ""; /** * <code>string secretsURI = 6;</code> * @return The secretsURI. */ public java.lang.String getSecretsURI() { java.lang.Object ref = secretsURI_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); secretsURI_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string secretsURI = 6;</code> * @return The bytes for secretsURI. */ public com.google.protobuf.ByteString getSecretsURIBytes() { java.lang.Object ref = secretsURI_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); secretsURI_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string secretsURI = 6;</code> * @param value The secretsURI to set. * @return This builder for chaining. */ public Builder setSecretsURI(java.lang.String value) { if (value == null) { throw new NullPointerException(); } secretsURI_ = value; bitField0_ |= 0x00000020; onChanged(); return this; } /** * <code>string secretsURI = 6;</code> * @return This builder for chaining. */ public Builder clearSecretsURI() { secretsURI_ = getDefaultInstance().getSecretsURI(); bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } /** * <code>string secretsURI = 6;</code> * @param value The bytes for secretsURI to set. * @return This builder for chaining. */ public Builder setSecretsURIBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); secretsURI_ = value; bitField0_ |= 0x00000020; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:resource.ResourceRequest) } // @@protoc_insertion_point(class_scope:resource.ResourceRequest) private static final ai.wanaku.core.exchange.ResourceRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.ResourceRequest(); } public static ai.wanaku.core.exchange.ResourceRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ResourceRequest> PARSER = new com.google.protobuf.AbstractParser<ResourceRequest>() { @java.lang.Override public ResourceRequest parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<ResourceRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ResourceRequest> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.ResourceRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ResourceRequestOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: resourcerequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface ResourceRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:resource.ResourceRequest) com.google.protobuf.MessageOrBuilder { /** * <code>string location = 1;</code> * @return The location. */ java.lang.String getLocation(); /** * <code>string location = 1;</code> * @return The bytes for location. */ com.google.protobuf.ByteString getLocationBytes(); /** * <code>string type = 2;</code> * @return The type. */ java.lang.String getType(); /** * <code>string type = 2;</code> * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); /** * <code>string name = 3;</code> * @return The name. */ java.lang.String getName(); /** * <code>string name = 3;</code> * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); /** * <code>map&lt;string, string&gt; params = 4;</code> */ int getParamsCount(); /** * <code>map&lt;string, string&gt; params = 4;</code> */ boolean containsParams(java.lang.String key); /** * Use {@link #getParamsMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, java.lang.String> getParams(); /** * <code>map&lt;string, string&gt; params = 4;</code> */ java.util.Map<java.lang.String, java.lang.String> getParamsMap(); /** * <code>map&lt;string, string&gt; params = 4;</code> */ /* nullable */ java.lang.String getParamsOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue); /** * <code>map&lt;string, string&gt; params = 4;</code> */ java.lang.String getParamsOrThrow(java.lang.String key); /** * <code>string configurationURI = 5;</code> * @return The configurationURI. */ java.lang.String getConfigurationURI(); /** * <code>string configurationURI = 5;</code> * @return The bytes for configurationURI. */ com.google.protobuf.ByteString getConfigurationURIBytes(); /** * <code>string secretsURI = 6;</code> * @return The secretsURI. */ java.lang.String getSecretsURI(); /** * <code>string secretsURI = 6;</code> * @return The bytes for secretsURI. */ com.google.protobuf.ByteString getSecretsURIBytes(); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/Secret.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * Represents a configuration reference * </pre> * * Protobuf type {@code tool.Secret} */ public final class Secret extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tool.Secret) SecretOrBuilder { private static final long serialVersionUID = 0L; // Use Secret.newBuilder() to construct. private Secret(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private Secret() { type_ = 0; name_ = ""; payload_ = ""; } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new Secret(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Secret_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Secret_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.Secret.class, ai.wanaku.core.exchange.Secret.Builder.class); } public static final int TYPE_FIELD_NUMBER = 1; private int type_ = 0; /** * <code>.tool.PayloadType type = 1;</code> * @return The enum numeric value on the wire for type. */ @java.lang.Override public int getTypeValue() { return type_; } /** * <code>.tool.PayloadType type = 1;</code> * @return The type. */ @java.lang.Override public ai.wanaku.core.exchange.PayloadType getType() { ai.wanaku.core.exchange.PayloadType result = ai.wanaku.core.exchange.PayloadType.forNumber(type_); return result == null ? ai.wanaku.core.exchange.PayloadType.UNRECOGNIZED : result; } public static final int NAME_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object name_ = ""; /** * <code>string name = 2;</code> * @return The name. */ @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** * <code>string name = 2;</code> * @return The bytes for name. */ @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PAYLOAD_FIELD_NUMBER = 3; @SuppressWarnings("serial") private volatile java.lang.Object payload_ = ""; /** * <code>string payload = 3;</code> * @return The payload. */ @java.lang.Override public java.lang.String getPayload() { java.lang.Object ref = payload_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); payload_ = s; return s; } } /** * <code>string payload = 3;</code> * @return The bytes for payload. */ @java.lang.Override public com.google.protobuf.ByteString getPayloadBytes() { java.lang.Object ref = payload_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); payload_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (type_ != ai.wanaku.core.exchange.PayloadType.REFERENCE.getNumber()) { output.writeEnum(1, type_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payload_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, payload_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (type_ != ai.wanaku.core.exchange.PayloadType.REFERENCE.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(payload_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, payload_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.Secret)) { return super.equals(obj); } ai.wanaku.core.exchange.Secret other = (ai.wanaku.core.exchange.Secret) obj; if (type_ != other.type_) return false; if (!getName().equals(other.getName())) return false; if (!getPayload().equals(other.getPayload())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; hash = (53 * hash) + getPayload().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.Secret parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.Secret parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.Secret parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.Secret parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.Secret parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.Secret parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.Secret parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.Secret parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.Secret parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.Secret parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.Secret parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.Secret parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.Secret prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * Represents a configuration reference * </pre> * * Protobuf type {@code tool.Secret} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:tool.Secret) ai.wanaku.core.exchange.SecretOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Secret_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Secret_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.Secret.class, ai.wanaku.core.exchange.Secret.Builder.class); } // Construct using ai.wanaku.core.exchange.Secret.newBuilder() private Builder() { } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; type_ = 0; name_ = ""; payload_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ProvisionExchange.internal_static_tool_Secret_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.Secret getDefaultInstanceForType() { return ai.wanaku.core.exchange.Secret.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.Secret build() { ai.wanaku.core.exchange.Secret result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.Secret buildPartial() { ai.wanaku.core.exchange.Secret result = new ai.wanaku.core.exchange.Secret(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.Secret result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.type_ = type_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.name_ = name_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.payload_ = payload_; } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.Secret) { return mergeFrom((ai.wanaku.core.exchange.Secret) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.Secret other) { if (other == ai.wanaku.core.exchange.Secret.getDefaultInstance()) return this; if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } if (!other.getName().isEmpty()) { name_ = other.name_; bitField0_ |= 0x00000002; onChanged(); } if (!other.getPayload().isEmpty()) { payload_ = other.payload_; bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 8: { type_ = input.readEnum(); bitField0_ |= 0x00000001; break; } // case 8 case 18: { name_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 case 26: { payload_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000004; break; } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private int type_ = 0; /** * <code>.tool.PayloadType type = 1;</code> * @return The enum numeric value on the wire for type. */ @java.lang.Override public int getTypeValue() { return type_; } /** * <code>.tool.PayloadType type = 1;</code> * @param value The enum numeric value on the wire for type to set. * @return This builder for chaining. */ public Builder setTypeValue(int value) { type_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>.tool.PayloadType type = 1;</code> * @return The type. */ @java.lang.Override public ai.wanaku.core.exchange.PayloadType getType() { ai.wanaku.core.exchange.PayloadType result = ai.wanaku.core.exchange.PayloadType.forNumber(type_); return result == null ? ai.wanaku.core.exchange.PayloadType.UNRECOGNIZED : result; } /** * <code>.tool.PayloadType type = 1;</code> * @param value The type to set. * @return This builder for chaining. */ public Builder setType(ai.wanaku.core.exchange.PayloadType value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; type_ = value.getNumber(); onChanged(); return this; } /** * <code>.tool.PayloadType type = 1;</code> * @return This builder for chaining. */ public Builder clearType() { bitField0_ = (bitField0_ & ~0x00000001); type_ = 0; onChanged(); return this; } private java.lang.Object name_ = ""; /** * <code>string name = 2;</code> * @return The name. */ public java.lang.String getName() { java.lang.Object ref = name_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string name = 2;</code> * @return The bytes for name. */ public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); name_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string name = 2;</code> * @param value The name to set. * @return This builder for chaining. */ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } name_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>string name = 2;</code> * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * <code>string name = 2;</code> * @param value The bytes for name to set. * @return This builder for chaining. */ public Builder setNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); name_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object payload_ = ""; /** * <code>string payload = 3;</code> * @return The payload. */ public java.lang.String getPayload() { java.lang.Object ref = payload_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); payload_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string payload = 3;</code> * @return The bytes for payload. */ public com.google.protobuf.ByteString getPayloadBytes() { java.lang.Object ref = payload_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); payload_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string payload = 3;</code> * @param value The payload to set. * @return This builder for chaining. */ public Builder setPayload(java.lang.String value) { if (value == null) { throw new NullPointerException(); } payload_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * <code>string payload = 3;</code> * @return This builder for chaining. */ public Builder clearPayload() { payload_ = getDefaultInstance().getPayload(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * <code>string payload = 3;</code> * @param value The bytes for payload to set. * @return This builder for chaining. */ public Builder setPayloadBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); payload_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:tool.Secret) } // @@protoc_insertion_point(class_scope:tool.Secret) private static final ai.wanaku.core.exchange.Secret DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.Secret(); } public static ai.wanaku.core.exchange.Secret getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<Secret> PARSER = new com.google.protobuf.AbstractParser<Secret>() { @java.lang.Override public Secret parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<Secret> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<Secret> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.Secret getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/SecretOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: provision.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface SecretOrBuilder extends // @@protoc_insertion_point(interface_extends:tool.Secret) com.google.protobuf.MessageOrBuilder { /** * <code>.tool.PayloadType type = 1;</code> * @return The enum numeric value on the wire for type. */ int getTypeValue(); /** * <code>.tool.PayloadType type = 1;</code> * @return The type. */ ai.wanaku.core.exchange.PayloadType getType(); /** * <code>string name = 2;</code> * @return The name. */ java.lang.String getName(); /** * <code>string name = 2;</code> * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); /** * <code>string payload = 3;</code> * @return The payload. */ java.lang.String getPayload(); /** * <code>string payload = 3;</code> * @return The bytes for payload. */ com.google.protobuf.ByteString getPayloadBytes(); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolExchange.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: toolrequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public final class ToolExchange { private ToolExchange() { } public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_ToolInvokeRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_ToolInvokeRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_ToolInvokeRequest_ArgumentsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_ToolInvokeRequest_ArgumentsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_ToolInvokeRequest_HeadersEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_ToolInvokeRequest_HeadersEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tool_ToolInvokeReply_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_tool_ToolInvokeReply_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\021toolrequest.proto\022\004tool\"\260\002\n\021ToolInvoke" + "Request\022\013\n\003uri\030\001 \001(\t\022\014\n\004body\030\002 \001(\t\0229\n\tar" + "guments\030\003 \003(\0132&.tool.ToolInvokeRequest.A" + "rgumentsEntry\022\030\n\020configurationURI\030\004 \001(\t\022" + "\022\n\nsecretsURI\030\005 \001(\t\0225\n\007headers\030\006 \003(\0132$.t" + "ool.ToolInvokeRequest.HeadersEntry\0320\n\016Ar" + "gumentsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + ":\0028\001\032.\n\014HeadersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005val" + "ue\030\002 \001(\t:\0028\001\"3\n\017ToolInvokeReply\022\017\n\007isErr" + "or\030\001 \001(\010\022\017\n\007content\030\002 \003(\t2M\n\013ToolInvoker" + "\022>\n\nInvokeTool\022\027.tool.ToolInvokeRequest\032" + "\025.tool.ToolInvokeReply\"\000B)\n\027ai.wanaku.co" + "re.exchangeB\014ToolExchangeP\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_tool_ToolInvokeRequest_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tool_ToolInvokeRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_ToolInvokeRequest_descriptor, new java.lang.String[] { "Uri", "Body", "Arguments", "ConfigurationURI", "SecretsURI", "Headers" }); internal_static_tool_ToolInvokeRequest_ArgumentsEntry_descriptor = internal_static_tool_ToolInvokeRequest_descriptor.getNestedTypes().get(0); internal_static_tool_ToolInvokeRequest_ArgumentsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_ToolInvokeRequest_ArgumentsEntry_descriptor, new java.lang.String[] { "Key", "Value" }); internal_static_tool_ToolInvokeRequest_HeadersEntry_descriptor = internal_static_tool_ToolInvokeRequest_descriptor.getNestedTypes().get(1); internal_static_tool_ToolInvokeRequest_HeadersEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_ToolInvokeRequest_HeadersEntry_descriptor, new java.lang.String[] { "Key", "Value" }); internal_static_tool_ToolInvokeReply_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tool_ToolInvokeReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(internal_static_tool_ToolInvokeReply_descriptor, new java.lang.String[] { "IsError", "Content" }); } // @@protoc_insertion_point(outer_class_scope) }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolInvokeReply.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: toolrequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * The invocation response message * </pre> * * Protobuf type {@code tool.ToolInvokeReply} */ public final class ToolInvokeReply extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tool.ToolInvokeReply) ToolInvokeReplyOrBuilder { private static final long serialVersionUID = 0L; // Use ToolInvokeReply.newBuilder() to construct. private ToolInvokeReply(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ToolInvokeReply() { content_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ToolInvokeReply(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeReply_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeReply_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ToolInvokeReply.class, ai.wanaku.core.exchange.ToolInvokeReply.Builder.class); } public static final int ISERROR_FIELD_NUMBER = 1; private boolean isError_ = false; /** * <code>bool isError = 1;</code> * @return The isError. */ @java.lang.Override public boolean getIsError() { return isError_; } public static final int CONTENT_FIELD_NUMBER = 2; @SuppressWarnings("serial") private com.google.protobuf.LazyStringArrayList content_ = com.google.protobuf.LazyStringArrayList.emptyList(); /** * <code>repeated string content = 2;</code> * @return A list containing the content. */ public com.google.protobuf.ProtocolStringList getContentList() { return content_; } /** * <code>repeated string content = 2;</code> * @return The count of content. */ public int getContentCount() { return content_.size(); } /** * <code>repeated string content = 2;</code> * @param index The index of the element to return. * @return The content at the given index. */ public java.lang.String getContent(int index) { return content_.get(index); } /** * <code>repeated string content = 2;</code> * @param index The index of the value to return. * @return The bytes of the content at the given index. */ public com.google.protobuf.ByteString getContentBytes(int index) { return content_.getByteString(index); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (isError_ != false) { output.writeBool(1, isError_); } for (int i = 0; i < content_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_.getRaw(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (isError_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, isError_); } { int dataSize = 0; for (int i = 0; i < content_.size(); i++) { dataSize += computeStringSizeNoTag(content_.getRaw(i)); } size += dataSize; size += 1 * getContentList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.ToolInvokeReply)) { return super.equals(obj); } ai.wanaku.core.exchange.ToolInvokeReply other = (ai.wanaku.core.exchange.ToolInvokeReply) obj; if (getIsError() != other.getIsError()) return false; if (!getContentList().equals(other.getContentList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ISERROR_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsError()); if (getContentCount() > 0) { hash = (37 * hash) + CONTENT_FIELD_NUMBER; hash = (53 * hash) + getContentList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeReply parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ToolInvokeReply parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ToolInvokeReply parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.ToolInvokeReply prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * The invocation response message * </pre> * * Protobuf type {@code tool.ToolInvokeReply} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:tool.ToolInvokeReply) ai.wanaku.core.exchange.ToolInvokeReplyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeReply_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeReply_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ToolInvokeReply.class, ai.wanaku.core.exchange.ToolInvokeReply.Builder.class); } // Construct using ai.wanaku.core.exchange.ToolInvokeReply.newBuilder() private Builder() { } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; isError_ = false; content_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeReply_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.ToolInvokeReply getDefaultInstanceForType() { return ai.wanaku.core.exchange.ToolInvokeReply.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.ToolInvokeReply build() { ai.wanaku.core.exchange.ToolInvokeReply result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.ToolInvokeReply buildPartial() { ai.wanaku.core.exchange.ToolInvokeReply result = new ai.wanaku.core.exchange.ToolInvokeReply(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.ToolInvokeReply result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.isError_ = isError_; } if (((from_bitField0_ & 0x00000002) != 0)) { content_.makeImmutable(); result.content_ = content_; } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.ToolInvokeReply) { return mergeFrom((ai.wanaku.core.exchange.ToolInvokeReply) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.ToolInvokeReply other) { if (other == ai.wanaku.core.exchange.ToolInvokeReply.getDefaultInstance()) return this; if (other.getIsError() != false) { setIsError(other.getIsError()); } if (!other.content_.isEmpty()) { if (content_.isEmpty()) { content_ = other.content_; bitField0_ |= 0x00000002; } else { ensureContentIsMutable(); content_.addAll(other.content_); } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 8: { isError_ = input.readBool(); bitField0_ |= 0x00000001; break; } // case 8 case 18: { java.lang.String s = input.readStringRequireUtf8(); ensureContentIsMutable(); content_.add(s); break; } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private boolean isError_; /** * <code>bool isError = 1;</code> * @return The isError. */ @java.lang.Override public boolean getIsError() { return isError_; } /** * <code>bool isError = 1;</code> * @param value The isError to set. * @return This builder for chaining. */ public Builder setIsError(boolean value) { isError_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>bool isError = 1;</code> * @return This builder for chaining. */ public Builder clearIsError() { bitField0_ = (bitField0_ & ~0x00000001); isError_ = false; onChanged(); return this; } private com.google.protobuf.LazyStringArrayList content_ = com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureContentIsMutable() { if (!content_.isModifiable()) { content_ = new com.google.protobuf.LazyStringArrayList(content_); } bitField0_ |= 0x00000002; } /** * <code>repeated string content = 2;</code> * @return A list containing the content. */ public com.google.protobuf.ProtocolStringList getContentList() { content_.makeImmutable(); return content_; } /** * <code>repeated string content = 2;</code> * @return The count of content. */ public int getContentCount() { return content_.size(); } /** * <code>repeated string content = 2;</code> * @param index The index of the element to return. * @return The content at the given index. */ public java.lang.String getContent(int index) { return content_.get(index); } /** * <code>repeated string content = 2;</code> * @param index The index of the value to return. * @return The bytes of the content at the given index. */ public com.google.protobuf.ByteString getContentBytes(int index) { return content_.getByteString(index); } /** * <code>repeated string content = 2;</code> * @param index The index to set the value at. * @param value The content to set. * @return This builder for chaining. */ public Builder setContent(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureContentIsMutable(); content_.set(index, value); bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>repeated string content = 2;</code> * @param value The content to add. * @return This builder for chaining. */ public Builder addContent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureContentIsMutable(); content_.add(value); bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>repeated string content = 2;</code> * @param values The content to add. * @return This builder for chaining. */ public Builder addAllContent(java.lang.Iterable<java.lang.String> values) { ensureContentIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, content_); bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>repeated string content = 2;</code> * @return This builder for chaining. */ public Builder clearContent() { content_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); ; onChanged(); return this; } /** * <code>repeated string content = 2;</code> * @param value The bytes of the content to add. * @return This builder for chaining. */ public Builder addContentBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ensureContentIsMutable(); content_.add(value); bitField0_ |= 0x00000002; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:tool.ToolInvokeReply) } // @@protoc_insertion_point(class_scope:tool.ToolInvokeReply) private static final ai.wanaku.core.exchange.ToolInvokeReply DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.ToolInvokeReply(); } public static ai.wanaku.core.exchange.ToolInvokeReply getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ToolInvokeReply> PARSER = new com.google.protobuf.AbstractParser<ToolInvokeReply>() { @java.lang.Override public ToolInvokeReply parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<ToolInvokeReply> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ToolInvokeReply> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.ToolInvokeReply getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolInvokeReplyOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: toolrequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface ToolInvokeReplyOrBuilder extends // @@protoc_insertion_point(interface_extends:tool.ToolInvokeReply) com.google.protobuf.MessageOrBuilder { /** * <code>bool isError = 1;</code> * @return The isError. */ boolean getIsError(); /** * <code>repeated string content = 2;</code> * @return A list containing the content. */ java.util.List<java.lang.String> getContentList(); /** * <code>repeated string content = 2;</code> * @return The count of content. */ int getContentCount(); /** * <code>repeated string content = 2;</code> * @param index The index of the element to return. * @return The content at the given index. */ java.lang.String getContent(int index); /** * <code>repeated string content = 2;</code> * @param index The index of the value to return. * @return The bytes of the content at the given index. */ com.google.protobuf.ByteString getContentBytes(int index); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolInvokeRequest.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: toolrequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; /** * <pre> * The invocation request message * </pre> * * Protobuf type {@code tool.ToolInvokeRequest} */ public final class ToolInvokeRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tool.ToolInvokeRequest) ToolInvokeRequestOrBuilder { private static final long serialVersionUID = 0L; // Use ToolInvokeRequest.newBuilder() to construct. private ToolInvokeRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ToolInvokeRequest() { uri_ = ""; body_ = ""; configurationURI_ = ""; secretsURI_ = ""; } @java.lang.Override @SuppressWarnings({ "unused" }) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ToolInvokeRequest(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeRequest_descriptor; } @SuppressWarnings({ "rawtypes" }) @java.lang.Override protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) { switch(number) { case 3: return internalGetArguments(); case 6: return internalGetHeaders(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeRequest_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ToolInvokeRequest.class, ai.wanaku.core.exchange.ToolInvokeRequest.Builder.class); } public static final int URI_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object uri_ = ""; /** * <code>string uri = 1;</code> * @return The uri. */ @java.lang.Override public java.lang.String getUri() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); uri_ = s; return s; } } /** * <code>string uri = 1;</code> * @return The bytes for uri. */ @java.lang.Override public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); uri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int BODY_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object body_ = ""; /** * <code>string body = 2;</code> * @return The body. */ @java.lang.Override public java.lang.String getBody() { java.lang.Object ref = body_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); body_ = s; return s; } } /** * <code>string body = 2;</code> * @return The bytes for body. */ @java.lang.Override public com.google.protobuf.ByteString getBodyBytes() { java.lang.Object ref = body_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); body_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int ARGUMENTS_FIELD_NUMBER = 3; private static final class ArgumentsDefaultEntryHolder { static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeRequest_ArgumentsEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, ""); } @SuppressWarnings("serial") private com.google.protobuf.MapField<java.lang.String, java.lang.String> arguments_; private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetArguments() { if (arguments_ == null) { return com.google.protobuf.MapField.emptyMapField(ArgumentsDefaultEntryHolder.defaultEntry); } return arguments_; } public int getArgumentsCount() { return internalGetArguments().getMap().size(); } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ @java.lang.Override public boolean containsArguments(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetArguments().getMap().containsKey(key); } /** * Use {@link #getArgumentsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getArguments() { return getArgumentsMap(); } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.String> getArgumentsMap() { return internalGetArguments().getMap(); } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ @java.lang.Override public /* nullable */ java.lang.String getArgumentsOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetArguments().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ @java.lang.Override public java.lang.String getArgumentsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetArguments().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int CONFIGURATIONURI_FIELD_NUMBER = 4; @SuppressWarnings("serial") private volatile java.lang.Object configurationURI_ = ""; /** * <code>string configurationURI = 4;</code> * @return The configurationURI. */ @java.lang.Override public java.lang.String getConfigurationURI() { java.lang.Object ref = configurationURI_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); configurationURI_ = s; return s; } } /** * <code>string configurationURI = 4;</code> * @return The bytes for configurationURI. */ @java.lang.Override public com.google.protobuf.ByteString getConfigurationURIBytes() { java.lang.Object ref = configurationURI_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); configurationURI_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SECRETSURI_FIELD_NUMBER = 5; @SuppressWarnings("serial") private volatile java.lang.Object secretsURI_ = ""; /** * <code>string secretsURI = 5;</code> * @return The secretsURI. */ @java.lang.Override public java.lang.String getSecretsURI() { java.lang.Object ref = secretsURI_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); secretsURI_ = s; return s; } } /** * <code>string secretsURI = 5;</code> * @return The bytes for secretsURI. */ @java.lang.Override public com.google.protobuf.ByteString getSecretsURIBytes() { java.lang.Object ref = secretsURI_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); secretsURI_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int HEADERS_FIELD_NUMBER = 6; private static final class HeadersDefaultEntryHolder { static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeRequest_HeadersEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, ""); } @SuppressWarnings("serial") private com.google.protobuf.MapField<java.lang.String, java.lang.String> headers_; private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetHeaders() { if (headers_ == null) { return com.google.protobuf.MapField.emptyMapField(HeadersDefaultEntryHolder.defaultEntry); } return headers_; } public int getHeadersCount() { return internalGetHeaders().getMap().size(); } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ @java.lang.Override public boolean containsHeaders(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetHeaders().getMap().containsKey(key); } /** * Use {@link #getHeadersMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getHeaders() { return getHeadersMap(); } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.String> getHeadersMap() { return internalGetHeaders().getMap(); } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ @java.lang.Override public /* nullable */ java.lang.String getHeadersOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetHeaders().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ @java.lang.Override public java.lang.String getHeadersOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetHeaders().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(body_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, body_); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(output, internalGetArguments(), ArgumentsDefaultEntryHolder.defaultEntry, 3); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(configurationURI_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, configurationURI_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secretsURI_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, secretsURI_); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(output, internalGetHeaders(), HeadersDefaultEntryHolder.defaultEntry, 6); getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(body_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, body_); } for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : internalGetArguments().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> arguments__ = ArgumentsDefaultEntryHolder.defaultEntry.newBuilderForType().setKey(entry.getKey()).setValue(entry.getValue()).build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, arguments__); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(configurationURI_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, configurationURI_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secretsURI_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, secretsURI_); } for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : internalGetHeaders().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> headers__ = HeadersDefaultEntryHolder.defaultEntry.newBuilderForType().setKey(entry.getKey()).setValue(entry.getValue()).build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, headers__); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof ai.wanaku.core.exchange.ToolInvokeRequest)) { return super.equals(obj); } ai.wanaku.core.exchange.ToolInvokeRequest other = (ai.wanaku.core.exchange.ToolInvokeRequest) obj; if (!getUri().equals(other.getUri())) return false; if (!getBody().equals(other.getBody())) return false; if (!internalGetArguments().equals(other.internalGetArguments())) return false; if (!getConfigurationURI().equals(other.getConfigurationURI())) return false; if (!getSecretsURI().equals(other.getSecretsURI())) return false; if (!internalGetHeaders().equals(other.internalGetHeaders())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + URI_FIELD_NUMBER; hash = (53 * hash) + getUri().hashCode(); hash = (37 * hash) + BODY_FIELD_NUMBER; hash = (53 * hash) + getBody().hashCode(); if (!internalGetArguments().getMap().isEmpty()) { hash = (37 * hash) + ARGUMENTS_FIELD_NUMBER; hash = (53 * hash) + internalGetArguments().hashCode(); } hash = (37 * hash) + CONFIGURATIONURI_FIELD_NUMBER; hash = (53 * hash) + getConfigurationURI().hashCode(); hash = (37 * hash) + SECRETSURI_FIELD_NUMBER; hash = (53 * hash) + getSecretsURI().hashCode(); if (!internalGetHeaders().getMap().isEmpty()) { hash = (37 * hash) + HEADERS_FIELD_NUMBER; hash = (53 * hash) + internalGetHeaders().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static ai.wanaku.core.exchange.ToolInvokeRequest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(ai.wanaku.core.exchange.ToolInvokeRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * The invocation request message * </pre> * * Protobuf type {@code tool.ToolInvokeRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:tool.ToolInvokeRequest) ai.wanaku.core.exchange.ToolInvokeRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeRequest_descriptor; } @SuppressWarnings({ "rawtypes" }) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) { switch(number) { case 3: return internalGetArguments(); case 6: return internalGetHeaders(); default: throw new RuntimeException("Invalid map field number: " + number); } } @SuppressWarnings({ "rawtypes" }) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number) { switch(number) { case 3: return internalGetMutableArguments(); case 6: return internalGetMutableHeaders(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeRequest_fieldAccessorTable.ensureFieldAccessorsInitialized(ai.wanaku.core.exchange.ToolInvokeRequest.class, ai.wanaku.core.exchange.ToolInvokeRequest.Builder.class); } // Construct using ai.wanaku.core.exchange.ToolInvokeRequest.newBuilder() private Builder() { } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; uri_ = ""; body_ = ""; internalGetMutableArguments().clear(); configurationURI_ = ""; secretsURI_ = ""; internalGetMutableHeaders().clear(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return ai.wanaku.core.exchange.ToolExchange.internal_static_tool_ToolInvokeRequest_descriptor; } @java.lang.Override public ai.wanaku.core.exchange.ToolInvokeRequest getDefaultInstanceForType() { return ai.wanaku.core.exchange.ToolInvokeRequest.getDefaultInstance(); } @java.lang.Override public ai.wanaku.core.exchange.ToolInvokeRequest build() { ai.wanaku.core.exchange.ToolInvokeRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public ai.wanaku.core.exchange.ToolInvokeRequest buildPartial() { ai.wanaku.core.exchange.ToolInvokeRequest result = new ai.wanaku.core.exchange.ToolInvokeRequest(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(ai.wanaku.core.exchange.ToolInvokeRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.uri_ = uri_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.body_ = body_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.arguments_ = internalGetArguments(); result.arguments_.makeImmutable(); } if (((from_bitField0_ & 0x00000008) != 0)) { result.configurationURI_ = configurationURI_; } if (((from_bitField0_ & 0x00000010) != 0)) { result.secretsURI_ = secretsURI_; } if (((from_bitField0_ & 0x00000020) != 0)) { result.headers_ = internalGetHeaders(); result.headers_.makeImmutable(); } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof ai.wanaku.core.exchange.ToolInvokeRequest) { return mergeFrom((ai.wanaku.core.exchange.ToolInvokeRequest) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(ai.wanaku.core.exchange.ToolInvokeRequest other) { if (other == ai.wanaku.core.exchange.ToolInvokeRequest.getDefaultInstance()) return this; if (!other.getUri().isEmpty()) { uri_ = other.uri_; bitField0_ |= 0x00000001; onChanged(); } if (!other.getBody().isEmpty()) { body_ = other.body_; bitField0_ |= 0x00000002; onChanged(); } internalGetMutableArguments().mergeFrom(other.internalGetArguments()); bitField0_ |= 0x00000004; if (!other.getConfigurationURI().isEmpty()) { configurationURI_ = other.configurationURI_; bitField0_ |= 0x00000008; onChanged(); } if (!other.getSecretsURI().isEmpty()) { secretsURI_ = other.secretsURI_; bitField0_ |= 0x00000010; onChanged(); } internalGetMutableHeaders().mergeFrom(other.internalGetHeaders()); bitField0_ |= 0x00000020; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch(tag) { case 0: done = true; break; case 10: { uri_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { body_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 case 26: { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> arguments__ = input.readMessage(ArgumentsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableArguments().getMutableMap().put(arguments__.getKey(), arguments__.getValue()); bitField0_ |= 0x00000004; break; } // case 26 case 34: { configurationURI_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000008; break; } // case 34 case 42: { secretsURI_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000010; break; } // case 42 case 50: { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> headers__ = input.readMessage(HeadersDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableHeaders().getMutableMap().put(headers__.getKey(), headers__.getValue()); bitField0_ |= 0x00000020; break; } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { // was an endgroup tag done = true; } break; } } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object uri_ = ""; /** * <code>string uri = 1;</code> * @return The uri. */ public java.lang.String getUri() { java.lang.Object ref = uri_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); uri_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string uri = 1;</code> * @return The bytes for uri. */ public com.google.protobuf.ByteString getUriBytes() { java.lang.Object ref = uri_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); uri_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string uri = 1;</code> * @param value The uri to set. * @return This builder for chaining. */ public Builder setUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } uri_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * <code>string uri = 1;</code> * @return This builder for chaining. */ public Builder clearUri() { uri_ = getDefaultInstance().getUri(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * <code>string uri = 1;</code> * @param value The bytes for uri to set. * @return This builder for chaining. */ public Builder setUriBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); uri_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object body_ = ""; /** * <code>string body = 2;</code> * @return The body. */ public java.lang.String getBody() { java.lang.Object ref = body_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); body_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string body = 2;</code> * @return The bytes for body. */ public com.google.protobuf.ByteString getBodyBytes() { java.lang.Object ref = body_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); body_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string body = 2;</code> * @param value The body to set. * @return This builder for chaining. */ public Builder setBody(java.lang.String value) { if (value == null) { throw new NullPointerException(); } body_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * <code>string body = 2;</code> * @return This builder for chaining. */ public Builder clearBody() { body_ = getDefaultInstance().getBody(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * <code>string body = 2;</code> * @param value The bytes for body to set. * @return This builder for chaining. */ public Builder setBodyBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); body_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.protobuf.MapField<java.lang.String, java.lang.String> arguments_; private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetArguments() { if (arguments_ == null) { return com.google.protobuf.MapField.emptyMapField(ArgumentsDefaultEntryHolder.defaultEntry); } return arguments_; } private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableArguments() { if (arguments_ == null) { arguments_ = com.google.protobuf.MapField.newMapField(ArgumentsDefaultEntryHolder.defaultEntry); } if (!arguments_.isMutable()) { arguments_ = arguments_.copy(); } bitField0_ |= 0x00000004; onChanged(); return arguments_; } public int getArgumentsCount() { return internalGetArguments().getMap().size(); } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ @java.lang.Override public boolean containsArguments(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetArguments().getMap().containsKey(key); } /** * Use {@link #getArgumentsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getArguments() { return getArgumentsMap(); } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.String> getArgumentsMap() { return internalGetArguments().getMap(); } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ @java.lang.Override public /* nullable */ java.lang.String getArgumentsOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetArguments().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ @java.lang.Override public java.lang.String getArgumentsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetArguments().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearArguments() { bitField0_ = (bitField0_ & ~0x00000004); internalGetMutableArguments().getMutableMap().clear(); return this; } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ public Builder removeArguments(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableArguments().getMutableMap().remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getMutableArguments() { bitField0_ |= 0x00000004; return internalGetMutableArguments().getMutableMap(); } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ public Builder putArguments(java.lang.String key, java.lang.String value) { if (key == null) { throw new NullPointerException("map key"); } if (value == null) { throw new NullPointerException("map value"); } internalGetMutableArguments().getMutableMap().put(key, value); bitField0_ |= 0x00000004; return this; } /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ public Builder putAllArguments(java.util.Map<java.lang.String, java.lang.String> values) { internalGetMutableArguments().getMutableMap().putAll(values); bitField0_ |= 0x00000004; return this; } private java.lang.Object configurationURI_ = ""; /** * <code>string configurationURI = 4;</code> * @return The configurationURI. */ public java.lang.String getConfigurationURI() { java.lang.Object ref = configurationURI_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); configurationURI_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string configurationURI = 4;</code> * @return The bytes for configurationURI. */ public com.google.protobuf.ByteString getConfigurationURIBytes() { java.lang.Object ref = configurationURI_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); configurationURI_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string configurationURI = 4;</code> * @param value The configurationURI to set. * @return This builder for chaining. */ public Builder setConfigurationURI(java.lang.String value) { if (value == null) { throw new NullPointerException(); } configurationURI_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } /** * <code>string configurationURI = 4;</code> * @return This builder for chaining. */ public Builder clearConfigurationURI() { configurationURI_ = getDefaultInstance().getConfigurationURI(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } /** * <code>string configurationURI = 4;</code> * @param value The bytes for configurationURI to set. * @return This builder for chaining. */ public Builder setConfigurationURIBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); configurationURI_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } private java.lang.Object secretsURI_ = ""; /** * <code>string secretsURI = 5;</code> * @return The secretsURI. */ public java.lang.String getSecretsURI() { java.lang.Object ref = secretsURI_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); secretsURI_ = s; return s; } else { return (java.lang.String) ref; } } /** * <code>string secretsURI = 5;</code> * @return The bytes for secretsURI. */ public com.google.protobuf.ByteString getSecretsURIBytes() { java.lang.Object ref = secretsURI_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); secretsURI_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>string secretsURI = 5;</code> * @param value The secretsURI to set. * @return This builder for chaining. */ public Builder setSecretsURI(java.lang.String value) { if (value == null) { throw new NullPointerException(); } secretsURI_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } /** * <code>string secretsURI = 5;</code> * @return This builder for chaining. */ public Builder clearSecretsURI() { secretsURI_ = getDefaultInstance().getSecretsURI(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** * <code>string secretsURI = 5;</code> * @param value The bytes for secretsURI to set. * @return This builder for chaining. */ public Builder setSecretsURIBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); secretsURI_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } private com.google.protobuf.MapField<java.lang.String, java.lang.String> headers_; private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetHeaders() { if (headers_ == null) { return com.google.protobuf.MapField.emptyMapField(HeadersDefaultEntryHolder.defaultEntry); } return headers_; } private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableHeaders() { if (headers_ == null) { headers_ = com.google.protobuf.MapField.newMapField(HeadersDefaultEntryHolder.defaultEntry); } if (!headers_.isMutable()) { headers_ = headers_.copy(); } bitField0_ |= 0x00000020; onChanged(); return headers_; } public int getHeadersCount() { return internalGetHeaders().getMap().size(); } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ @java.lang.Override public boolean containsHeaders(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetHeaders().getMap().containsKey(key); } /** * Use {@link #getHeadersMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getHeaders() { return getHeadersMap(); } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ @java.lang.Override public java.util.Map<java.lang.String, java.lang.String> getHeadersMap() { return internalGetHeaders().getMap(); } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ @java.lang.Override public /* nullable */ java.lang.String getHeadersOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetHeaders().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ @java.lang.Override public java.lang.String getHeadersOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map<java.lang.String, java.lang.String> map = internalGetHeaders().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearHeaders() { bitField0_ = (bitField0_ & ~0x00000020); internalGetMutableHeaders().getMutableMap().clear(); return this; } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ public Builder removeHeaders(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableHeaders().getMutableMap().remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getMutableHeaders() { bitField0_ |= 0x00000020; return internalGetMutableHeaders().getMutableMap(); } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ public Builder putHeaders(java.lang.String key, java.lang.String value) { if (key == null) { throw new NullPointerException("map key"); } if (value == null) { throw new NullPointerException("map value"); } internalGetMutableHeaders().getMutableMap().put(key, value); bitField0_ |= 0x00000020; return this; } /** * <code>map&lt;string, string&gt; headers = 6;</code> */ public Builder putAllHeaders(java.util.Map<java.lang.String, java.lang.String> values) { internalGetMutableHeaders().getMutableMap().putAll(values); bitField0_ |= 0x00000020; return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:tool.ToolInvokeRequest) } // @@protoc_insertion_point(class_scope:tool.ToolInvokeRequest) private static final ai.wanaku.core.exchange.ToolInvokeRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new ai.wanaku.core.exchange.ToolInvokeRequest(); } public static ai.wanaku.core.exchange.ToolInvokeRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ToolInvokeRequest> PARSER = new com.google.protobuf.AbstractParser<ToolInvokeRequest>() { @java.lang.Override public ToolInvokeRequest parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<ToolInvokeRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ToolInvokeRequest> getParserForType() { return PARSER; } @java.lang.Override public ai.wanaku.core.exchange.ToolInvokeRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolInvokeRequestOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: toolrequest.proto // Protobuf Java Version: 3.25.5 package ai.wanaku.core.exchange; public interface ToolInvokeRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:tool.ToolInvokeRequest) com.google.protobuf.MessageOrBuilder { /** * <code>string uri = 1;</code> * @return The uri. */ java.lang.String getUri(); /** * <code>string uri = 1;</code> * @return The bytes for uri. */ com.google.protobuf.ByteString getUriBytes(); /** * <code>string body = 2;</code> * @return The body. */ java.lang.String getBody(); /** * <code>string body = 2;</code> * @return The bytes for body. */ com.google.protobuf.ByteString getBodyBytes(); /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ int getArgumentsCount(); /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ boolean containsArguments(java.lang.String key); /** * Use {@link #getArgumentsMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, java.lang.String> getArguments(); /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ java.util.Map<java.lang.String, java.lang.String> getArgumentsMap(); /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ /* nullable */ java.lang.String getArgumentsOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue); /** * <code>map&lt;string, string&gt; arguments = 3;</code> */ java.lang.String getArgumentsOrThrow(java.lang.String key); /** * <code>string configurationURI = 4;</code> * @return The configurationURI. */ java.lang.String getConfigurationURI(); /** * <code>string configurationURI = 4;</code> * @return The bytes for configurationURI. */ com.google.protobuf.ByteString getConfigurationURIBytes(); /** * <code>string secretsURI = 5;</code> * @return The secretsURI. */ java.lang.String getSecretsURI(); /** * <code>string secretsURI = 5;</code> * @return The bytes for secretsURI. */ com.google.protobuf.ByteString getSecretsURIBytes(); /** * <code>map&lt;string, string&gt; headers = 6;</code> */ int getHeadersCount(); /** * <code>map&lt;string, string&gt; headers = 6;</code> */ boolean containsHeaders(java.lang.String key); /** * Use {@link #getHeadersMap()} instead. */ @java.lang.Deprecated java.util.Map<java.lang.String, java.lang.String> getHeaders(); /** * <code>map&lt;string, string&gt; headers = 6;</code> */ java.util.Map<java.lang.String, java.lang.String> getHeadersMap(); /** * <code>map&lt;string, string&gt; headers = 6;</code> */ /* nullable */ java.lang.String getHeadersOrDefault(java.lang.String key, /* nullable */ java.lang.String defaultValue); /** * <code>map&lt;string, string&gt; headers = 6;</code> */ java.lang.String getHeadersOrThrow(java.lang.String key); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolInvoker.java
package ai.wanaku.core.exchange; import io.quarkus.grpc.MutinyService; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: toolrequest.proto") public interface ToolInvoker extends MutinyService { /** * <pre> * Invokes a tool * </pre> */ io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ToolInvokeReply> invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request); }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolInvokerBean.java
package ai.wanaku.core.exchange; import io.grpc.BindableService; import io.quarkus.grpc.GrpcService; import io.quarkus.grpc.MutinyBean; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: toolrequest.proto") public class ToolInvokerBean extends MutinyToolInvokerGrpc.ToolInvokerImplBase implements BindableService, MutinyBean { private final ToolInvoker delegate; ToolInvokerBean(@GrpcService ToolInvoker delegate) { this.delegate = delegate; } @Override public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ToolInvokeReply> invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request) { try { return delegate.invokeTool(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolInvokerClient.java
package ai.wanaku.core.exchange; import java.util.function.BiFunction; import io.quarkus.grpc.MutinyClient; @jakarta.annotation.Generated(value = "by Mutiny Grpc generator", comments = "Source: toolrequest.proto") public class ToolInvokerClient implements ToolInvoker, MutinyClient<MutinyToolInvokerGrpc.MutinyToolInvokerStub> { private final MutinyToolInvokerGrpc.MutinyToolInvokerStub stub; public ToolInvokerClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyToolInvokerGrpc.MutinyToolInvokerStub, MutinyToolInvokerGrpc.MutinyToolInvokerStub> stubConfigurator) { this.stub = stubConfigurator.apply(name, MutinyToolInvokerGrpc.newMutinyStub(channel)); } private ToolInvokerClient(MutinyToolInvokerGrpc.MutinyToolInvokerStub stub) { this.stub = stub; } public ToolInvokerClient newInstanceWithStub(MutinyToolInvokerGrpc.MutinyToolInvokerStub stub) { return new ToolInvokerClient(stub); } @Override public MutinyToolInvokerGrpc.MutinyToolInvokerStub getStub() { return stub; } @Override public io.smallrye.mutiny.Uni<ai.wanaku.core.exchange.ToolInvokeReply> invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request) { return stub.invokeTool(request); } }
0
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core
java-sources/ai/wanaku/core-exchange/0.0.7/ai/wanaku/core/exchange/ToolInvokerGrpc.java
package ai.wanaku.core.exchange; import static io.grpc.MethodDescriptor.generateFullMethodName; /** * <pre> * The tool exchange service definition. * </pre> */ @io.quarkus.Generated(value = "by gRPC proto compiler (version 1.69.1)", comments = "Source: toolrequest.proto") @io.grpc.stub.annotations.GrpcGenerated public final class ToolInvokerGrpc { private ToolInvokerGrpc() { } public static final java.lang.String SERVICE_NAME = "tool.ToolInvoker"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ToolInvokeRequest, ai.wanaku.core.exchange.ToolInvokeReply> getInvokeToolMethod; @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + "InvokeTool", requestType = ai.wanaku.core.exchange.ToolInvokeRequest.class, responseType = ai.wanaku.core.exchange.ToolInvokeReply.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ToolInvokeRequest, ai.wanaku.core.exchange.ToolInvokeReply> getInvokeToolMethod() { io.grpc.MethodDescriptor<ai.wanaku.core.exchange.ToolInvokeRequest, ai.wanaku.core.exchange.ToolInvokeReply> getInvokeToolMethod; if ((getInvokeToolMethod = ToolInvokerGrpc.getInvokeToolMethod) == null) { synchronized (ToolInvokerGrpc.class) { if ((getInvokeToolMethod = ToolInvokerGrpc.getInvokeToolMethod) == null) { ToolInvokerGrpc.getInvokeToolMethod = getInvokeToolMethod = io.grpc.MethodDescriptor.<ai.wanaku.core.exchange.ToolInvokeRequest, ai.wanaku.core.exchange.ToolInvokeReply>newBuilder().setType(io.grpc.MethodDescriptor.MethodType.UNARY).setFullMethodName(generateFullMethodName(SERVICE_NAME, "InvokeTool")).setSampledToLocalTracing(true).setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(ai.wanaku.core.exchange.ToolInvokeRequest.getDefaultInstance())).setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(ai.wanaku.core.exchange.ToolInvokeReply.getDefaultInstance())).setSchemaDescriptor(new ToolInvokerMethodDescriptorSupplier("InvokeTool")).build(); } } } return getInvokeToolMethod; } /** * Creates a new async stub that supports all call types for the service */ public static ToolInvokerStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ToolInvokerStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ToolInvokerStub>() { @java.lang.Override public ToolInvokerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ToolInvokerStub(channel, callOptions); } }; return ToolInvokerStub.newStub(factory, channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static ToolInvokerBlockingStub newBlockingStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ToolInvokerBlockingStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ToolInvokerBlockingStub>() { @java.lang.Override public ToolInvokerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ToolInvokerBlockingStub(channel, callOptions); } }; return ToolInvokerBlockingStub.newStub(factory, channel); } /** * Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static ToolInvokerFutureStub newFutureStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory<ToolInvokerFutureStub> factory = new io.grpc.stub.AbstractStub.StubFactory<ToolInvokerFutureStub>() { @java.lang.Override public ToolInvokerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ToolInvokerFutureStub(channel, callOptions); } }; return ToolInvokerFutureStub.newStub(factory, channel); } /** * <pre> * The tool exchange service definition. * </pre> */ public interface AsyncService { /** * <pre> * Invokes a tool * </pre> */ default void invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request, io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ToolInvokeReply> responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInvokeToolMethod(), responseObserver); } } /** * Base class for the server implementation of the service ToolInvoker. * <pre> * The tool exchange service definition. * </pre> */ public static abstract class ToolInvokerImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { return ToolInvokerGrpc.bindService(this); } } /** * A stub to allow clients to do asynchronous rpc calls to service ToolInvoker. * <pre> * The tool exchange service definition. * </pre> */ public static class ToolInvokerStub extends io.grpc.stub.AbstractAsyncStub<ToolInvokerStub> { private ToolInvokerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ToolInvokerStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ToolInvokerStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public void invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request, io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ToolInvokeReply> responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall(getChannel().newCall(getInvokeToolMethod(), getCallOptions()), request, responseObserver); } } /** * A stub to allow clients to do synchronous rpc calls to service ToolInvoker. * <pre> * The tool exchange service definition. * </pre> */ public static class ToolInvokerBlockingStub extends io.grpc.stub.AbstractBlockingStub<ToolInvokerBlockingStub> { private ToolInvokerBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ToolInvokerBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ToolInvokerBlockingStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public ai.wanaku.core.exchange.ToolInvokeReply invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall(getChannel(), getInvokeToolMethod(), getCallOptions(), request); } } /** * A stub to allow clients to do ListenableFuture-style rpc calls to service ToolInvoker. * <pre> * The tool exchange service definition. * </pre> */ public static class ToolInvokerFutureStub extends io.grpc.stub.AbstractFutureStub<ToolInvokerFutureStub> { private ToolInvokerFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected ToolInvokerFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new ToolInvokerFutureStub(channel, callOptions); } /** * <pre> * Invokes a tool * </pre> */ public com.google.common.util.concurrent.ListenableFuture<ai.wanaku.core.exchange.ToolInvokeReply> invokeTool(ai.wanaku.core.exchange.ToolInvokeRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall(getChannel().newCall(getInvokeToolMethod(), getCallOptions()), request); } } private static final int METHODID_INVOKE_TOOL = 0; private static final class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final AsyncService serviceImpl; private final int methodId; MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { case METHODID_INVOKE_TOOL: serviceImpl.invokeTool((ai.wanaku.core.exchange.ToolInvokeRequest) request, (io.grpc.stub.StreamObserver<ai.wanaku.core.exchange.ToolInvokeReply>) responseObserver); break; default: throw new AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { switch(methodId) { default: throw new AssertionError(); } } } public static io.grpc.ServerServiceDefinition bindService(AsyncService service) { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()).addMethod(getInvokeToolMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall(new MethodHandlers<ai.wanaku.core.exchange.ToolInvokeRequest, ai.wanaku.core.exchange.ToolInvokeReply>(service, METHODID_INVOKE_TOOL))).build(); } private static abstract class ToolInvokerBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { ToolInvokerBaseDescriptorSupplier() { } @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return ai.wanaku.core.exchange.ToolExchange.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("ToolInvoker"); } } private static final class ToolInvokerFileDescriptorSupplier extends ToolInvokerBaseDescriptorSupplier { ToolInvokerFileDescriptorSupplier() { } } private static final class ToolInvokerMethodDescriptorSupplier extends ToolInvokerBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final java.lang.String methodName; ToolInvokerMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } @java.lang.Override public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { return getServiceDescriptor().findMethodByName(methodName); } } private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (ToolInvokerGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME).setSchemaDescriptor(new ToolInvokerFileDescriptorSupplier()).addMethod(getInvokeToolMethod()).build(); } } } return result; } }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/Tool.java
package ai.wanaku.core.mcp.common; import ai.wanaku.api.types.CallableReference; import io.quarkiverse.mcp.server.ToolManager; import io.quarkiverse.mcp.server.ToolResponse; /** * Represents a tool that can be called and executed. */ public interface Tool { /** * Call a tool * @param toolReference the tool reference * @param toolArguments the arguments to the tool * @return The tool response instance containing details about its execution */ ToolResponse call(ToolManager.ToolArguments toolArguments, CallableReference toolReference); }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers/ForwardResolver.java
package ai.wanaku.core.mcp.common.resolvers; import ai.wanaku.api.exceptions.ServiceUnavailableException; import ai.wanaku.api.exceptions.ToolNotFoundException; import ai.wanaku.api.types.CallableReference; import ai.wanaku.api.types.RemoteToolReference; import ai.wanaku.api.types.ResourceReference; import ai.wanaku.core.mcp.common.Tool; import java.util.List; /** * A resolver that is used to resolve the tools, taking into account the available MCP forwards * registered in the router. */ public interface ForwardResolver extends ResourceResolver { /** * Given a reference, resolves what tool would call it * @param toolReference the reference to the tool * @return An instance of the requested tool * @throws ToolNotFoundException if the tools cannot be found */ Tool resolve(CallableReference toolReference) throws ToolNotFoundException; /** * Lists all available resources that can be resolved by this {@code ForwardResolver}. * * @return A list of {@link ResourceReference} objects representing the available resources. * @throws ServiceUnavailableException if the service responsible for listing resources is unavailable. */ List<ResourceReference> listResources() throws ServiceUnavailableException; /** * Lists all available remote tools that can be resolved by this {@code ForwardResolver}. * * @return A list of {@link RemoteToolReference} objects representing the available remote tools. * @throws ServiceUnavailableException if the service responsible for listing tools is unavailable. */ List<RemoteToolReference> listTools() throws ServiceUnavailableException; }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers/Resolver.java
package ai.wanaku.core.mcp.common.resolvers; /** * A resolver that consumes MCP requests and resolves what type of tool or resource acquirer * should handle it */ public interface Resolver { }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers/ResourceResolver.java
package ai.wanaku.core.mcp.common.resolvers; import ai.wanaku.api.exceptions.ServiceNotFoundException; import ai.wanaku.api.types.io.ResourcePayload; import java.util.List; import io.quarkiverse.mcp.server.ResourceContents; import ai.wanaku.api.types.ResourceReference; import io.quarkiverse.mcp.server.ResourceManager; /** * A resolver that consumes MCP requests and resolves what type of resource acquirer * should handle it */ public interface ResourceResolver extends Resolver { /** * Given a reference, load properties (arguments) defined on the remote service capable of handling it * @param resourcePayload the resource payload * @throws ServiceNotFoundException if a service capable of handling such a resource cannot be found */ void provision(ResourcePayload resourcePayload) throws ServiceNotFoundException; /** * Read resources * @param arguments the resource request arguments * @param mcpResource the resource to read * @return the resource contents in a format specific to the content that had been read */ List<ResourceContents> read(ResourceManager.ResourceArguments arguments, ResourceReference mcpResource); }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers/ToolsResolver.java
package ai.wanaku.core.mcp.common.resolvers; import ai.wanaku.api.exceptions.ServiceNotFoundException; import ai.wanaku.api.exceptions.ToolNotFoundException; import ai.wanaku.api.types.ToolReference; import ai.wanaku.api.types.io.ToolPayload; import ai.wanaku.core.mcp.common.Tool; /** * A resolver that consumes MCP requests and resolves what type of tool * should handle it */ public interface ToolsResolver extends Resolver { /** * Given a reference, load properties (arguments) defined on the remote service capable of handling it * @param toolPayload the tool payload * @throws ServiceNotFoundException if a service capable of handling such a tool cannot be found */ void provision(ToolPayload toolPayload) throws ServiceNotFoundException; /** * Given a reference, resolves what tool would call it * @param toolReference the reference to the tool * @return An instance of the requested tool * @throws ToolNotFoundException if the tools cannot be found */ Tool resolve(ToolReference toolReference) throws ToolNotFoundException; }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers/util/NoopForwardRegistry.java
package ai.wanaku.core.mcp.common.resolvers.util; import ai.wanaku.api.types.ForwardReference; import ai.wanaku.api.types.NameNamespacePair; import ai.wanaku.core.mcp.common.resolvers.ForwardResolver; import ai.wanaku.core.mcp.providers.ForwardRegistry; import java.util.Set; public class NoopForwardRegistry implements ForwardRegistry { @Override public ForwardResolver newResolverForService(NameNamespacePair service, ForwardReference forwardReference) { return new NoopForwardResolver(); } @Override public ForwardResolver getResolver(NameNamespacePair service) { return new NoopForwardResolver(); } @Override public void link(NameNamespacePair service, ForwardResolver resolver) { } @Override public void unlink(NameNamespacePair service) { } @Override public Set<NameNamespacePair> services() { return Set.of(); } }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers/util/NoopForwardResolver.java
package ai.wanaku.core.mcp.common.resolvers.util; import ai.wanaku.api.exceptions.ServiceNotFoundException; import ai.wanaku.api.exceptions.ToolNotFoundException; import ai.wanaku.api.types.CallableReference; import ai.wanaku.api.types.RemoteToolReference; import ai.wanaku.api.types.ResourceReference; import ai.wanaku.api.types.io.ResourcePayload; import ai.wanaku.core.mcp.common.Tool; import ai.wanaku.core.mcp.common.resolvers.ForwardResolver; import io.quarkiverse.mcp.server.ResourceContents; import io.quarkiverse.mcp.server.ResourceManager; import java.util.List; public class NoopForwardResolver implements ForwardResolver { @Override public Tool resolve(CallableReference toolReference) throws ToolNotFoundException { return null; } @Override public List<ResourceReference> listResources() { return List.of(); } @Override public List<RemoteToolReference> listTools() { return List.of(); } @Override public void provision(ResourcePayload resourcePayload) throws ServiceNotFoundException { } @Override public List<ResourceContents> read(ResourceManager.ResourceArguments arguments, ResourceReference mcpResource) { return List.of(); } }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers/util/NoopResourceResolver.java
package ai.wanaku.core.mcp.common.resolvers.util; import ai.wanaku.api.exceptions.ServiceNotFoundException; import ai.wanaku.api.types.io.ResourcePayload; import java.util.List; import ai.wanaku.api.types.ResourceReference; import ai.wanaku.core.mcp.common.resolvers.ResourceResolver; import io.quarkiverse.mcp.server.ResourceContents; import io.quarkiverse.mcp.server.ResourceManager; /** * A resolver that does not to anything (mostly used for testing) */ public class NoopResourceResolver implements ResourceResolver { @Override public void provision(ResourcePayload resourcePayload) throws ServiceNotFoundException { } @Override public List<ResourceContents> read(ResourceManager.ResourceArguments arguments, ResourceReference mcpResource) { return List.of(); } }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/common/resolvers/util/NoopToolsResolver.java
package ai.wanaku.core.mcp.common.resolvers.util; import ai.wanaku.api.exceptions.ServiceNotFoundException; import ai.wanaku.api.exceptions.ToolNotFoundException; import ai.wanaku.api.types.CallableReference; import ai.wanaku.api.types.ToolReference; import ai.wanaku.api.types.io.ToolPayload; import ai.wanaku.core.mcp.common.Tool; import ai.wanaku.core.mcp.common.resolvers.ToolsResolver; import io.quarkiverse.mcp.server.ToolManager; import io.quarkiverse.mcp.server.ToolResponse; /** * A resolver that does not to anything (mostly used for testing) */ public class NoopToolsResolver implements ToolsResolver { @Override public void provision(ToolPayload toolPayload) throws ServiceNotFoundException { } @Override public Tool resolve(ToolReference toolReference) throws ToolNotFoundException { return new Tool() { @Override public ToolResponse call(ToolManager.ToolArguments toolArguments, CallableReference toolReference) { return null; } }; } }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/providers/ForwardRegistry.java
package ai.wanaku.core.mcp.providers; import ai.wanaku.api.types.ForwardReference; import ai.wanaku.api.types.NameNamespacePair; import ai.wanaku.core.mcp.common.resolvers.ForwardResolver; import java.util.Set; /** * A registry for managing forwarded services and their resolvers. * <p> * This interface provides methods to create and retrieve forward resolvers, * link/unlink services with specific resolvers, and access a list of all registered services. */ public interface ForwardRegistry { /** * Creates a new forward resolver instance for the specified namespacePair reference. * * This method creates a new resolver instance associated with the given namespacePair reference, * which can then be used to resolve forwarded requests. The newly created resolver is not yet * linked to any namespacePair; use {@link #link(NameNamespacePair, ForwardResolver)} to establish this connection. * * @param namespacePair the namespacePair reference for which a new resolver is being created * @param forwardReference The forward reference associated with this resolver. * @return a newly created forward resolver instance associated with the given namespacePair reference */ ForwardResolver newResolverForService(NameNamespacePair namespacePair, ForwardReference forwardReference); /** * Retrieves an existing forward resolver for the specified service reference. * * If no existing resolver is found for the given service, this method returns null. * * @param service the service reference for which a resolver instance is being retrieved * @return an existing forward resolver instance associated with the given service reference, or null if not present */ ForwardResolver getResolver(NameNamespacePair service); /** * Links a service reference with its corresponding forward resolver. * * Establishes an association between the specified service reference and the provided resolver, * allowing future forwarded requests for the service to be resolved using this resolver. * * @param service the service reference to link with a resolver * @param resolver the resolver instance to associate with the given service reference */ void link(NameNamespacePair service, ForwardResolver resolver); /** * Unlinks a service reference from its associated forward resolver. * * Releases the association between the specified service reference and its linked resolver, * which may lead to resolution failures for future forwarded requests targeting the unlinked service. * * @param service the service reference to unlink from its resolver */ void unlink(NameNamespacePair service); /** * Retrieves a collection of all registered services in this registry. * * Provides programmatic access to the list of services for which forward resolvers have been created or retrieved. * This allows for iterative exploration of the registry's contents, useful in certain scenarios where explicit * lookups or enumerations are not possible or efficient. * * @return a set of all registered ForwardReference instances managed by this registry */ Set<NameNamespacePair> services(); }
0
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp
java-sources/ai/wanaku/core-mcp/0.0.7/ai/wanaku/core/mcp/providers/ServiceRegistry.java
package ai.wanaku.core.mcp.providers; import ai.wanaku.api.types.discovery.ActivityRecord; import ai.wanaku.api.types.discovery.ServiceState; import ai.wanaku.api.types.providers.ServiceTarget; import ai.wanaku.api.types.providers.ServiceType; import java.util.List; /** * Defines a registry of downstream services */ public interface ServiceRegistry { /** * Register a service target in the registry * @param serviceTarget the service target * @return the updated service target with its newly created ID if not previously provided */ ServiceTarget register(ServiceTarget serviceTarget); /** * De-register a service from the registry * @param serviceTarget the service target */ void deregister(ServiceTarget serviceTarget); /** * Gets a registered service by name * * @param service the name of the service * @param serviceType the service type * @return the service instance or null if not found */ ServiceTarget getServiceByName(String service, ServiceType serviceType); /** * Gets the state of the given service * * @param id the service ID * @return the last count states of the given service */ ActivityRecord getStates(String id); /** * Get all registered services and their configurations * * @param serviceType the type of service to get * @return a set of all registered services and their configurations */ List<ServiceTarget> getEntries(ServiceType serviceType); /** * Update a registered service target in the registry * @param serviceTarget the service target */ void update(ServiceTarget serviceTarget); /** * Update a registered service target in the registry * @param id the service ID * @param state the state to record */ void updateLastState(String id, ServiceState state); /** * Register a ping from a service * @param id the service ID */ void ping(String id); }
0
java-sources/ai/wanaku/core-mcp-client/0.0.7/ai/wanaku/core/mcp
java-sources/ai/wanaku/core-mcp-client/0.0.7/ai/wanaku/core/mcp/client/ClientUtil.java
package ai.wanaku.core.mcp.client; import dev.langchain4j.mcp.client.DefaultMcpClient; import dev.langchain4j.mcp.client.McpClient; import dev.langchain4j.mcp.client.transport.McpTransport; import dev.langchain4j.mcp.client.transport.http.HttpMcpTransport; public class ClientUtil { public static McpClient createClient(String address) { McpTransport transport = new HttpMcpTransport.Builder() .sseUrl(address) .logRequests(true) .logResponses(true) .build(); return new DefaultMcpClient.Builder() .transport(transport) .build(); } }