Class ConnectionsClient
java.lang.Object
com.google.adk.tools.applicationintegrationtoolset.ConnectionsClient
这是一个用于与 Google Cloud Connectors API 进行交互的实用工具类。
这个类提供了用于获取连接详细信息、实体及其相关操作的规范(即数据结构),以及生成 OpenAPI 规范的方法。这些 OpenAPI 规范可用于基于这些连接信息来开发相应的工具。
-
嵌套类概述
Nested ClassesModifier and TypeClassDescriptionstatic class表示某个操作的架构(即该操作的数据结构或格式)。static class表示连接的详细信息。static class表示某个实体的数据结构(即模式)以及该实体支持的操作类型。 -
构造函数概述
ConstructorsConstructorDescriptionConnectionsClient(String project, String location, String connection, String serviceAccountJson, HttpClient httpClient, CredentialsHelper credentialsHelper, com.fasterxml.jackson.databind.ObjectMapper objectMapper) 初始化 ConnectionsClient 对象。ConnectionsClient(String project, String location, String connection, HttpClient httpClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
方法概述
Modifier and TypeMethodDescriptionactionRequest(String action) actionResponse(String action) connectorPayload(Map<String, Object> jsonSchema) convertJsonSchemaToOpenApiSchema(Map<String, Object> jsonSchema) 将一个 JSON Schema 字典转换为 OpenAPI Schema 字典。createOperation(String entity, String toolName, String toolInstructions) createOperationRequest(String entity) deleteOperation(String entity, String toolName, String toolInstructions) getActionOperation(String action, String operation, String actionDisplayName, String toolName, String toolInstructions) getActionSchema(String action) 获取给定操作的输入和输出 JSON 架构(即 JSON 数据的结构)。检索指定连接的服务详细信息。getEntitySchemaAndOperations(String entity) 获取指定实体的 JSON 架构以及可用的操作(即对该实体可以执行的操作)。getOperation(String entity, String schemaAsString, String toolName, String toolInstructions) listOperation(String entity, String schemaAsString, String toolName, String toolInstructions) updateOperation(String entity, String toolName, String toolInstructions) updateOperationRequest(String entity)
-
构造函数详细信息
-
ConnectionsClient
public ConnectionsClient(String project, String location, String connection, String serviceAccountJson, HttpClient httpClient, CredentialsHelper credentialsHelper, com.fasterxml.jackson.databind.ObjectMapper objectMapper) 初始化 ConnectionsClient 对象。- Parameters:
project- The Google Cloud project ID.location- The Google Cloud location (e.g., us-central1).connection- The connection name.
-
ConnectionsClient
public ConnectionsClient(String project, String location, String connection, HttpClient httpClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
方法详细信息(Method Details)
-
getConnectionDetails
public ConnectionsClient.ConnectionDetails getConnectionDetails() throws IOException, InterruptedException检索指定连接的服务详细信息。- Returns:
- A
ConnectionsClient.ConnectionDetailsobject with the connection's info. - Throws:
IOException- If there is an issue with network communication or credentials.InterruptedException- If the thread is interrupted during the API call.
-
getEntitySchemaAndOperations
public ConnectionsClient.EntitySchemaAndOperations getEntitySchemaAndOperations(String entity) throws IOException, InterruptedException 获取指定实体的 JSON 架构以及可用的操作(即对该实体可以执行的操作)。- Parameters:
entity- The entity name.- Returns:
- A
ConnectionsClient.EntitySchemaAndOperationsobject. - Throws:
IOException- If there is an issue with network communication or credentials.InterruptedException- If the thread is interrupted during polling.
-
getActionSchema
public ConnectionsClient.ActionSchema getActionSchema(String action) throws IOException, InterruptedException 获取给定操作的输入和输出 JSON 架构(即 JSON 数据的结构)。- Parameters:
action- The action name.- Returns:
- An
ConnectionsClient.ActionSchemaobject. - Throws:
IOException- If there is an issue with network communication or credentials.InterruptedException- If the thread is interrupted during polling.
-
convertJsonSchemaToOpenApiSchema
-
connectorPayload
-
getConnectorBaseSpec
-
getActionOperation
-
listOperation
-
getOperation
-
createOperation
-
updateOperation
-
deleteOperation
-
createOperationRequest
-
updateOperationRequest
-
getOperationRequest
-
deleteOperationRequest
-
listOperationRequest
-
actionRequest
-
actionResponse
-
executeCustomQueryRequest
-