Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
- * Agent response = agentsClient.getAgent(parent);
- * }
- *
- *
- * @param parent Required. The project that the agent to fetch is associated with. Format:
- * `projects/<Project ID>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Agent getAgent(ProjectName parent) {
- GetAgentRequest request =
- GetAgentRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
- return getAgent(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Retrieves the specified agent.
- *
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
- * Agent response = agentsClient.getAgent(parent.toString());
- * }
- *
- *
- * @param parent Required. The project that the agent to fetch is associated with. Format:
- * `projects/<Project ID>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Agent getAgent(String parent) {
- GetAgentRequest request = GetAgentRequest.newBuilder().setParent(parent).build();
- return getAgent(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Retrieves the specified agent.
- *
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
- * GetAgentRequest request = GetAgentRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * Agent response = agentsClient.getAgent(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Agent getAgent(GetAgentRequest request) {
- return getAgentCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Retrieves the specified agent.
- *
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
- * GetAgentRequest request = GetAgentRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<Agent> future = agentsClient.getAgentCallable().futureCall(request);
- * // Do something
- * Agent response = future.get();
- * }
- *
- */
- public final UnaryCallable
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
+ * String agentUri = "";
* ExportAgentRequest request = ExportAgentRequest.newBuilder()
* .setParent(parent.toString())
+ * .setAgentUri(agentUri)
* .build();
* ExportAgentResponse response = agentsClient.exportAgentAsync(request).get();
* }
@@ -825,8 +737,10 @@ public final OperationFuture exportAgentAsync(
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
+ * String agentUri = "";
* ExportAgentRequest request = ExportAgentRequest.newBuilder()
* .setParent(parent.toString())
+ * .setAgentUri(agentUri)
* .build();
* OperationFuture<ExportAgentResponse, Struct> future = agentsClient.exportAgentOperationCallable().futureCall(request);
* // Do something
@@ -852,8 +766,10 @@ public final OperationFuture exportAgentAsync(
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
+ * String agentUri = "";
* ExportAgentRequest request = ExportAgentRequest.newBuilder()
* .setParent(parent.toString())
+ * .setAgentUri(agentUri)
* .build();
* ApiFuture<Operation> future = agentsClient.exportAgentCallable().futureCall(request);
* // Do something
@@ -867,10 +783,10 @@ public final UnaryCallable exportAgentCallable()
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Imports the specified agent from a ZIP file.
+ * Restores the specified agent from a ZIP file.
*
- * Uploads new intents and entity types without deleting the existing ones. Intents and entity
- * types with the same name are replaced with the new versions from ImportAgentRequest.
+ *
Replaces the current agent version with a new one. All the intents and entity types in the
+ * older version are deleted.
*
*
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
*
@@ -879,10 +795,10 @@ public final UnaryCallable exportAgentCallable()
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
- * ImportAgentRequest request = ImportAgentRequest.newBuilder()
+ * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * agentsClient.importAgentAsync(request).get();
+ * agentsClient.restoreAgentAsync(request).get();
* }
*
*
@@ -891,16 +807,16 @@ public final UnaryCallable exportAgentCallable()
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture importAgentAsync(ImportAgentRequest request) {
- return importAgentOperationCallable().futureCall(request);
+ public final OperationFuture restoreAgentAsync(RestoreAgentRequest request) {
+ return restoreAgentOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Imports the specified agent from a ZIP file.
+ * Restores the specified agent from a ZIP file.
*
- * Uploads new intents and entity types without deleting the existing ones. Intents and entity
- * types with the same name are replaced with the new versions from ImportAgentRequest.
+ *
Replaces the current agent version with a new one. All the intents and entity types in the
+ * older version are deleted.
*
*
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
*
@@ -909,26 +825,27 @@ public final OperationFuture importAgentAsync(ImportAgentRequest
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
- * ImportAgentRequest request = ImportAgentRequest.newBuilder()
+ * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * OperationFuture<Empty, Struct> future = agentsClient.importAgentOperationCallable().futureCall(request);
+ * OperationFuture<Empty, Struct> future = agentsClient.restoreAgentOperationCallable().futureCall(request);
* // Do something
* future.get();
* }
*
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable importAgentOperationCallable() {
- return stub.importAgentOperationCallable();
+ public final OperationCallable
+ restoreAgentOperationCallable() {
+ return stub.restoreAgentOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Imports the specified agent from a ZIP file.
+ * Restores the specified agent from a ZIP file.
*
- * Uploads new intents and entity types without deleting the existing ones. Intents and entity
- * types with the same name are replaced with the new versions from ImportAgentRequest.
+ *
Replaces the current agent version with a new one. All the intents and entity types in the
+ * older version are deleted.
*
*
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
*
@@ -937,25 +854,115 @@ public final OperationCallable importAgentOpe
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
- * ImportAgentRequest request = ImportAgentRequest.newBuilder()
+ * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * ApiFuture<Operation> future = agentsClient.importAgentCallable().futureCall(request);
+ * ApiFuture<Operation> future = agentsClient.restoreAgentCallable().futureCall(request);
* // Do something
* future.get();
* }
*
*/
- public final UnaryCallable importAgentCallable() {
- return stub.importAgentCallable();
+ public final UnaryCallable restoreAgentCallable() {
+ return stub.restoreAgentCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Restores the specified agent from a ZIP file.
+ * Retrieves the specified agent.
*
- * Replaces the current agent version with a new one. All the intents and entity types in the
- * older version are deleted.
+ *
Sample code:
+ *
+ *
+ * try (AgentsClient agentsClient = AgentsClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * Agent response = agentsClient.getAgent(parent);
+ * }
+ *
+ *
+ * @param parent Required. The project that the agent to fetch is associated with. Format:
+ * `projects/<Project ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Agent getAgent(ProjectName parent) {
+ GetAgentRequest request =
+ GetAgentRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return getAgent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves the specified agent.
+ *
+ * Sample code:
+ *
+ *
+ * try (AgentsClient agentsClient = AgentsClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * Agent response = agentsClient.getAgent(parent.toString());
+ * }
+ *
+ *
+ * @param parent Required. The project that the agent to fetch is associated with. Format:
+ * `projects/<Project ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Agent getAgent(String parent) {
+ GetAgentRequest request = GetAgentRequest.newBuilder().setParent(parent).build();
+ return getAgent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves the specified agent.
+ *
+ * Sample code:
+ *
+ *
+ * try (AgentsClient agentsClient = AgentsClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * GetAgentRequest request = GetAgentRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * Agent response = agentsClient.getAgent(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Agent getAgent(GetAgentRequest request) {
+ return getAgentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves the specified agent.
+ *
+ * Sample code:
+ *
+ *
+ * try (AgentsClient agentsClient = AgentsClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * GetAgentRequest request = GetAgentRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<Agent> future = agentsClient.getAgentCallable().futureCall(request);
+ * // Do something
+ * Agent response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallable getAgentCallable() {
+ return stub.getAgentCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Imports the specified agent from a ZIP file.
+ *
+ * Uploads new intents and entity types without deleting the existing ones. Intents and entity
+ * types with the same name are replaced with the new versions from ImportAgentRequest.
*
*
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
*
@@ -964,10 +971,10 @@ public final UnaryCallable importAgentCallable()
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
- * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
+ * ImportAgentRequest request = ImportAgentRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * agentsClient.restoreAgentAsync(request).get();
+ * agentsClient.importAgentAsync(request).get();
* }
*
*
@@ -976,16 +983,16 @@ public final UnaryCallable importAgentCallable()
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture restoreAgentAsync(RestoreAgentRequest request) {
- return restoreAgentOperationCallable().futureCall(request);
+ public final OperationFuture importAgentAsync(ImportAgentRequest request) {
+ return importAgentOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Restores the specified agent from a ZIP file.
+ * Imports the specified agent from a ZIP file.
*
- * Replaces the current agent version with a new one. All the intents and entity types in the
- * older version are deleted.
+ *
Uploads new intents and entity types without deleting the existing ones. Intents and entity
+ * types with the same name are replaced with the new versions from ImportAgentRequest.
*
*
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
*
@@ -994,27 +1001,26 @@ public final OperationFuture restoreAgentAsync(RestoreAgentReques
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
- * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
+ * ImportAgentRequest request = ImportAgentRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * OperationFuture<Empty, Struct> future = agentsClient.restoreAgentOperationCallable().futureCall(request);
+ * OperationFuture<Empty, Struct> future = agentsClient.importAgentOperationCallable().futureCall(request);
* // Do something
* future.get();
* }
*
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- restoreAgentOperationCallable() {
- return stub.restoreAgentOperationCallable();
+ public final OperationCallable importAgentOperationCallable() {
+ return stub.importAgentOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Restores the specified agent from a ZIP file.
+ * Imports the specified agent from a ZIP file.
*
- * Replaces the current agent version with a new one. All the intents and entity types in the
- * older version are deleted.
+ *
Uploads new intents and entity types without deleting the existing ones. Intents and entity
+ * types with the same name are replaced with the new versions from ImportAgentRequest.
*
*
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
*
@@ -1023,17 +1029,17 @@ public final OperationFuture restoreAgentAsync(RestoreAgentReques
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
- * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
+ * ImportAgentRequest request = ImportAgentRequest.newBuilder()
* .setParent(parent.toString())
* .build();
- * ApiFuture<Operation> future = agentsClient.restoreAgentCallable().futureCall(request);
+ * ApiFuture<Operation> future = agentsClient.importAgentCallable().futureCall(request);
* // Do something
* future.get();
* }
*
*/
- public final UnaryCallable restoreAgentCallable() {
- return stub.restoreAgentCallable();
+ public final UnaryCallable importAgentCallable() {
+ return stub.importAgentCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -1045,7 +1051,10 @@ public final UnaryCallable restoreAgentCallable(
*
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
- * GetValidationResultRequest request = GetValidationResultRequest.newBuilder().build();
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * GetValidationResultRequest request = GetValidationResultRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* ValidationResult response = agentsClient.getValidationResult(request);
* }
*
@@ -1066,7 +1075,10 @@ public final ValidationResult getValidationResult(GetValidationResultRequest req
*
*
* try (AgentsClient agentsClient = AgentsClient.create()) {
- * GetValidationResultRequest request = GetValidationResultRequest.newBuilder().build();
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * GetValidationResultRequest request = GetValidationResultRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
* ApiFuture<ValidationResult> future = agentsClient.getValidationResultCallable().futureCall(request);
* // Do something
* ValidationResult response = future.get();
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/AgentsSettings.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/AgentsSettings.java
index 51b7f88b2..4cf5d0834 100644
--- a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/AgentsSettings.java
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/AgentsSettings.java
@@ -81,11 +81,6 @@ public UnaryCallSettings deleteAgentSettings() {
return ((AgentsStubSettings) getStubSettings()).deleteAgentSettings();
}
- /** Returns the object with the settings used for calls to getAgent. */
- public UnaryCallSettings getAgentSettings() {
- return ((AgentsStubSettings) getStubSettings()).getAgentSettings();
- }
-
/** Returns the object with the settings used for calls to searchAgents. */
public PagedCallSettings
searchAgentsSettings() {
@@ -117,18 +112,6 @@ public UnaryCallSettings exportAgentSettings() {
return ((AgentsStubSettings) getStubSettings()).exportAgentOperationSettings();
}
- /** Returns the object with the settings used for calls to importAgent. */
- public UnaryCallSettings importAgentSettings() {
- return ((AgentsStubSettings) getStubSettings()).importAgentSettings();
- }
-
- /** Returns the object with the settings used for calls to importAgent. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings importAgentOperationSettings() {
- return ((AgentsStubSettings) getStubSettings()).importAgentOperationSettings();
- }
-
/** Returns the object with the settings used for calls to restoreAgent. */
public UnaryCallSettings restoreAgentSettings() {
return ((AgentsStubSettings) getStubSettings()).restoreAgentSettings();
@@ -141,6 +124,23 @@ public OperationCallSettings restoreAgentOpe
return ((AgentsStubSettings) getStubSettings()).restoreAgentOperationSettings();
}
+ /** Returns the object with the settings used for calls to getAgent. */
+ public UnaryCallSettings getAgentSettings() {
+ return ((AgentsStubSettings) getStubSettings()).getAgentSettings();
+ }
+
+ /** Returns the object with the settings used for calls to importAgent. */
+ public UnaryCallSettings importAgentSettings() {
+ return ((AgentsStubSettings) getStubSettings()).importAgentSettings();
+ }
+
+ /** Returns the object with the settings used for calls to importAgent. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings importAgentOperationSettings() {
+ return ((AgentsStubSettings) getStubSettings()).importAgentOperationSettings();
+ }
+
/** Returns the object with the settings used for calls to getValidationResult. */
public UnaryCallSettings
getValidationResultSettings() {
@@ -253,11 +253,6 @@ public UnaryCallSettings.Builder deleteAgentSettings(
return getStubSettingsBuilder().deleteAgentSettings();
}
- /** Returns the builder for the settings used for calls to getAgent. */
- public UnaryCallSettings.Builder getAgentSettings() {
- return getStubSettingsBuilder().getAgentSettings();
- }
-
/** Returns the builder for the settings used for calls to searchAgents. */
public PagedCallSettings.Builder<
SearchAgentsRequest, SearchAgentsResponse, SearchAgentsPagedResponse>
@@ -291,19 +286,6 @@ public UnaryCallSettings.Builder exportAgentSetti
return getStubSettingsBuilder().exportAgentOperationSettings();
}
- /** Returns the builder for the settings used for calls to importAgent. */
- public UnaryCallSettings.Builder importAgentSettings() {
- return getStubSettingsBuilder().importAgentSettings();
- }
-
- /** Returns the builder for the settings used for calls to importAgent. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings.Builder
- importAgentOperationSettings() {
- return getStubSettingsBuilder().importAgentOperationSettings();
- }
-
/** Returns the builder for the settings used for calls to restoreAgent. */
public UnaryCallSettings.Builder restoreAgentSettings() {
return getStubSettingsBuilder().restoreAgentSettings();
@@ -317,6 +299,24 @@ public UnaryCallSettings.Builder restoreAgentSet
return getStubSettingsBuilder().restoreAgentOperationSettings();
}
+ /** Returns the builder for the settings used for calls to getAgent. */
+ public UnaryCallSettings.Builder getAgentSettings() {
+ return getStubSettingsBuilder().getAgentSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to importAgent. */
+ public UnaryCallSettings.Builder importAgentSettings() {
+ return getStubSettingsBuilder().importAgentSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to importAgent. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ importAgentOperationSettings() {
+ return getStubSettingsBuilder().importAgentOperationSettings();
+ }
+
/** Returns the builder for the settings used for calls to getValidationResult. */
public UnaryCallSettings.Builder
getValidationResultSettings() {
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ContextsClient.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ContextsClient.java
index 5486a95a0..6febf96ce 100644
--- a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ContextsClient.java
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ContextsClient.java
@@ -29,6 +29,7 @@
import com.google.cloud.dialogflow.v2.stub.ContextsStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.Empty;
+import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -58,8 +59,8 @@
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
- * Context response = contextsClient.getContext(name);
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * contextsClient.deleteContext(name);
* }
*
*
@@ -166,6 +167,203 @@ public ContextsStub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified context.
+ *
+ * Sample code:
+ *
+ *
+ * try (ContextsClient contextsClient = ContextsClient.create()) {
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * contextsClient.deleteContext(name);
+ * }
+ *
+ *
+ * @param name Required. The name of the context to delete. Format: `projects/<Project
+ * ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or
+ * `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
+ * ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not
+ * specified, we assume default 'draft' environment. If `User ID` is not specified, we assume
+ * default '-' user.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteContext(ContextName name) {
+ DeleteContextRequest request =
+ DeleteContextRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteContext(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified context.
+ *
+ * Sample code:
+ *
+ *
+ * try (ContextsClient contextsClient = ContextsClient.create()) {
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * contextsClient.deleteContext(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The name of the context to delete. Format: `projects/<Project
+ * ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or
+ * `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
+ * ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not
+ * specified, we assume default 'draft' environment. If `User ID` is not specified, we assume
+ * default '-' user.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteContext(String name) {
+ DeleteContextRequest request = DeleteContextRequest.newBuilder().setName(name).build();
+ deleteContext(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified context.
+ *
+ * Sample code:
+ *
+ *
+ * try (ContextsClient contextsClient = ContextsClient.create()) {
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * DeleteContextRequest request = DeleteContextRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * contextsClient.deleteContext(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteContext(DeleteContextRequest request) {
+ deleteContextCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified context.
+ *
+ * Sample code:
+ *
+ *
+ * try (ContextsClient contextsClient = ContextsClient.create()) {
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * DeleteContextRequest request = DeleteContextRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = contextsClient.deleteContextCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable deleteContextCallable() {
+ return stub.deleteContextCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes all active contexts in the specified session.
+ *
+ * Sample code:
+ *
+ *
+ * try (ContextsClient contextsClient = ContextsClient.create()) {
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
+ * contextsClient.deleteAllContexts(parent);
+ * }
+ *
+ *
+ * @param parent Required. The name of the session to delete all contexts from. Format:
+ * `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project
+ * ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session
+ * ID>`. If `Environment ID` is not specified we assume default 'draft' environment. If
+ * `User ID` is not specified, we assume default '-' user.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteAllContexts(SessionName parent) {
+ DeleteAllContextsRequest request =
+ DeleteAllContextsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ deleteAllContexts(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes all active contexts in the specified session.
+ *
+ * Sample code:
+ *
+ *
+ * try (ContextsClient contextsClient = ContextsClient.create()) {
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
+ * contextsClient.deleteAllContexts(parent.toString());
+ * }
+ *
+ *
+ * @param parent Required. The name of the session to delete all contexts from. Format:
+ * `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project
+ * ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session
+ * ID>`. If `Environment ID` is not specified we assume default 'draft' environment. If
+ * `User ID` is not specified, we assume default '-' user.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteAllContexts(String parent) {
+ DeleteAllContextsRequest request =
+ DeleteAllContextsRequest.newBuilder().setParent(parent).build();
+ deleteAllContexts(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes all active contexts in the specified session.
+ *
+ * Sample code:
+ *
+ *
+ * try (ContextsClient contextsClient = ContextsClient.create()) {
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
+ * DeleteAllContextsRequest request = DeleteAllContextsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * contextsClient.deleteAllContexts(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteAllContexts(DeleteAllContextsRequest request) {
+ deleteAllContextsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes all active contexts in the specified session.
+ *
+ * Sample code:
+ *
+ *
+ * try (ContextsClient contextsClient = ContextsClient.create()) {
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
+ * DeleteAllContextsRequest request = DeleteAllContextsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<Void> future = contextsClient.deleteAllContextsCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable deleteAllContextsCallable() {
+ return stub.deleteAllContextsCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns the list of all contexts in the specified session.
@@ -174,7 +372,7 @@ public ContextsStub getStub() {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* for (Context element : contextsClient.listContexts(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -204,7 +402,7 @@ public final ListContextsPagedResponse listContexts(SessionName parent) {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* for (Context element : contextsClient.listContexts(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -231,7 +429,7 @@ public final ListContextsPagedResponse listContexts(String parent) {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* ListContextsRequest request = ListContextsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -256,7 +454,7 @@ public final ListContextsPagedResponse listContexts(ListContextsRequest request)
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* ListContextsRequest request = ListContextsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -281,7 +479,7 @@ public final ListContextsPagedResponse listContexts(ListContextsRequest request)
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* ListContextsRequest request = ListContextsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -312,7 +510,7 @@ public final UnaryCallable listContex
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
* Context response = contextsClient.getContext(name);
* }
*
@@ -339,7 +537,7 @@ public final Context getContext(ContextName name) {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
* Context response = contextsClient.getContext(name.toString());
* }
*
@@ -365,7 +563,7 @@ public final Context getContext(String name) {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
* GetContextRequest request = GetContextRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -388,7 +586,7 @@ public final Context getContext(GetContextRequest request) {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
+ * ContextName name = ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");
* GetContextRequest request = GetContextRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -412,7 +610,7 @@ public final UnaryCallable getContextCallable() {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* Context context = Context.newBuilder().build();
* Context response = contextsClient.createContext(parent, context);
* }
@@ -445,7 +643,7 @@ public final Context createContext(SessionName parent, Context context) {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* Context context = Context.newBuilder().build();
* Context response = contextsClient.createContext(parent.toString(), context);
* }
@@ -475,7 +673,7 @@ public final Context createContext(String parent, Context context) {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* Context context = Context.newBuilder().build();
* CreateContextRequest request = CreateContextRequest.newBuilder()
* .setParent(parent.toString())
@@ -502,7 +700,7 @@ public final Context createContext(CreateContextRequest request) {
*
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* Context context = Context.newBuilder().build();
* CreateContextRequest request = CreateContextRequest.newBuilder()
* .setParent(parent.toString())
@@ -527,15 +725,18 @@ public final UnaryCallable createContextCallable(
*
* try (ContextsClient contextsClient = ContextsClient.create()) {
* Context context = Context.newBuilder().build();
- * Context response = contextsClient.updateContext(context);
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Context response = contextsClient.updateContext(context, updateMask);
* }
*
*
* @param context Required. The context to update.
+ * @param updateMask Optional. The mask to control which fields get updated.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Context updateContext(Context context) {
- UpdateContextRequest request = UpdateContextRequest.newBuilder().setContext(context).build();
+ public final Context updateContext(Context context, FieldMask updateMask) {
+ UpdateContextRequest request =
+ UpdateContextRequest.newBuilder().setContext(context).setUpdateMask(updateMask).build();
return updateContext(request);
}
@@ -584,203 +785,6 @@ public final UnaryCallable updateContextCallable(
return stub.updateContextCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the specified context.
- *
- * Sample code:
- *
- *
- * try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
- * contextsClient.deleteContext(name);
- * }
- *
- *
- * @param name Required. The name of the context to delete. Format: `projects/<Project
- * ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or
- * `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
- * ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not
- * specified, we assume default 'draft' environment. If `User ID` is not specified, we assume
- * default '-' user.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteContext(ContextName name) {
- DeleteContextRequest request =
- DeleteContextRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteContext(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the specified context.
- *
- * Sample code:
- *
- *
- * try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
- * contextsClient.deleteContext(name.toString());
- * }
- *
- *
- * @param name Required. The name of the context to delete. Format: `projects/<Project
- * ID>/agent/sessions/<Session ID>/contexts/<Context ID>` or
- * `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
- * ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is not
- * specified, we assume default 'draft' environment. If `User ID` is not specified, we assume
- * default '-' user.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteContext(String name) {
- DeleteContextRequest request = DeleteContextRequest.newBuilder().setName(name).build();
- deleteContext(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the specified context.
- *
- * Sample code:
- *
- *
- * try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
- * DeleteContextRequest request = DeleteContextRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * contextsClient.deleteContext(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteContext(DeleteContextRequest request) {
- deleteContextCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the specified context.
- *
- * Sample code:
- *
- *
- * try (ContextsClient contextsClient = ContextsClient.create()) {
- * ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
- * DeleteContextRequest request = DeleteContextRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = contextsClient.deleteContextCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable deleteContextCallable() {
- return stub.deleteContextCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes all active contexts in the specified session.
- *
- * Sample code:
- *
- *
- * try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
- * contextsClient.deleteAllContexts(parent);
- * }
- *
- *
- * @param parent Required. The name of the session to delete all contexts from. Format:
- * `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project
- * ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session
- * ID>`. If `Environment ID` is not specified we assume default 'draft' environment. If
- * `User ID` is not specified, we assume default '-' user.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteAllContexts(SessionName parent) {
- DeleteAllContextsRequest request =
- DeleteAllContextsRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .build();
- deleteAllContexts(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes all active contexts in the specified session.
- *
- * Sample code:
- *
- *
- * try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
- * contextsClient.deleteAllContexts(parent.toString());
- * }
- *
- *
- * @param parent Required. The name of the session to delete all contexts from. Format:
- * `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project
- * ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session
- * ID>`. If `Environment ID` is not specified we assume default 'draft' environment. If
- * `User ID` is not specified, we assume default '-' user.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteAllContexts(String parent) {
- DeleteAllContextsRequest request =
- DeleteAllContextsRequest.newBuilder().setParent(parent).build();
- deleteAllContexts(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes all active contexts in the specified session.
- *
- * Sample code:
- *
- *
- * try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
- * DeleteAllContextsRequest request = DeleteAllContextsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * contextsClient.deleteAllContexts(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteAllContexts(DeleteAllContextsRequest request) {
- deleteAllContextsCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes all active contexts in the specified session.
- *
- * Sample code:
- *
- *
- * try (ContextsClient contextsClient = ContextsClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
- * DeleteAllContextsRequest request = DeleteAllContextsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<Void> future = contextsClient.deleteAllContextsCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable deleteAllContextsCallable() {
- return stub.deleteAllContextsCallable();
- }
-
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ContextsSettings.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ContextsSettings.java
index e7fe62e37..228d06e7f 100644
--- a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ContextsSettings.java
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ContextsSettings.java
@@ -49,16 +49,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of getContext to 30 seconds:
+ *
For example, to set the total timeout of deleteContext to 30 seconds:
*
*
*
* ContextsSettings.Builder contextsSettingsBuilder =
* ContextsSettings.newBuilder();
* contextsSettingsBuilder
- * .getContextSettings()
+ * .deleteContextSettings()
* .setRetrySettings(
- * contextsSettingsBuilder.getContextSettings().getRetrySettings().toBuilder()
+ * contextsSettingsBuilder.deleteContextSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ContextsSettings contextsSettings = contextsSettingsBuilder.build();
@@ -68,6 +68,16 @@
@Generated("by gapic-generator")
@BetaApi
public class ContextsSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to deleteContext. */
+ public UnaryCallSettings deleteContextSettings() {
+ return ((ContextsStubSettings) getStubSettings()).deleteContextSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteAllContexts. */
+ public UnaryCallSettings deleteAllContextsSettings() {
+ return ((ContextsStubSettings) getStubSettings()).deleteAllContextsSettings();
+ }
+
/** Returns the object with the settings used for calls to listContexts. */
public PagedCallSettings
listContextsSettings() {
@@ -89,16 +99,6 @@ public UnaryCallSettings updateContextSettings()
return ((ContextsStubSettings) getStubSettings()).updateContextSettings();
}
- /** Returns the object with the settings used for calls to deleteContext. */
- public UnaryCallSettings deleteContextSettings() {
- return ((ContextsStubSettings) getStubSettings()).deleteContextSettings();
- }
-
- /** Returns the object with the settings used for calls to deleteAllContexts. */
- public UnaryCallSettings deleteAllContextsSettings() {
- return ((ContextsStubSettings) getStubSettings()).deleteAllContextsSettings();
- }
-
public static final ContextsSettings create(ContextsStubSettings stub) throws IOException {
return new ContextsSettings.Builder(stub.toBuilder()).build();
}
@@ -195,6 +195,16 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to deleteContext. */
+ public UnaryCallSettings.Builder deleteContextSettings() {
+ return getStubSettingsBuilder().deleteContextSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteAllContexts. */
+ public UnaryCallSettings.Builder deleteAllContextsSettings() {
+ return getStubSettingsBuilder().deleteAllContextsSettings();
+ }
+
/** Returns the builder for the settings used for calls to listContexts. */
public PagedCallSettings.Builder<
ListContextsRequest, ListContextsResponse, ListContextsPagedResponse>
@@ -217,16 +227,6 @@ public UnaryCallSettings.Builder updateContextSet
return getStubSettingsBuilder().updateContextSettings();
}
- /** Returns the builder for the settings used for calls to deleteContext. */
- public UnaryCallSettings.Builder deleteContextSettings() {
- return getStubSettingsBuilder().deleteContextSettings();
- }
-
- /** Returns the builder for the settings used for calls to deleteAllContexts. */
- public UnaryCallSettings.Builder deleteAllContextsSettings() {
- return getStubSettingsBuilder().deleteAllContextsSettings();
- }
-
@Override
public ContextsSettings build() throws IOException {
return new ContextsSettings(this);
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesClient.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesClient.java
index 199815561..3901175c2 100644
--- a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesClient.java
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesClient.java
@@ -74,7 +74,7 @@
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * EntityType response = entityTypesClient.getEntityType(name);
+ * entityTypesClient.deleteEntityType(name);
* }
*
*
@@ -195,6 +195,481 @@ public final OperationsClient getOperationsClient() {
return operationsClient;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified entity type.
+ *
+ * Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * entityTypesClient.deleteEntityType(name);
+ * }
+ *
+ *
+ * @param name Required. The name of the entity type to delete. Format: `projects/<Project
+ * ID>/agent/entityTypes/<EntityType ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteEntityType(EntityTypeName name) {
+ DeleteEntityTypeRequest request =
+ DeleteEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteEntityType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified entity type.
+ *
+ * Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * entityTypesClient.deleteEntityType(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The name of the entity type to delete. Format: `projects/<Project
+ * ID>/agent/entityTypes/<EntityType ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteEntityType(String name) {
+ DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder().setName(name).build();
+ deleteEntityType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified entity type.
+ *
+ * Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * entityTypesClient.deleteEntityType(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteEntityType(DeleteEntityTypeRequest request) {
+ deleteEntityTypeCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified entity type.
+ *
+ * Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = entityTypesClient.deleteEntityTypeCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable deleteEntityTypeCallable() {
+ return stub.deleteEntityTypeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entity types in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<String> entityTypeNames = new ArrayList<>();
+ * entityTypesClient.batchDeleteEntityTypesAsync(parent, entityTypeNames).get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the agent to delete all entities types for. Format:
+ * `projects/<Project ID>/agent`.
+ * @param entityTypeNames Required. The names entity types to delete. All names must point to the
+ * same agent as `parent`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteEntityTypesAsync(
+ AgentName parent, List entityTypeNames) {
+ BatchDeleteEntityTypesRequest request =
+ BatchDeleteEntityTypesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .addAllEntityTypeNames(entityTypeNames)
+ .build();
+ return batchDeleteEntityTypesAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entity types in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<String> entityTypeNames = new ArrayList<>();
+ * entityTypesClient.batchDeleteEntityTypesAsync(parent.toString(), entityTypeNames).get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the agent to delete all entities types for. Format:
+ * `projects/<Project ID>/agent`.
+ * @param entityTypeNames Required. The names entity types to delete. All names must point to the
+ * same agent as `parent`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteEntityTypesAsync(
+ String parent, List entityTypeNames) {
+ BatchDeleteEntityTypesRequest request =
+ BatchDeleteEntityTypesRequest.newBuilder()
+ .setParent(parent)
+ .addAllEntityTypeNames(entityTypeNames)
+ .build();
+ return batchDeleteEntityTypesAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entity types in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<String> entityTypeNames = new ArrayList<>();
+ * BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllEntityTypeNames(entityTypeNames)
+ * .build();
+ * entityTypesClient.batchDeleteEntityTypesAsync(request).get();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteEntityTypesAsync(
+ BatchDeleteEntityTypesRequest request) {
+ return batchDeleteEntityTypesOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entity types in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<String> entityTypeNames = new ArrayList<>();
+ * BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllEntityTypeNames(entityTypeNames)
+ * .build();
+ * OperationFuture<Empty, Struct> future = entityTypesClient.batchDeleteEntityTypesOperationCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ batchDeleteEntityTypesOperationCallable() {
+ return stub.batchDeleteEntityTypesOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entity types in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<String> entityTypeNames = new ArrayList<>();
+ * BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllEntityTypeNames(entityTypeNames)
+ * .build();
+ * ApiFuture<Operation> future = entityTypesClient.batchDeleteEntityTypesCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable
+ batchDeleteEntityTypesCallable() {
+ return stub.batchDeleteEntityTypesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entities in the specified entity type.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * List<String> entityValues = new ArrayList<>();
+ * entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues).get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the entity type to delete entries for. Format:
+ * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
+ * @param entityValues Required. The reference `values` of the entities to delete. Note that these
+ * are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteEntitiesAsync(
+ EntityTypeName parent, List entityValues) {
+ BatchDeleteEntitiesRequest request =
+ BatchDeleteEntitiesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .addAllEntityValues(entityValues)
+ .build();
+ return batchDeleteEntitiesAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entities in the specified entity type.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * List<String> entityValues = new ArrayList<>();
+ * entityTypesClient.batchDeleteEntitiesAsync(parent.toString(), entityValues).get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the entity type to delete entries for. Format:
+ * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
+ * @param entityValues Required. The reference `values` of the entities to delete. Note that these
+ * are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteEntitiesAsync(
+ String parent, List entityValues) {
+ BatchDeleteEntitiesRequest request =
+ BatchDeleteEntitiesRequest.newBuilder()
+ .setParent(parent)
+ .addAllEntityValues(entityValues)
+ .build();
+ return batchDeleteEntitiesAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entities in the specified entity type.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * List<String> entityValues = new ArrayList<>();
+ * String languageCode = "";
+ * entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues, languageCode).get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the entity type to delete entries for. Format:
+ * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
+ * @param entityValues Required. The reference `values` of the entities to delete. Note that these
+ * are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
+ * @param languageCode Optional. The language used to access language-specific data. If not
+ * specified, the agent's default language is used. For more information, see [Multilingual
+ * intent and entity
+ * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteEntitiesAsync(
+ EntityTypeName parent, List entityValues, String languageCode) {
+ BatchDeleteEntitiesRequest request =
+ BatchDeleteEntitiesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .addAllEntityValues(entityValues)
+ .setLanguageCode(languageCode)
+ .build();
+ return batchDeleteEntitiesAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entities in the specified entity type.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * List<String> entityValues = new ArrayList<>();
+ * String languageCode = "";
+ * entityTypesClient.batchDeleteEntitiesAsync(parent.toString(), entityValues, languageCode).get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the entity type to delete entries for. Format:
+ * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
+ * @param entityValues Required. The reference `values` of the entities to delete. Note that these
+ * are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
+ * @param languageCode Optional. The language used to access language-specific data. If not
+ * specified, the agent's default language is used. For more information, see [Multilingual
+ * intent and entity
+ * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteEntitiesAsync(
+ String parent, List entityValues, String languageCode) {
+ BatchDeleteEntitiesRequest request =
+ BatchDeleteEntitiesRequest.newBuilder()
+ .setParent(parent)
+ .addAllEntityValues(entityValues)
+ .setLanguageCode(languageCode)
+ .build();
+ return batchDeleteEntitiesAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entities in the specified entity type.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * List<String> entityValues = new ArrayList<>();
+ * BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllEntityValues(entityValues)
+ * .build();
+ * entityTypesClient.batchDeleteEntitiesAsync(request).get();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteEntitiesAsync(
+ BatchDeleteEntitiesRequest request) {
+ return batchDeleteEntitiesOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entities in the specified entity type.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * List<String> entityValues = new ArrayList<>();
+ * BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllEntityValues(entityValues)
+ * .build();
+ * OperationFuture<Empty, Struct> future = entityTypesClient.batchDeleteEntitiesOperationCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ batchDeleteEntitiesOperationCallable() {
+ return stub.batchDeleteEntitiesOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes entities in the specified entity type.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
+ * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
+ * List<String> entityValues = new ArrayList<>();
+ * BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllEntityValues(entityValues)
+ * .build();
+ * ApiFuture<Operation> future = entityTypesClient.batchDeleteEntitiesCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable batchDeleteEntitiesCallable() {
+ return stub.batchDeleteEntitiesCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns the list of all entity types in the specified agent.
@@ -203,7 +678,7 @@ public final OperationsClient getOperationsClient() {
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -214,7 +689,7 @@ public final OperationsClient getOperationsClient() {
* ID>/agent`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListEntityTypesPagedResponse listEntityTypes(ProjectAgentName parent) {
+ public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) {
ListEntityTypesRequest request =
ListEntityTypesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -230,7 +705,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(ProjectAgentName paren
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* for (EntityType element : entityTypesClient.listEntityTypes(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -254,7 +729,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(String parent) {
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* String languageCode = "";
* for (EntityType element : entityTypesClient.listEntityTypes(parent, languageCode).iterateAll()) {
* // doThingsWith(element);
@@ -270,8 +745,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(String parent) {
* data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListEntityTypesPagedResponse listEntityTypes(
- ProjectAgentName parent, String languageCode) {
+ public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent, String languageCode) {
ListEntityTypesRequest request =
ListEntityTypesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -288,7 +762,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* String languageCode = "";
* for (EntityType element : entityTypesClient.listEntityTypes(parent.toString(), languageCode).iterateAll()) {
* // doThingsWith(element);
@@ -318,7 +792,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(String parent, String
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -343,7 +817,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -368,7 +842,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -549,7 +1023,7 @@ public final UnaryCallable getEntityTypeCallab
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* EntityType entityType = EntityType.newBuilder().build();
* EntityType response = entityTypesClient.createEntityType(parent, entityType);
* }
@@ -560,7 +1034,7 @@ public final UnaryCallable getEntityTypeCallab
* @param entityType Required. The entity type to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final EntityType createEntityType(ProjectAgentName parent, EntityType entityType) {
+ public final EntityType createEntityType(AgentName parent, EntityType entityType) {
CreateEntityTypeRequest request =
CreateEntityTypeRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -577,7 +1051,7 @@ public final EntityType createEntityType(ProjectAgentName parent, EntityType ent
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* EntityType entityType = EntityType.newBuilder().build();
* EntityType response = entityTypesClient.createEntityType(parent.toString(), entityType);
* }
@@ -602,7 +1076,7 @@ public final EntityType createEntityType(String parent, EntityType entityType) {
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* EntityType entityType = EntityType.newBuilder().build();
* String languageCode = "";
* EntityType response = entityTypesClient.createEntityType(parent, entityType, languageCode);
@@ -619,7 +1093,7 @@ public final EntityType createEntityType(String parent, EntityType entityType) {
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final EntityType createEntityType(
- ProjectAgentName parent, EntityType entityType, String languageCode) {
+ AgentName parent, EntityType entityType, String languageCode) {
CreateEntityTypeRequest request =
CreateEntityTypeRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -637,7 +1111,7 @@ public final EntityType createEntityType(
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* EntityType entityType = EntityType.newBuilder().build();
* String languageCode = "";
* EntityType response = entityTypesClient.createEntityType(parent.toString(), entityType, languageCode);
@@ -672,7 +1146,7 @@ public final EntityType createEntityType(
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* EntityType entityType = EntityType.newBuilder().build();
* CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
* .setParent(parent.toString())
@@ -697,7 +1171,7 @@ public final EntityType createEntityType(CreateEntityTypeRequest request) {
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* EntityType entityType = EntityType.newBuilder().build();
* CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
* .setParent(parent.toString())
@@ -810,96 +1284,6 @@ public final UnaryCallable updateEntityType
return stub.updateEntityTypeCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the specified entity type.
- *
- * Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * entityTypesClient.deleteEntityType(name);
- * }
- *
- *
- * @param name Required. The name of the entity type to delete. Format: `projects/<Project
- * ID>/agent/entityTypes/<EntityType ID>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteEntityType(EntityTypeName name) {
- DeleteEntityTypeRequest request =
- DeleteEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteEntityType(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the specified entity type.
- *
- * Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * entityTypesClient.deleteEntityType(name.toString());
- * }
- *
- *
- * @param name Required. The name of the entity type to delete. Format: `projects/<Project
- * ID>/agent/entityTypes/<EntityType ID>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteEntityType(String name) {
- DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder().setName(name).build();
- deleteEntityType(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the specified entity type.
- *
- * Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * entityTypesClient.deleteEntityType(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteEntityType(DeleteEntityTypeRequest request) {
- deleteEntityTypeCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the specified entity type.
- *
- * Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = entityTypesClient.deleteEntityTypeCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable deleteEntityTypeCallable() {
- return stub.deleteEntityTypeCallable();
- }
-
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates/Creates multiple entity types in the specified agent.
@@ -911,7 +1295,7 @@ public final UnaryCallable deleteEntityTypeCalla
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -940,7 +1324,7 @@ public final OperationFuture batchUpdate
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -950,190 +1334,37 @@ public final OperationFuture batchUpdate
* }
*
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable<
- BatchUpdateEntityTypesRequest, BatchUpdateEntityTypesResponse, Struct>
- batchUpdateEntityTypesOperationCallable() {
- return stub.batchUpdateEntityTypesOperationCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates/Creates multiple entity types in the specified agent.
- *
- * Operation <response:
- * [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<Operation> future = entityTypesClient.batchUpdateEntityTypesCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- */
- public final UnaryCallable
- batchUpdateEntityTypesCallable() {
- return stub.batchUpdateEntityTypesCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entity types in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<String> entityTypeNames = new ArrayList<>();
- * entityTypesClient.batchDeleteEntityTypesAsync(parent, entityTypeNames).get();
- * }
- *
- *
- * @param parent Required. The name of the agent to delete all entities types for. Format:
- * `projects/<Project ID>/agent`.
- * @param entityTypeNames Required. The names entity types to delete. All names must point to the
- * same agent as `parent`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteEntityTypesAsync(
- ProjectAgentName parent, List entityTypeNames) {
- BatchDeleteEntityTypesRequest request =
- BatchDeleteEntityTypesRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .addAllEntityTypeNames(entityTypeNames)
- .build();
- return batchDeleteEntityTypesAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entity types in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<String> entityTypeNames = new ArrayList<>();
- * entityTypesClient.batchDeleteEntityTypesAsync(parent.toString(), entityTypeNames).get();
- * }
- *
- *
- * @param parent Required. The name of the agent to delete all entities types for. Format:
- * `projects/<Project ID>/agent`.
- * @param entityTypeNames Required. The names entity types to delete. All names must point to the
- * same agent as `parent`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteEntityTypesAsync(
- String parent, List entityTypeNames) {
- BatchDeleteEntityTypesRequest request =
- BatchDeleteEntityTypesRequest.newBuilder()
- .setParent(parent)
- .addAllEntityTypeNames(entityTypeNames)
- .build();
- return batchDeleteEntityTypesAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entity types in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<String> entityTypeNames = new ArrayList<>();
- * BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllEntityTypeNames(entityTypeNames)
- * .build();
- * entityTypesClient.batchDeleteEntityTypesAsync(request).get();
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteEntityTypesAsync(
- BatchDeleteEntityTypesRequest request) {
- return batchDeleteEntityTypesOperationCallable().futureCall(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entity types in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<String> entityTypeNames = new ArrayList<>();
- * BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllEntityTypeNames(entityTypeNames)
- * .build();
- * OperationFuture<Empty, Struct> future = entityTypesClient.batchDeleteEntityTypesOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- batchDeleteEntityTypesOperationCallable() {
- return stub.batchDeleteEntityTypesOperationCallable();
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable<
+ BatchUpdateEntityTypesRequest, BatchUpdateEntityTypesResponse, Struct>
+ batchUpdateEntityTypesOperationCallable() {
+ return stub.batchUpdateEntityTypesOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes entity types in the specified agent.
+ * Updates/Creates multiple entity types in the specified agent.
*
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
Operation <response:
+ * [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
*
*
Sample code:
*
*
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<String> entityTypeNames = new ArrayList<>();
- * BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder()
* .setParent(parent.toString())
- * .addAllEntityTypeNames(entityTypeNames)
* .build();
- * ApiFuture<Operation> future = entityTypesClient.batchDeleteEntityTypesCallable().futureCall(request);
+ * ApiFuture<Operation> future = entityTypesClient.batchUpdateEntityTypesCallable().futureCall(request);
* // Do something
- * future.get();
+ * Operation response = future.get();
* }
*
*/
- public final UnaryCallable
- batchDeleteEntityTypesCallable() {
- return stub.batchDeleteEntityTypesCallable();
+ public final UnaryCallable
+ batchUpdateEntityTypesCallable() {
+ return stub.batchUpdateEntityTypesCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -1593,238 +1824,6 @@ public final UnaryCallable batchUpdateEnt
return stub.batchUpdateEntitiesCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entities in the specified entity type.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * List<String> entityValues = new ArrayList<>();
- * entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues).get();
- * }
- *
- *
- * @param parent Required. The name of the entity type to delete entries for. Format:
- * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
- * @param entityValues Required. The reference `values` of the entities to delete. Note that these
- * are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteEntitiesAsync(
- EntityTypeName parent, List entityValues) {
- BatchDeleteEntitiesRequest request =
- BatchDeleteEntitiesRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .addAllEntityValues(entityValues)
- .build();
- return batchDeleteEntitiesAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entities in the specified entity type.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * List<String> entityValues = new ArrayList<>();
- * entityTypesClient.batchDeleteEntitiesAsync(parent.toString(), entityValues).get();
- * }
- *
- *
- * @param parent Required. The name of the entity type to delete entries for. Format:
- * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
- * @param entityValues Required. The reference `values` of the entities to delete. Note that these
- * are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteEntitiesAsync(
- String parent, List entityValues) {
- BatchDeleteEntitiesRequest request =
- BatchDeleteEntitiesRequest.newBuilder()
- .setParent(parent)
- .addAllEntityValues(entityValues)
- .build();
- return batchDeleteEntitiesAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entities in the specified entity type.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * List<String> entityValues = new ArrayList<>();
- * String languageCode = "";
- * entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues, languageCode).get();
- * }
- *
- *
- * @param parent Required. The name of the entity type to delete entries for. Format:
- * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
- * @param entityValues Required. The reference `values` of the entities to delete. Note that these
- * are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
- * @param languageCode Optional. The language used to access language-specific data. If not
- * specified, the agent's default language is used. For more information, see [Multilingual
- * intent and entity
- * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteEntitiesAsync(
- EntityTypeName parent, List entityValues, String languageCode) {
- BatchDeleteEntitiesRequest request =
- BatchDeleteEntitiesRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .addAllEntityValues(entityValues)
- .setLanguageCode(languageCode)
- .build();
- return batchDeleteEntitiesAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entities in the specified entity type.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * List<String> entityValues = new ArrayList<>();
- * String languageCode = "";
- * entityTypesClient.batchDeleteEntitiesAsync(parent.toString(), entityValues, languageCode).get();
- * }
- *
- *
- * @param parent Required. The name of the entity type to delete entries for. Format:
- * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
- * @param entityValues Required. The reference `values` of the entities to delete. Note that these
- * are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.
- * @param languageCode Optional. The language used to access language-specific data. If not
- * specified, the agent's default language is used. For more information, see [Multilingual
- * intent and entity
- * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteEntitiesAsync(
- String parent, List entityValues, String languageCode) {
- BatchDeleteEntitiesRequest request =
- BatchDeleteEntitiesRequest.newBuilder()
- .setParent(parent)
- .addAllEntityValues(entityValues)
- .setLanguageCode(languageCode)
- .build();
- return batchDeleteEntitiesAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entities in the specified entity type.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * List<String> entityValues = new ArrayList<>();
- * BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllEntityValues(entityValues)
- * .build();
- * entityTypesClient.batchDeleteEntitiesAsync(request).get();
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteEntitiesAsync(
- BatchDeleteEntitiesRequest request) {
- return batchDeleteEntitiesOperationCallable().futureCall(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entities in the specified entity type.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * List<String> entityValues = new ArrayList<>();
- * BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllEntityValues(entityValues)
- * .build();
- * OperationFuture<Empty, Struct> future = entityTypesClient.batchDeleteEntitiesOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- batchDeleteEntitiesOperationCallable() {
- return stub.batchDeleteEntitiesOperationCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes entities in the specified entity type.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
- * List<String> entityValues = new ArrayList<>();
- * BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllEntityValues(entityValues)
- * .build();
- * ApiFuture<Operation> future = entityTypesClient.batchDeleteEntitiesCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable batchDeleteEntitiesCallable() {
- return stub.batchDeleteEntitiesCallable();
- }
-
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesSettings.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesSettings.java
index caa415266..c268664c1 100644
--- a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesSettings.java
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesSettings.java
@@ -52,16 +52,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of getEntityType to 30 seconds:
+ *
For example, to set the total timeout of deleteEntityType to 30 seconds:
*
*
*
* EntityTypesSettings.Builder entityTypesSettingsBuilder =
* EntityTypesSettings.newBuilder();
* entityTypesSettingsBuilder
- * .getEntityTypeSettings()
+ * .deleteEntityTypeSettings()
* .setRetrySettings(
- * entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ * entityTypesSettingsBuilder.deleteEntityTypeSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* EntityTypesSettings entityTypesSettings = entityTypesSettingsBuilder.build();
@@ -71,6 +71,38 @@
@Generated("by gapic-generator")
@BetaApi
public class EntityTypesSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to deleteEntityType. */
+ public UnaryCallSettings deleteEntityTypeSettings() {
+ return ((EntityTypesStubSettings) getStubSettings()).deleteEntityTypeSettings();
+ }
+
+ /** Returns the object with the settings used for calls to batchDeleteEntityTypes. */
+ public UnaryCallSettings
+ batchDeleteEntityTypesSettings() {
+ return ((EntityTypesStubSettings) getStubSettings()).batchDeleteEntityTypesSettings();
+ }
+
+ /** Returns the object with the settings used for calls to batchDeleteEntityTypes. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings
+ batchDeleteEntityTypesOperationSettings() {
+ return ((EntityTypesStubSettings) getStubSettings()).batchDeleteEntityTypesOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to batchDeleteEntities. */
+ public UnaryCallSettings batchDeleteEntitiesSettings() {
+ return ((EntityTypesStubSettings) getStubSettings()).batchDeleteEntitiesSettings();
+ }
+
+ /** Returns the object with the settings used for calls to batchDeleteEntities. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings
+ batchDeleteEntitiesOperationSettings() {
+ return ((EntityTypesStubSettings) getStubSettings()).batchDeleteEntitiesOperationSettings();
+ }
+
/** Returns the object with the settings used for calls to listEntityTypes. */
public PagedCallSettings<
ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse>
@@ -93,11 +125,6 @@ public UnaryCallSettings updateEntityTypeSe
return ((EntityTypesStubSettings) getStubSettings()).updateEntityTypeSettings();
}
- /** Returns the object with the settings used for calls to deleteEntityType. */
- public UnaryCallSettings deleteEntityTypeSettings() {
- return ((EntityTypesStubSettings) getStubSettings()).deleteEntityTypeSettings();
- }
-
/** Returns the object with the settings used for calls to batchUpdateEntityTypes. */
public UnaryCallSettings
batchUpdateEntityTypesSettings() {
@@ -113,20 +140,6 @@ public UnaryCallSettings deleteEntityTypeSetting
return ((EntityTypesStubSettings) getStubSettings()).batchUpdateEntityTypesOperationSettings();
}
- /** Returns the object with the settings used for calls to batchDeleteEntityTypes. */
- public UnaryCallSettings
- batchDeleteEntityTypesSettings() {
- return ((EntityTypesStubSettings) getStubSettings()).batchDeleteEntityTypesSettings();
- }
-
- /** Returns the object with the settings used for calls to batchDeleteEntityTypes. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings
- batchDeleteEntityTypesOperationSettings() {
- return ((EntityTypesStubSettings) getStubSettings()).batchDeleteEntityTypesOperationSettings();
- }
-
/** Returns the object with the settings used for calls to batchCreateEntities. */
public UnaryCallSettings batchCreateEntitiesSettings() {
return ((EntityTypesStubSettings) getStubSettings()).batchCreateEntitiesSettings();
@@ -153,19 +166,6 @@ public UnaryCallSettings batchUpdateEntit
return ((EntityTypesStubSettings) getStubSettings()).batchUpdateEntitiesOperationSettings();
}
- /** Returns the object with the settings used for calls to batchDeleteEntities. */
- public UnaryCallSettings batchDeleteEntitiesSettings() {
- return ((EntityTypesStubSettings) getStubSettings()).batchDeleteEntitiesSettings();
- }
-
- /** Returns the object with the settings used for calls to batchDeleteEntities. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings
- batchDeleteEntitiesOperationSettings() {
- return ((EntityTypesStubSettings) getStubSettings()).batchDeleteEntitiesOperationSettings();
- }
-
public static final EntityTypesSettings create(EntityTypesStubSettings stub) throws IOException {
return new EntityTypesSettings.Builder(stub.toBuilder()).build();
}
@@ -262,6 +262,39 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to deleteEntityType. */
+ public UnaryCallSettings.Builder deleteEntityTypeSettings() {
+ return getStubSettingsBuilder().deleteEntityTypeSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to batchDeleteEntityTypes. */
+ public UnaryCallSettings.Builder
+ batchDeleteEntityTypesSettings() {
+ return getStubSettingsBuilder().batchDeleteEntityTypesSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to batchDeleteEntityTypes. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ batchDeleteEntityTypesOperationSettings() {
+ return getStubSettingsBuilder().batchDeleteEntityTypesOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to batchDeleteEntities. */
+ public UnaryCallSettings.Builder
+ batchDeleteEntitiesSettings() {
+ return getStubSettingsBuilder().batchDeleteEntitiesSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to batchDeleteEntities. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ batchDeleteEntitiesOperationSettings() {
+ return getStubSettingsBuilder().batchDeleteEntitiesOperationSettings();
+ }
+
/** Returns the builder for the settings used for calls to listEntityTypes. */
public PagedCallSettings.Builder<
ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse>
@@ -286,11 +319,6 @@ public UnaryCallSettings.Builder getEntityType
return getStubSettingsBuilder().updateEntityTypeSettings();
}
- /** Returns the builder for the settings used for calls to deleteEntityType. */
- public UnaryCallSettings.Builder deleteEntityTypeSettings() {
- return getStubSettingsBuilder().deleteEntityTypeSettings();
- }
-
/** Returns the builder for the settings used for calls to batchUpdateEntityTypes. */
public UnaryCallSettings.Builder
batchUpdateEntityTypesSettings() {
@@ -306,20 +334,6 @@ public UnaryCallSettings.Builder deleteEntityTyp
return getStubSettingsBuilder().batchUpdateEntityTypesOperationSettings();
}
- /** Returns the builder for the settings used for calls to batchDeleteEntityTypes. */
- public UnaryCallSettings.Builder
- batchDeleteEntityTypesSettings() {
- return getStubSettingsBuilder().batchDeleteEntityTypesSettings();
- }
-
- /** Returns the builder for the settings used for calls to batchDeleteEntityTypes. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings.Builder
- batchDeleteEntityTypesOperationSettings() {
- return getStubSettingsBuilder().batchDeleteEntityTypesOperationSettings();
- }
-
/** Returns the builder for the settings used for calls to batchCreateEntities. */
public UnaryCallSettings.Builder
batchCreateEntitiesSettings() {
@@ -348,20 +362,6 @@ public UnaryCallSettings.Builder deleteEntityTyp
return getStubSettingsBuilder().batchUpdateEntitiesOperationSettings();
}
- /** Returns the builder for the settings used for calls to batchDeleteEntities. */
- public UnaryCallSettings.Builder
- batchDeleteEntitiesSettings() {
- return getStubSettingsBuilder().batchDeleteEntitiesSettings();
- }
-
- /** Returns the builder for the settings used for calls to batchDeleteEntities. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings.Builder
- batchDeleteEntitiesOperationSettings() {
- return getStubSettingsBuilder().batchDeleteEntitiesOperationSettings();
- }
-
@Override
public EntityTypesSettings build() throws IOException {
return new EntityTypesSettings(this);
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EnvironmentsClient.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EnvironmentsClient.java
new file mode 100644
index 000000000..bdca42bb4
--- /dev/null
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EnvironmentsClient.java
@@ -0,0 +1,355 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.dialogflow.v2;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.dialogflow.v2.stub.EnvironmentsStub;
+import com.google.cloud.dialogflow.v2.stub.EnvironmentsStubSettings;
+import com.google.common.util.concurrent.MoreExecutors;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * Service Description: Manages agent environments.
+ *
+ * This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ *
+ *
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListEnvironmentsPagedResponse> future = environmentsClient.listEnvironmentsPagedCallable().futureCall(request);
+ * // Do something
+ * for (Environment element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ *
+ * Note: close() needs to be called on the environmentsClient object to clean up resources such
+ * as threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ *
The surface of this class includes several types of Java methods for each of the API's
+ * methods:
+ *
+ *
+ * - A "flattened" method. With this type of method, the fields of the request type have been
+ * converted into function parameters. It may be the case that not all fields are available as
+ * parameters, and not every API method will have a flattened method entry point.
+ *
- A "request object" method. This type of method only takes one parameter, a request object,
+ * which must be constructed before the call. Not every API method will have a request object
+ * method.
+ *
- A "callable" method. This type of method takes no parameters and returns an immutable API
+ * callable object, which can be used to initiate calls to the service.
+ *
+ *
+ * See the individual methods for example code.
+ *
+ *
Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ *
This class can be customized by passing in a custom instance of EnvironmentsSettings to
+ * create(). For example:
+ *
+ *
To customize credentials:
+ *
+ *
+ *
+ * EnvironmentsSettings environmentsSettings =
+ * EnvironmentsSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * EnvironmentsClient environmentsClient =
+ * EnvironmentsClient.create(environmentsSettings);
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ *
+ * EnvironmentsSettings environmentsSettings =
+ * EnvironmentsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * EnvironmentsClient environmentsClient =
+ * EnvironmentsClient.create(environmentsSettings);
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class EnvironmentsClient implements BackgroundResource {
+ private final EnvironmentsSettings settings;
+ private final EnvironmentsStub stub;
+
+ /** Constructs an instance of EnvironmentsClient with default settings. */
+ public static final EnvironmentsClient create() throws IOException {
+ return create(EnvironmentsSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of EnvironmentsClient, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final EnvironmentsClient create(EnvironmentsSettings settings) throws IOException {
+ return new EnvironmentsClient(settings);
+ }
+
+ /**
+ * Constructs an instance of EnvironmentsClient, using the given stub for making calls. This is
+ * for advanced usage - prefer to use EnvironmentsSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final EnvironmentsClient create(EnvironmentsStub stub) {
+ return new EnvironmentsClient(stub);
+ }
+
+ /**
+ * Constructs an instance of EnvironmentsClient, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected EnvironmentsClient(EnvironmentsSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((EnvironmentsStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected EnvironmentsClient(EnvironmentsStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final EnvironmentsSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public EnvironmentsStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the list of all non-draft environments of the specified agent.
+ *
+ * Sample code:
+ *
+ *
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (Environment element : environmentsClient.listEnvironments(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequest request) {
+ return listEnvironmentsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the list of all non-draft environments of the specified agent.
+ *
+ * Sample code:
+ *
+ *
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListEnvironmentsPagedResponse> future = environmentsClient.listEnvironmentsPagedCallable().futureCall(request);
+ * // Do something
+ * for (Environment element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ listEnvironmentsPagedCallable() {
+ return stub.listEnvironmentsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the list of all non-draft environments of the specified agent.
+ *
+ * Sample code:
+ *
+ *
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListEnvironmentsResponse response = environmentsClient.listEnvironmentsCallable().call(request);
+ * for (Environment element : response.getEnvironmentsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ listEnvironmentsCallable() {
+ return stub.listEnvironmentsCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+
+ public static class ListEnvironmentsPagedResponse
+ extends AbstractPagedListResponse<
+ ListEnvironmentsRequest,
+ ListEnvironmentsResponse,
+ Environment,
+ ListEnvironmentsPage,
+ ListEnvironmentsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListEnvironmentsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ new ApiFunction() {
+ @Override
+ public ListEnvironmentsPagedResponse apply(ListEnvironmentsPage input) {
+ return new ListEnvironmentsPagedResponse(input);
+ }
+ },
+ MoreExecutors.directExecutor());
+ }
+
+ private ListEnvironmentsPagedResponse(ListEnvironmentsPage page) {
+ super(page, ListEnvironmentsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListEnvironmentsPage
+ extends AbstractPage<
+ ListEnvironmentsRequest, ListEnvironmentsResponse, Environment, ListEnvironmentsPage> {
+
+ private ListEnvironmentsPage(
+ PageContext context,
+ ListEnvironmentsResponse response) {
+ super(context, response);
+ }
+
+ private static ListEnvironmentsPage createEmptyPage() {
+ return new ListEnvironmentsPage(null, null);
+ }
+
+ @Override
+ protected ListEnvironmentsPage createPage(
+ PageContext context,
+ ListEnvironmentsResponse response) {
+ return new ListEnvironmentsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListEnvironmentsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListEnvironmentsRequest,
+ ListEnvironmentsResponse,
+ Environment,
+ ListEnvironmentsPage,
+ ListEnvironmentsFixedSizeCollection> {
+
+ private ListEnvironmentsFixedSizeCollection(
+ List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListEnvironmentsFixedSizeCollection createEmptyCollection() {
+ return new ListEnvironmentsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListEnvironmentsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListEnvironmentsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+}
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EnvironmentsSettings.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EnvironmentsSettings.java
new file mode 100644
index 000000000..8131841ea
--- /dev/null
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EnvironmentsSettings.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.dialogflow.v2;
+
+import static com.google.cloud.dialogflow.v2.EnvironmentsClient.ListEnvironmentsPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.cloud.dialogflow.v2.stub.EnvironmentsStubSettings;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Settings class to configure an instance of {@link EnvironmentsClient}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (dialogflow.googleapis.com) and default port (443) are used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of listEnvironmentsPagedCallable to 30 seconds:
+ *
+ *
+ *
+ * EnvironmentsSettings.Builder environmentsSettingsBuilder =
+ * EnvironmentsSettings.newBuilder();
+ * environmentsSettingsBuilder
+ * .listEnvironmentsSettings()
+ * .setRetrySettings(
+ * environmentsSettingsBuilder.listEnvironmentsSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * EnvironmentsSettings environmentsSettings = environmentsSettingsBuilder.build();
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class EnvironmentsSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to listEnvironments. */
+ public PagedCallSettings<
+ ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse>
+ listEnvironmentsSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).listEnvironmentsSettings();
+ }
+
+ public static final EnvironmentsSettings create(EnvironmentsStubSettings stub)
+ throws IOException {
+ return new EnvironmentsSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return EnvironmentsStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return EnvironmentsStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return EnvironmentsStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return EnvironmentsStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return EnvironmentsStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return EnvironmentsStubSettings.defaultTransportChannelProvider();
+ }
+
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return EnvironmentsStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder(ClientContext clientContext) {
+ return new Builder(clientContext);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected EnvironmentsSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for EnvironmentsSettings. */
+ public static class Builder extends ClientSettings.Builder {
+ protected Builder() throws IOException {
+ this((ClientContext) null);
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(EnvironmentsStubSettings.newBuilder(clientContext));
+ }
+
+ private static Builder createDefault() {
+ return new Builder(EnvironmentsStubSettings.newBuilder());
+ }
+
+ protected Builder(EnvironmentsSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(EnvironmentsStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ public EnvironmentsStubSettings.Builder getStubSettingsBuilder() {
+ return ((EnvironmentsStubSettings.Builder) getStubSettings());
+ }
+
+ // NEXT_MAJOR_VER: remove 'throws Exception'
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) throws Exception {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to listEnvironments. */
+ public PagedCallSettings.Builder<
+ ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse>
+ listEnvironmentsSettings() {
+ return getStubSettingsBuilder().listEnvironmentsSettings();
+ }
+
+ @Override
+ public EnvironmentsSettings build() throws IOException {
+ return new EnvironmentsSettings(this);
+ }
+ }
+}
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/IntentsClient.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/IntentsClient.java
index 3af5bb595..cefadc2ea 100644
--- a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/IntentsClient.java
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/IntentsClient.java
@@ -77,7 +77,7 @@
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
* IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
- * Intent response = intentsClient.getIntent(name);
+ * intentsClient.deleteIntent(name);
* }
*
*
@@ -197,6 +197,247 @@ public final OperationsClient getOperationsClient() {
return operationsClient;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified intent and its direct or indirect followup intents.
+ *
+ * Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
+ * intentsClient.deleteIntent(name);
+ * }
+ *
+ *
+ * @param name Required. The name of the intent to delete. If this intent has direct or indirect
+ * followup intents, we also delete them. Format: `projects/<Project
+ * ID>/agent/intents/<Intent ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteIntent(IntentName name) {
+ DeleteIntentRequest request =
+ DeleteIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteIntent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified intent and its direct or indirect followup intents.
+ *
+ * Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
+ * intentsClient.deleteIntent(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The name of the intent to delete. If this intent has direct or indirect
+ * followup intents, we also delete them. Format: `projects/<Project
+ * ID>/agent/intents/<Intent ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteIntent(String name) {
+ DeleteIntentRequest request = DeleteIntentRequest.newBuilder().setName(name).build();
+ deleteIntent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified intent and its direct or indirect followup intents.
+ *
+ * Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
+ * DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * intentsClient.deleteIntent(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteIntent(DeleteIntentRequest request) {
+ deleteIntentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified intent and its direct or indirect followup intents.
+ *
+ * Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
+ * DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = intentsClient.deleteIntentCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable deleteIntentCallable() {
+ return stub.deleteIntentCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes intents in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<Intent> intents = new ArrayList<>();
+ * intentsClient.batchDeleteIntentsAsync(parent, intents).get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the agent to delete all entities types for. Format:
+ * `projects/<Project ID>/agent`.
+ * @param intents Required. The collection of intents to delete. Only intent `name` must be filled
+ * in.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteIntentsAsync(
+ AgentName parent, List intents) {
+ BatchDeleteIntentsRequest request =
+ BatchDeleteIntentsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .addAllIntents(intents)
+ .build();
+ return batchDeleteIntentsAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes intents in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<Intent> intents = new ArrayList<>();
+ * intentsClient.batchDeleteIntentsAsync(parent.toString(), intents).get();
+ * }
+ *
+ *
+ * @param parent Required. The name of the agent to delete all entities types for. Format:
+ * `projects/<Project ID>/agent`.
+ * @param intents Required. The collection of intents to delete. Only intent `name` must be filled
+ * in.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteIntentsAsync(
+ String parent, List intents) {
+ BatchDeleteIntentsRequest request =
+ BatchDeleteIntentsRequest.newBuilder().setParent(parent).addAllIntents(intents).build();
+ return batchDeleteIntentsAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes intents in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<Intent> intents = new ArrayList<>();
+ * BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllIntents(intents)
+ * .build();
+ * intentsClient.batchDeleteIntentsAsync(request).get();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchDeleteIntentsAsync(
+ BatchDeleteIntentsRequest request) {
+ return batchDeleteIntentsOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes intents in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<Intent> intents = new ArrayList<>();
+ * BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllIntents(intents)
+ * .build();
+ * OperationFuture<Empty, Struct> future = intentsClient.batchDeleteIntentsOperationCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ batchDeleteIntentsOperationCallable() {
+ return stub.batchDeleteIntentsOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes intents in the specified agent.
+ *
+ * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
+ *
+ *
Sample code:
+ *
+ *
+ * try (IntentsClient intentsClient = IntentsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * List<Intent> intents = new ArrayList<>();
+ * BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .addAllIntents(intents)
+ * .build();
+ * ApiFuture<Operation> future = intentsClient.batchDeleteIntentsCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable batchDeleteIntentsCallable() {
+ return stub.batchDeleteIntentsCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns the list of all intents in the specified agent.
@@ -205,7 +446,7 @@ public final OperationsClient getOperationsClient() {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -216,7 +457,7 @@ public final OperationsClient getOperationsClient() {
* ID>/agent`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListIntentsPagedResponse listIntents(ProjectAgentName parent) {
+ public final ListIntentsPagedResponse listIntents(AgentName parent) {
ListIntentsRequest request =
ListIntentsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -232,7 +473,7 @@ public final ListIntentsPagedResponse listIntents(ProjectAgentName parent) {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* for (Intent element : intentsClient.listIntents(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -256,7 +497,7 @@ public final ListIntentsPagedResponse listIntents(String parent) {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* String languageCode = "";
* for (Intent element : intentsClient.listIntents(parent, languageCode).iterateAll()) {
* // doThingsWith(element);
@@ -272,7 +513,7 @@ public final ListIntentsPagedResponse listIntents(String parent) {
* data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListIntentsPagedResponse listIntents(ProjectAgentName parent, String languageCode) {
+ public final ListIntentsPagedResponse listIntents(AgentName parent, String languageCode) {
ListIntentsRequest request =
ListIntentsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -289,7 +530,7 @@ public final ListIntentsPagedResponse listIntents(ProjectAgentName parent, Strin
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* String languageCode = "";
* for (Intent element : intentsClient.listIntents(parent.toString(), languageCode).iterateAll()) {
* // doThingsWith(element);
@@ -319,7 +560,7 @@ public final ListIntentsPagedResponse listIntents(String parent, String language
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* ListIntentsRequest request = ListIntentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -344,7 +585,7 @@ public final ListIntentsPagedResponse listIntents(ListIntentsRequest request) {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* ListIntentsRequest request = ListIntentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -369,7 +610,7 @@ public final ListIntentsPagedResponse listIntents(ListIntentsRequest request) {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* ListIntentsRequest request = ListIntentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -549,7 +790,7 @@ public final UnaryCallable getIntentCallable() {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* Intent intent = Intent.newBuilder().build();
* Intent response = intentsClient.createIntent(parent, intent);
* }
@@ -560,7 +801,7 @@ public final UnaryCallable getIntentCallable() {
* @param intent Required. The intent to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Intent createIntent(ProjectAgentName parent, Intent intent) {
+ public final Intent createIntent(AgentName parent, Intent intent) {
CreateIntentRequest request =
CreateIntentRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -577,7 +818,7 @@ public final Intent createIntent(ProjectAgentName parent, Intent intent) {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* Intent intent = Intent.newBuilder().build();
* Intent response = intentsClient.createIntent(parent.toString(), intent);
* }
@@ -602,7 +843,7 @@ public final Intent createIntent(String parent, Intent intent) {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* Intent intent = Intent.newBuilder().build();
* String languageCode = "";
* Intent response = intentsClient.createIntent(parent, intent, languageCode);
@@ -618,7 +859,7 @@ public final Intent createIntent(String parent, Intent intent) {
* data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Intent createIntent(ProjectAgentName parent, Intent intent, String languageCode) {
+ public final Intent createIntent(AgentName parent, Intent intent, String languageCode) {
CreateIntentRequest request =
CreateIntentRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -636,7 +877,7 @@ public final Intent createIntent(ProjectAgentName parent, Intent intent, String
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* Intent intent = Intent.newBuilder().build();
* String languageCode = "";
* Intent response = intentsClient.createIntent(parent.toString(), intent, languageCode);
@@ -670,7 +911,7 @@ public final Intent createIntent(String parent, Intent intent, String languageCo
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* Intent intent = Intent.newBuilder().build();
* CreateIntentRequest request = CreateIntentRequest.newBuilder()
* .setParent(parent.toString())
@@ -695,7 +936,7 @@ public final Intent createIntent(CreateIntentRequest request) {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* Intent intent = Intent.newBuilder().build();
* CreateIntentRequest request = CreateIntentRequest.newBuilder()
* .setParent(parent.toString())
@@ -818,94 +1059,142 @@ public final UnaryCallable updateIntentCallable() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes the specified intent and its direct or indirect followup intents.
+ * Updates/Creates multiple intents in the specified agent.
+ *
+ * Operation <response:
+ * [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
*
*
Sample code:
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
- * intentsClient.deleteIntent(name);
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * String intentBatchUri = "";
+ * BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(parent, intentBatchUri).get();
* }
*
*
- * @param name Required. The name of the intent to delete. If this intent has direct or indirect
- * followup intents, we also delete them. Format: `projects/<Project
- * ID>/agent/intents/<Intent ID>`.
+ * @param parent Required. The name of the agent to update or create intents in. Format:
+ * `projects/<Project ID>/agent`.
+ * @param intentBatchUri The URI to a Google Cloud Storage file containing intents to update or
+ * create. The file format can either be a serialized proto (of IntentBatch type) or JSON
+ * object. Note: The URI must start with "gs://".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteIntent(IntentName name) {
- DeleteIntentRequest request =
- DeleteIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteIntent(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchUpdateIntentsAsync(
+ AgentName parent, String intentBatchUri) {
+ BatchUpdateIntentsRequest request =
+ BatchUpdateIntentsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setIntentBatchUri(intentBatchUri)
+ .build();
+ return batchUpdateIntentsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes the specified intent and its direct or indirect followup intents.
+ * Updates/Creates multiple intents in the specified agent.
+ *
+ * Operation <response:
+ * [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
*
*
Sample code:
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
- * intentsClient.deleteIntent(name.toString());
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * String intentBatchUri = "";
+ * BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(parent.toString(), intentBatchUri).get();
* }
*
*
- * @param name Required. The name of the intent to delete. If this intent has direct or indirect
- * followup intents, we also delete them. Format: `projects/<Project
- * ID>/agent/intents/<Intent ID>`.
+ * @param parent Required. The name of the agent to update or create intents in. Format:
+ * `projects/<Project ID>/agent`.
+ * @param intentBatchUri The URI to a Google Cloud Storage file containing intents to update or
+ * create. The file format can either be a serialized proto (of IntentBatch type) or JSON
+ * object. Note: The URI must start with "gs://".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteIntent(String name) {
- DeleteIntentRequest request = DeleteIntentRequest.newBuilder().setName(name).build();
- deleteIntent(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchUpdateIntentsAsync(
+ String parent, String intentBatchUri) {
+ BatchUpdateIntentsRequest request =
+ BatchUpdateIntentsRequest.newBuilder()
+ .setParent(parent)
+ .setIntentBatchUri(intentBatchUri)
+ .build();
+ return batchUpdateIntentsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes the specified intent and its direct or indirect followup intents.
+ * Updates/Creates multiple intents in the specified agent.
+ *
+ * Operation <response:
+ * [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
*
*
Sample code:
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
- * DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * intentsClient.deleteIntent(request);
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * IntentBatch intentBatchInline = IntentBatch.newBuilder().build();
+ * BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(parent, intentBatchInline).get();
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param parent Required. The name of the agent to update or create intents in. Format:
+ * `projects/<Project ID>/agent`.
+ * @param intentBatchInline The collection of intents to update or create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteIntent(DeleteIntentRequest request) {
- deleteIntentCallable().call(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchUpdateIntentsAsync(
+ AgentName parent, IntentBatch intentBatchInline) {
+ BatchUpdateIntentsRequest request =
+ BatchUpdateIntentsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setIntentBatchInline(intentBatchInline)
+ .build();
+ return batchUpdateIntentsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes the specified intent and its direct or indirect followup intents.
+ * Updates/Creates multiple intents in the specified agent.
+ *
+ * Operation <response:
+ * [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
*
*
Sample code:
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
- * DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = intentsClient.deleteIntentCallable().futureCall(request);
- * // Do something
- * future.get();
+ * AgentName parent = AgentName.of("[PROJECT]");
+ * IntentBatch intentBatchInline = IntentBatch.newBuilder().build();
+ * BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(parent.toString(), intentBatchInline).get();
* }
*
+ *
+ * @param parent Required. The name of the agent to update or create intents in. Format:
+ * `projects/<Project ID>/agent`.
+ * @param intentBatchInline The collection of intents to update or create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable deleteIntentCallable() {
- return stub.deleteIntentCallable();
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture batchUpdateIntentsAsync(
+ String parent, IntentBatch intentBatchInline) {
+ BatchUpdateIntentsRequest request =
+ BatchUpdateIntentsRequest.newBuilder()
+ .setParent(parent)
+ .setIntentBatchInline(intentBatchInline)
+ .build();
+ return batchUpdateIntentsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -919,7 +1208,7 @@ public final UnaryCallable deleteIntentCallable() {
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* BatchUpdateIntentsRequest request = BatchUpdateIntentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -948,7 +1237,7 @@ public final OperationFuture batchUpdateInte
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* BatchUpdateIntentsRequest request = BatchUpdateIntentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -975,7 +1264,7 @@ public final OperationFuture batchUpdateInte
*
*
* try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
+ * AgentName parent = AgentName.of("[PROJECT]");
* BatchUpdateIntentsRequest request = BatchUpdateIntentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -989,155 +1278,6 @@ public final UnaryCallable batchUpdateInte
return stub.batchUpdateIntentsCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes intents in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<Intent> intents = new ArrayList<>();
- * intentsClient.batchDeleteIntentsAsync(parent, intents).get();
- * }
- *
- *
- * @param parent Required. The name of the agent to delete all entities types for. Format:
- * `projects/<Project ID>/agent`.
- * @param intents Required. The collection of intents to delete. Only intent `name` must be filled
- * in.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteIntentsAsync(
- ProjectAgentName parent, List intents) {
- BatchDeleteIntentsRequest request =
- BatchDeleteIntentsRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .addAllIntents(intents)
- .build();
- return batchDeleteIntentsAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes intents in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<Intent> intents = new ArrayList<>();
- * intentsClient.batchDeleteIntentsAsync(parent.toString(), intents).get();
- * }
- *
- *
- * @param parent Required. The name of the agent to delete all entities types for. Format:
- * `projects/<Project ID>/agent`.
- * @param intents Required. The collection of intents to delete. Only intent `name` must be filled
- * in.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteIntentsAsync(
- String parent, List intents) {
- BatchDeleteIntentsRequest request =
- BatchDeleteIntentsRequest.newBuilder().setParent(parent).addAllIntents(intents).build();
- return batchDeleteIntentsAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes intents in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<Intent> intents = new ArrayList<>();
- * BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllIntents(intents)
- * .build();
- * intentsClient.batchDeleteIntentsAsync(request).get();
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture batchDeleteIntentsAsync(
- BatchDeleteIntentsRequest request) {
- return batchDeleteIntentsOperationCallable().futureCall(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes intents in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<Intent> intents = new ArrayList<>();
- * BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllIntents(intents)
- * .build();
- * OperationFuture<Empty, Struct> future = intentsClient.batchDeleteIntentsOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- batchDeleteIntentsOperationCallable() {
- return stub.batchDeleteIntentsOperationCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes intents in the specified agent.
- *
- * Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
- *
- *
Sample code:
- *
- *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
- * List<Intent> intents = new ArrayList<>();
- * BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .addAllIntents(intents)
- * .build();
- * ApiFuture<Operation> future = intentsClient.batchDeleteIntentsCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable batchDeleteIntentsCallable() {
- return stub.batchDeleteIntentsCallable();
- }
-
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/IntentsSettings.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/IntentsSettings.java
index fec6b7a98..7d4692ec9 100644
--- a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/IntentsSettings.java
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/IntentsSettings.java
@@ -52,16 +52,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of getIntent to 30 seconds:
+ *
For example, to set the total timeout of deleteIntent to 30 seconds:
*
*
*
* IntentsSettings.Builder intentsSettingsBuilder =
* IntentsSettings.newBuilder();
* intentsSettingsBuilder
- * .getIntentSettings()
+ * .deleteIntentSettings()
* .setRetrySettings(
- * intentsSettingsBuilder.getIntentSettings().getRetrySettings().toBuilder()
+ * intentsSettingsBuilder.deleteIntentSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* IntentsSettings intentsSettings = intentsSettingsBuilder.build();
@@ -71,6 +71,24 @@
@Generated("by gapic-generator")
@BetaApi
public class IntentsSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to deleteIntent. */
+ public UnaryCallSettings deleteIntentSettings() {
+ return ((IntentsStubSettings) getStubSettings()).deleteIntentSettings();
+ }
+
+ /** Returns the object with the settings used for calls to batchDeleteIntents. */
+ public UnaryCallSettings batchDeleteIntentsSettings() {
+ return ((IntentsStubSettings) getStubSettings()).batchDeleteIntentsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to batchDeleteIntents. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings
+ batchDeleteIntentsOperationSettings() {
+ return ((IntentsStubSettings) getStubSettings()).batchDeleteIntentsOperationSettings();
+ }
+
/** Returns the object with the settings used for calls to listIntents. */
public PagedCallSettings
listIntentsSettings() {
@@ -92,11 +110,6 @@ public UnaryCallSettings updateIntentSettings() {
return ((IntentsStubSettings) getStubSettings()).updateIntentSettings();
}
- /** Returns the object with the settings used for calls to deleteIntent. */
- public UnaryCallSettings deleteIntentSettings() {
- return ((IntentsStubSettings) getStubSettings()).deleteIntentSettings();
- }
-
/** Returns the object with the settings used for calls to batchUpdateIntents. */
public UnaryCallSettings batchUpdateIntentsSettings() {
return ((IntentsStubSettings) getStubSettings()).batchUpdateIntentsSettings();
@@ -110,19 +123,6 @@ public UnaryCallSettings batchUpdateIntent
return ((IntentsStubSettings) getStubSettings()).batchUpdateIntentsOperationSettings();
}
- /** Returns the object with the settings used for calls to batchDeleteIntents. */
- public UnaryCallSettings batchDeleteIntentsSettings() {
- return ((IntentsStubSettings) getStubSettings()).batchDeleteIntentsSettings();
- }
-
- /** Returns the object with the settings used for calls to batchDeleteIntents. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings
- batchDeleteIntentsOperationSettings() {
- return ((IntentsStubSettings) getStubSettings()).batchDeleteIntentsOperationSettings();
- }
-
public static final IntentsSettings create(IntentsStubSettings stub) throws IOException {
return new IntentsSettings.Builder(stub.toBuilder()).build();
}
@@ -219,6 +219,25 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to deleteIntent. */
+ public UnaryCallSettings.Builder deleteIntentSettings() {
+ return getStubSettingsBuilder().deleteIntentSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to batchDeleteIntents. */
+ public UnaryCallSettings.Builder
+ batchDeleteIntentsSettings() {
+ return getStubSettingsBuilder().batchDeleteIntentsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to batchDeleteIntents. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ batchDeleteIntentsOperationSettings() {
+ return getStubSettingsBuilder().batchDeleteIntentsOperationSettings();
+ }
+
/** Returns the builder for the settings used for calls to listIntents. */
public PagedCallSettings.Builder<
ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse>
@@ -241,11 +260,6 @@ public UnaryCallSettings.Builder updateIntentSettin
return getStubSettingsBuilder().updateIntentSettings();
}
- /** Returns the builder for the settings used for calls to deleteIntent. */
- public UnaryCallSettings.Builder deleteIntentSettings() {
- return getStubSettingsBuilder().deleteIntentSettings();
- }
-
/** Returns the builder for the settings used for calls to batchUpdateIntents. */
public UnaryCallSettings.Builder
batchUpdateIntentsSettings() {
@@ -261,20 +275,6 @@ public UnaryCallSettings.Builder deleteIntentSetting
return getStubSettingsBuilder().batchUpdateIntentsOperationSettings();
}
- /** Returns the builder for the settings used for calls to batchDeleteIntents. */
- public UnaryCallSettings.Builder
- batchDeleteIntentsSettings() {
- return getStubSettingsBuilder().batchDeleteIntentsSettings();
- }
-
- /** Returns the builder for the settings used for calls to batchDeleteIntents. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings.Builder
- batchDeleteIntentsOperationSettings() {
- return getStubSettingsBuilder().batchDeleteIntentsOperationSettings();
- }
-
@Override
public IntentsSettings build() throws IOException {
return new IntentsSettings(this);
diff --git a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/SessionEntityTypesClient.java b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/SessionEntityTypesClient.java
index 4f92e6e9f..7b7f6e8f6 100644
--- a/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/SessionEntityTypesClient.java
+++ b/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/SessionEntityTypesClient.java
@@ -29,6 +29,7 @@
import com.google.cloud.dialogflow.v2.stub.SessionEntityTypesStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.Empty;
+import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -56,8 +57,8 @@
*
*
* try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.of("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
- * SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
+ * SessionEntityTypeName name = SessionEntityTypeName.ofProjectSessionEntityTypeName("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
+ * sessionEntityTypesClient.deleteSessionEntityType(name);
* }
*
*
@@ -167,6 +168,120 @@ public SessionEntityTypesStub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified session entity type.
+ *
+ * This method doesn't work with Google Assistant integration. Contact Dialogflow support if
+ * you need to use session entities with Google Assistant integration.
+ *
+ *
Sample code:
+ *
+ *
+ * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+ * SessionEntityTypeName name = SessionEntityTypeName.ofProjectSessionEntityTypeName("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
+ * sessionEntityTypesClient.deleteSessionEntityType(name);
+ * }
+ *
+ *
+ * @param name Required. The name of the entity type to delete. Format: `projects/<Project
+ * ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or
+ * `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
+ * ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If
+ * `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is
+ * not specified, we assume default '-' user.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteSessionEntityType(SessionEntityTypeName name) {
+ DeleteSessionEntityTypeRequest request =
+ DeleteSessionEntityTypeRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteSessionEntityType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified session entity type.
+ *
+ * This method doesn't work with Google Assistant integration. Contact Dialogflow support if
+ * you need to use session entities with Google Assistant integration.
+ *
+ *
Sample code:
+ *
+ *
+ * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+ * SessionEntityTypeName name = SessionEntityTypeName.ofProjectSessionEntityTypeName("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
+ * sessionEntityTypesClient.deleteSessionEntityType(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The name of the entity type to delete. Format: `projects/<Project
+ * ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or
+ * `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
+ * ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If
+ * `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is
+ * not specified, we assume default '-' user.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteSessionEntityType(String name) {
+ DeleteSessionEntityTypeRequest request =
+ DeleteSessionEntityTypeRequest.newBuilder().setName(name).build();
+ deleteSessionEntityType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified session entity type.
+ *
+ * This method doesn't work with Google Assistant integration. Contact Dialogflow support if
+ * you need to use session entities with Google Assistant integration.
+ *
+ *
Sample code:
+ *
+ *
+ * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+ * SessionEntityTypeName name = SessionEntityTypeName.ofProjectSessionEntityTypeName("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
+ * DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * sessionEntityTypesClient.deleteSessionEntityType(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteSessionEntityType(DeleteSessionEntityTypeRequest request) {
+ deleteSessionEntityTypeCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified session entity type.
+ *
+ * This method doesn't work with Google Assistant integration. Contact Dialogflow support if
+ * you need to use session entities with Google Assistant integration.
+ *
+ *
Sample code:
+ *
+ *
+ * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
+ * SessionEntityTypeName name = SessionEntityTypeName.ofProjectSessionEntityTypeName("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
+ * DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = sessionEntityTypesClient.deleteSessionEntityTypeCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable
+ deleteSessionEntityTypeCallable() {
+ return stub.deleteSessionEntityTypeCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns the list of all session entity types in the specified session.
@@ -178,7 +293,7 @@ public SessionEntityTypesStub getStub() {
*
*
* try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.of("[PROJECT]", "[SESSION]");
+ * SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
* for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -211,7 +326,7 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(SessionN
*
*