diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java index d9a48bfed..883f81f71 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -40,23 +41,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent]. * *
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 (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Agent response = agentsClient.getAgent(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the agentsClient object to clean up resources such as + *
Note: close() needs to be called on the AgentsClient 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 @@ -84,28 +76,24 @@ * *
To customize credentials: * - *
- *
+ * {@code
* AgentsSettings agentsSettings =
* AgentsSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * AgentsClient agentsClient =
- * AgentsClient.create(agentsSettings);
- *
- *
+ * AgentsClient agentsClient = AgentsClient.create(agentsSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
- * AgentsSettings agentsSettings =
- * AgentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AgentsClient agentsClient =
- * AgentsClient.create(agentsSettings);
- *
- *
+ * {@code + * AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(myEndpoint).build(); + * AgentsClient agentsClient = AgentsClient.create(agentsSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class AgentsClient implements BackgroundResource { private final AgentsSettings settings; @@ -127,7 +115,7 @@ public static final AgentsClient create(AgentsSettings settings) throws IOExcept /** * Constructs an instance of AgentsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use AgentsSettings}. + * advanced usage - prefer using create(AgentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AgentsClient create(AgentsStub stub) { @@ -164,27 +152,14 @@ public AgentsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * - *
Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Agent element : agentsClient.listAgents(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The location to list all agents for. Format: `projects/<Project
* ID>/locations/<Location ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -195,21 +170,10 @@ public final ListAgentsPagedResponse listAgents(LocationName parent) {
return listAgents(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all agents in the specified location.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (Agent element : agentsClient.listAgents(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The location to list all agents for. Format: `projects/<Project
* ID>/locations/<Location ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -219,24 +183,10 @@ public final ListAgentsPagedResponse listAgents(String parent) {
return listAgents(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all agents in the specified location.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListAgentsRequest request = ListAgentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Agent element : agentsClient.listAgents(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
*/
@@ -244,74 +194,30 @@ public final ListAgentsPagedResponse listAgents(ListAgentsRequest request) {
return listAgentsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all agents in the specified location.
*
* Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListAgentsRequest request = ListAgentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListAgentsPagedResponse> future = agentsClient.listAgentsPagedCallable().futureCall(request);
- * // Do something
- * for (Agent element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListAgentsRequest request = ListAgentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListAgentsResponse response = agentsClient.listAgentsCallable().call(request);
- * for (Agent element : response.getAgentsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Agent response = agentsClient.getAgent(name);
- * }
- *
- *
* @param name Required. The name of the agent. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -322,19 +228,10 @@ public final Agent getAgent(AgentName name) {
return getAgent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified agent.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Agent response = agentsClient.getAgent(name.toString());
- * }
- *
- *
* @param name Required. The name of the agent. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -344,22 +241,10 @@ public final Agent getAgent(String name) {
return getAgent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified agent.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * GetAgentRequest request = GetAgentRequest.newBuilder()
- * .setName(name.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
*/
@@ -367,42 +252,20 @@ public final Agent getAgent(GetAgentRequest request) {
return getAgentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified agent.
*
* Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * GetAgentRequest request = GetAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Agent> future = agentsClient.getAgentCallable().futureCall(request);
- * // Do something
- * Agent response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Agent agent = Agent.newBuilder().build();
- * Agent response = agentsClient.createAgent(parent, agent);
- * }
- *
- *
* @param parent Required. The location to create a agent for. Format: `projects/<Project
* ID>/locations/<Location ID>`.
* @param agent Required. The agent to create.
@@ -417,20 +280,10 @@ public final Agent createAgent(LocationName parent, Agent agent) {
return createAgent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an agent in the specified location.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Agent agent = Agent.newBuilder().build();
- * Agent response = agentsClient.createAgent(parent.toString(), agent);
- * }
- *
- *
* @param parent Required. The location to create a agent for. Format: `projects/<Project
* ID>/locations/<Location ID>`.
* @param agent Required. The agent to create.
@@ -442,24 +295,10 @@ public final Agent createAgent(String parent, Agent agent) {
return createAgent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an agent in the specified location.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Agent agent = Agent.newBuilder().build();
- * CreateAgentRequest request = CreateAgentRequest.newBuilder()
- * .setParent(parent.toString())
- * .setAgent(agent)
- * .build();
- * Agent response = agentsClient.createAgent(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
*/
@@ -467,44 +306,20 @@ public final Agent createAgent(CreateAgentRequest request) {
return createAgentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an agent in the specified location.
*
* Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * Agent agent = Agent.newBuilder().build();
- * CreateAgentRequest request = CreateAgentRequest.newBuilder()
- * .setParent(parent.toString())
- * .setAgent(agent)
- * .build();
- * ApiFuture<Agent> future = agentsClient.createAgentCallable().futureCall(request);
- * // Do something
- * Agent response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * Agent agent = Agent.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Agent response = agentsClient.updateAgent(agent, updateMask);
- * }
- *
- *
* @param agent Required. The agent to update.
* @param updateMask The mask to control which fields get updated. If the mask is not present, all
* fields will be updated.
@@ -516,22 +331,10 @@ public final Agent updateAgent(Agent agent, FieldMask updateMask) {
return updateAgent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified agent.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * Agent agent = Agent.newBuilder().build();
- * UpdateAgentRequest request = UpdateAgentRequest.newBuilder()
- * .setAgent(agent)
- * .build();
- * Agent response = agentsClient.updateAgent(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
*/
@@ -539,41 +342,20 @@ public final Agent updateAgent(UpdateAgentRequest request) {
return updateAgentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified agent.
*
* Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * Agent agent = Agent.newBuilder().build();
- * UpdateAgentRequest request = UpdateAgentRequest.newBuilder()
- * .setAgent(agent)
- * .build();
- * ApiFuture<Agent> future = agentsClient.updateAgentCallable().futureCall(request);
- * // Do something
- * Agent response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * agentsClient.deleteAgent(name);
- * }
- *
- *
* @param name Required. The name of the agent to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -584,19 +366,10 @@ public final void deleteAgent(AgentName name) {
deleteAgent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified agent.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * agentsClient.deleteAgent(name.toString());
- * }
- *
- *
* @param name Required. The name of the agent to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -606,22 +379,10 @@ public final void deleteAgent(String name) {
deleteAgent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified agent.
*
- * Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * DeleteAgentRequest request = DeleteAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * agentsClient.deleteAgent(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
*/
@@ -629,129 +390,64 @@ public final void deleteAgent(DeleteAgentRequest request) {
deleteAgentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified agent.
*
* Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * DeleteAgentRequest request = DeleteAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = agentsClient.deleteAgentCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ExportAgentRequest request = ExportAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ExportAgentResponse response = agentsClient.exportAgentAsync(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 OperationFutureSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ExportAgentRequest request = ExportAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<ExportAgentResponse, Struct> future = agentsClient.exportAgentOperationCallable().futureCall(request);
- * // Do something
- * ExportAgentResponse response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ExportAgentRequest request = ExportAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = agentsClient.exportAgentCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableReplaces the current agent with a new one. Note that all existing resources in agent (e.g. * intents, entity types, flows) will be removed. * - *
Sample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * agentsClient.restoreAgentAsync(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 OperationFutureSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * 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 OperationCallableSample code: - * - *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = agentsClient.restoreAgentCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getAgent to 30 seconds: * - *
- *
- * AgentsSettings.Builder agentsSettingsBuilder =
- * AgentsSettings.newBuilder();
+ * {@code
+ * AgentsSettings.Builder agentsSettingsBuilder = AgentsSettings.newBuilder();
* agentsSettingsBuilder
* .getAgentSettings()
* .setRetrySettings(
- * agentsSettingsBuilder.getAgentSettings().getRetrySettings().toBuilder()
+ * agentsSettingsBuilder
+ * .getAgentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AgentsSettings agentsSettings = agentsSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class AgentsSettings extends ClientSettingsThis 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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * EntityType response = entityTypesClient.getEntityType(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the entityTypesClient object to clean up resources such as + *
Note: close() needs to be called on the EntityTypesClient 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 @@ -80,28 +72,25 @@ * *
To customize credentials: * - *
- *
+ * {@code
* EntityTypesSettings entityTypesSettings =
* EntityTypesSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * EntityTypesClient entityTypesClient =
- * EntityTypesClient.create(entityTypesSettings);
- *
- *
+ * EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* EntityTypesSettings entityTypesSettings =
* EntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
- * EntityTypesClient entityTypesClient =
- * EntityTypesClient.create(entityTypesSettings);
- *
- *
+ * EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class EntityTypesClient implements BackgroundResource { private final EntityTypesSettings settings; @@ -122,7 +111,7 @@ public static final EntityTypesClient create(EntityTypesSettings settings) throw /** * Constructs an instance of EntityTypesClient, using the given stub for making calls. This is for - * advanced usage - prefer to use EntityTypesSettings}. + * advanced usage - prefer using create(EntityTypesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final EntityTypesClient create(EntityTypesStub stub) { @@ -154,21 +143,10 @@ public EntityTypesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * - *
Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The agent to list all entity types for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -181,21 +159,10 @@ public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) {
return listEntityTypes(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (EntityType element : entityTypesClient.listEntityTypes(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The agent to list all entity types for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -205,24 +172,10 @@ public final ListEntityTypesPagedResponse listEntityTypes(String parent) {
return listEntityTypes(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (EntityType element : entityTypesClient.listEntityTypes(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
*/
@@ -230,76 +183,32 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest
return listEntityTypesPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListEntityTypesPagedResponse> future = entityTypesClient.listEntityTypesPagedCallable().futureCall(request);
- * // Do something
- * for (EntityType element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListEntityTypesResponse response = entityTypesClient.listEntityTypesCallable().call(request);
- * for (EntityType element : response.getEntityTypesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * EntityType response = entityTypesClient.getEntityType(name);
- * }
- *
- *
* @param name Required. The name of the entity type. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type
* ID>`.
@@ -311,19 +220,10 @@ public final EntityType getEntityType(EntityTypeName name) {
return getEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified entity type.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * EntityType response = entityTypesClient.getEntityType(name.toString());
- * }
- *
- *
* @param name Required. The name of the entity type. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type
* ID>`.
@@ -334,22 +234,10 @@ public final EntityType getEntityType(String name) {
return getEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified entity type.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * EntityType response = entityTypesClient.getEntityType(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
*/
@@ -357,42 +245,20 @@ public final EntityType getEntityType(GetEntityTypeRequest request) {
return getEntityTypeCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified entity type.
*
* Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<EntityType> future = entityTypesClient.getEntityTypeCallable().futureCall(request);
- * // Do something
- * EntityType response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * EntityType entityType = EntityType.newBuilder().build();
- * EntityType response = entityTypesClient.createEntityType(parent, entityType);
- * }
- *
- *
* @param parent Required. The agent to create a entity type for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param entityType Required. The entity type to create.
@@ -407,20 +273,10 @@ public final EntityType createEntityType(AgentName parent, EntityType entityType
return createEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an entity type in the specified agent.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * EntityType entityType = EntityType.newBuilder().build();
- * EntityType response = entityTypesClient.createEntityType(parent.toString(), entityType);
- * }
- *
- *
* @param parent Required. The agent to create a entity type for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param entityType Required. The entity type to create.
@@ -432,24 +288,10 @@ public final EntityType createEntityType(String parent, EntityType entityType) {
return createEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an entity type in the specified agent.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * EntityType entityType = EntityType.newBuilder().build();
- * CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
- * .setParent(parent.toString())
- * .setEntityType(entityType)
- * .build();
- * EntityType response = entityTypesClient.createEntityType(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
*/
@@ -457,44 +299,20 @@ public final EntityType createEntityType(CreateEntityTypeRequest request) {
return createEntityTypeCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an entity type in the specified agent.
*
* Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * EntityType entityType = EntityType.newBuilder().build();
- * CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
- * .setParent(parent.toString())
- * .setEntityType(entityType)
- * .build();
- * ApiFuture<EntityType> future = entityTypesClient.createEntityTypeCallable().futureCall(request);
- * // Do something
- * EntityType response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityType entityType = EntityType.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * EntityType response = entityTypesClient.updateEntityType(entityType, updateMask);
- * }
- *
- *
* @param entityType Required. The entity type to update.
* @param updateMask The mask to control which fields get updated.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -508,22 +326,10 @@ public final EntityType updateEntityType(EntityType entityType, FieldMask update
return updateEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified entity type.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityType entityType = EntityType.newBuilder().build();
- * UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
- * .setEntityType(entityType)
- * .build();
- * EntityType response = entityTypesClient.updateEntityType(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
*/
@@ -531,41 +337,20 @@ public final EntityType updateEntityType(UpdateEntityTypeRequest request) {
return updateEntityTypeCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified entity type.
*
* Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityType entityType = EntityType.newBuilder().build();
- * UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
- * .setEntityType(entityType)
- * .build();
- * ApiFuture<EntityType> future = entityTypesClient.updateEntityTypeCallable().futureCall(request);
- * // Do something
- * EntityType response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * entityTypesClient.deleteEntityType(name);
- * }
- *
- *
* @param name Required. The name of the entity type to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type
* ID>`.
@@ -577,19 +362,10 @@ public final void deleteEntityType(EntityTypeName name) {
deleteEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified entity type.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * entityTypesClient.deleteEntityType(name.toString());
- * }
- *
- *
* @param name Required. The name of the entity type to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type
* ID>`.
@@ -600,22 +376,10 @@ public final void deleteEntityType(String name) {
deleteEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified entity type.
*
- * Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[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
*/
@@ -623,23 +387,11 @@ public final void deleteEntityType(DeleteEntityTypeRequest request) {
deleteEntityTypeCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified entity type.
*
* Sample code: - * - *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = entityTypesClient.deleteEntityTypeCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getEntityType to 30 seconds: * - *
- *
- * EntityTypesSettings.Builder entityTypesSettingsBuilder =
- * EntityTypesSettings.newBuilder();
+ * {@code
+ * EntityTypesSettings.Builder entityTypesSettingsBuilder = EntityTypesSettings.newBuilder();
* entityTypesSettingsBuilder
* .getEntityTypeSettings()
* .setRetrySettings(
- * entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ * entityTypesSettingsBuilder
+ * .getEntityTypeSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* EntityTypesSettings entityTypesSettings = entityTypesSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class EntityTypesSettings extends ClientSettingsThis 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()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * Environment response = environmentsClient.getEnvironment(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the environmentsClient object to clean up resources such + *
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 @@ -85,28 +77,25 @@ * *
To customize credentials: * - *
- *
+ * {@code
* EnvironmentsSettings environmentsSettings =
* EnvironmentsSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * EnvironmentsClient environmentsClient =
- * EnvironmentsClient.create(environmentsSettings);
- *
- *
+ * EnvironmentsClient environmentsClient = EnvironmentsClient.create(environmentsSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* EnvironmentsSettings environmentsSettings =
* EnvironmentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * EnvironmentsClient environmentsClient =
- * EnvironmentsClient.create(environmentsSettings);
- *
- *
+ * EnvironmentsClient environmentsClient = EnvironmentsClient.create(environmentsSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class EnvironmentsClient implements BackgroundResource { private final EnvironmentsSettings settings; @@ -128,7 +117,7 @@ public static final EnvironmentsClient create(EnvironmentsSettings settings) thr /** * Constructs an instance of EnvironmentsClient, using the given stub for making calls. This is - * for advanced usage - prefer to use EnvironmentsSettings}. + * for advanced usage - prefer using create(EnvironmentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final EnvironmentsClient create(EnvironmentsStub stub) { @@ -166,28 +155,15 @@ public EnvironmentsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * - *
Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (Environment element : environmentsClient.listEnvironments(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to list all
* environments for. Format: `projects/<Project ID>/locations/<Location
* ID>/agents/<Agent ID>`.
@@ -201,22 +177,11 @@ public final ListEnvironmentsPagedResponse listEnvironments(AgentName parent) {
return listEnvironments(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all environments in the specified
* [Agent][google.cloud.dialogflow.cx.v3.Agent].
*
- * Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (Environment element : environmentsClient.listEnvironments(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to list all
* environments for. Format: `projects/<Project ID>/locations/<Location
* ID>/agents/<Agent ID>`.
@@ -228,25 +193,11 @@ public final ListEnvironmentsPagedResponse listEnvironments(String parent) {
return listEnvironments(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all environments in the specified
* [Agent][google.cloud.dialogflow.cx.v3.Agent].
*
- * Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * 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
*/
@@ -254,78 +205,34 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ
return listEnvironmentsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all environments in the specified
* [Agent][google.cloud.dialogflow.cx.v3.Agent].
*
* Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * 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 UnaryCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * 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 UnaryCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * Environment response = environmentsClient.getEnvironment(name);
- * }
- *
- *
* @param name Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment].
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/environments/<Environment ID>`.
@@ -337,19 +244,10 @@ public final Environment getEnvironment(EnvironmentName name) {
return getEnvironment(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
- * Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * Environment response = environmentsClient.getEnvironment(name.toString());
- * }
- *
- *
* @param name Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment].
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/environments/<Environment ID>`.
@@ -360,22 +258,10 @@ public final Environment getEnvironment(String name) {
return getEnvironment(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
- * Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Environment response = environmentsClient.getEnvironment(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
*/
@@ -383,51 +269,27 @@ public final Environment getEnvironment(GetEnvironmentRequest request) {
return getEnvironmentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
* Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Environment> future = environmentsClient.getEnvironmentCallable().futureCall(request);
- * // Do something
- * Environment response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Environment environment = Environment.newBuilder().build();
- * Environment response = environmentsClient.createEnvironmentAsync(parent, environment).get();
- * }
- *
- *
* @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an
* [Environment][google.cloud.dialogflow.cx.v3.Environment] for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param environment Required. The environment to create.
* @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 OperationFutureSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Environment environment = Environment.newBuilder().build();
- * Environment response = environmentsClient.createEnvironmentAsync(parent.toString(), environment).get();
- * }
- *
- *
* @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an
* [Environment][google.cloud.dialogflow.cx.v3.Environment] for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param environment Required. The environment to create.
* @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 OperationFutureSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Environment environment = Environment.newBuilder().build();
- * CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
- * .setParent(parent.toString())
- * .setEnvironment(environment)
- * .build();
- * Environment response = environmentsClient.createEnvironmentAsync(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 OperationFutureSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Environment environment = Environment.newBuilder().build();
- * CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
- * .setParent(parent.toString())
- * .setEnvironment(environment)
- * .build();
- * OperationFuture<Environment, Struct> future = environmentsClient.createEnvironmentOperationCallable().futureCall(request);
- * // Do something
- * Environment response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Environment environment = Environment.newBuilder().build();
- * CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
- * .setParent(parent.toString())
- * .setEnvironment(environment)
- * .build();
- * ApiFuture<Operation> future = environmentsClient.createEnvironmentCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * Environment environment = Environment.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Environment response = environmentsClient.updateEnvironmentAsync(environment, updateMask).get();
- * }
- *
- *
* @param environment Required. The environment to update.
* @param updateMask Required. The mask to control which fields get updated.
* @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 OperationFutureSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * Environment environment = Environment.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
- * .setEnvironment(environment)
- * .setUpdateMask(updateMask)
- * .build();
- * Environment response = environmentsClient.updateEnvironmentAsync(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 OperationFutureSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * Environment environment = Environment.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
- * .setEnvironment(environment)
- * .setUpdateMask(updateMask)
- * .build();
- * OperationFuture<Environment, Struct> future = environmentsClient.updateEnvironmentOperationCallable().futureCall(request);
- * // Do something
- * Environment response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * Environment environment = Environment.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
- * .setEnvironment(environment)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Operation> future = environmentsClient.updateEnvironmentCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * environmentsClient.deleteEnvironment(name);
- * }
- *
- *
* @param name Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment]
* to delete. Format: `projects/<Project ID>/locations/<Location
* ID>/agents/<Agent ID>/environments/<Environment ID>`.
@@ -683,19 +422,10 @@ public final void deleteEnvironment(EnvironmentName name) {
deleteEnvironment(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
- * Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * environmentsClient.deleteEnvironment(name.toString());
- * }
- *
- *
* @param name Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment]
* to delete. Format: `projects/<Project ID>/locations/<Location
* ID>/agents/<Agent ID>/environments/<Environment ID>`.
@@ -706,22 +436,10 @@ public final void deleteEnvironment(String name) {
deleteEnvironment(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
- * Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * environmentsClient.deleteEnvironment(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
*/
@@ -729,43 +447,20 @@ public final void deleteEnvironment(DeleteEnvironmentRequest request) {
deleteEnvironmentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
* Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = environmentsClient.deleteEnvironmentCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * for (Environment element : environmentsClient.lookupEnvironmentHistory(name).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param name Required. Resource name of the environment to look up the history for. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/environments/<Environment ID>`.
@@ -780,21 +475,10 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory(
return lookupEnvironmentHistory(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
- * Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * for (Environment element : environmentsClient.lookupEnvironmentHistory(name.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param name Required. Resource name of the environment to look up the history for. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/environments/<Environment ID>`.
@@ -806,24 +490,10 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory(Stri
return lookupEnvironmentHistory(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
- * Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * for (Environment element : environmentsClient.lookupEnvironmentHistory(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
*/
@@ -832,57 +502,22 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory(
return lookupEnvironmentHistoryPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
*
* Sample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<LookupEnvironmentHistoryPagedResponse> future = environmentsClient.lookupEnvironmentHistoryPagedCallable().futureCall(request);
- * // Do something
- * for (Environment element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * while (true) {
- * LookupEnvironmentHistoryResponse response = environmentsClient.lookupEnvironmentHistoryCallable().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 UnaryCallableFor example, to set the total timeout of getEnvironment to 30 seconds: * - *
- *
- * EnvironmentsSettings.Builder environmentsSettingsBuilder =
- * EnvironmentsSettings.newBuilder();
+ * {@code
+ * EnvironmentsSettings.Builder environmentsSettingsBuilder = EnvironmentsSettings.newBuilder();
* environmentsSettingsBuilder
* .getEnvironmentSettings()
* .setRetrySettings(
- * environmentsSettingsBuilder.getEnvironmentSettings().getRetrySettings().toBuilder()
+ * environmentsSettingsBuilder
+ * .getEnvironmentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* EnvironmentsSettings environmentsSettings = environmentsSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class EnvironmentsSettings extends ClientSettingsThis 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 (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Flow flow = Flow.newBuilder().build();
- * Flow response = flowsClient.createFlow(parent, flow);
- * }
- *
- *
- *
- * Note: close() needs to be called on the flowsClient object to clean up resources such as + *
Note: close() needs to be called on the FlowsClient 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 @@ -85,28 +76,24 @@ * *
To customize credentials: * - *
- *
+ * {@code
* FlowsSettings flowsSettings =
* FlowsSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * FlowsClient flowsClient =
- * FlowsClient.create(flowsSettings);
- *
- *
+ * FlowsClient flowsClient = FlowsClient.create(flowsSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
- * FlowsSettings flowsSettings =
- * FlowsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * FlowsClient flowsClient =
- * FlowsClient.create(flowsSettings);
- *
- *
+ * {@code + * FlowsSettings flowsSettings = FlowsSettings.newBuilder().setEndpoint(myEndpoint).build(); + * FlowsClient flowsClient = FlowsClient.create(flowsSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class FlowsClient implements BackgroundResource { private final FlowsSettings settings; @@ -128,7 +115,7 @@ public static final FlowsClient create(FlowsSettings settings) throws IOExceptio /** * Constructs an instance of FlowsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use FlowsSettings}. + * advanced usage - prefer using create(FlowsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final FlowsClient create(FlowsStub stub) { @@ -165,26 +152,14 @@ public FlowsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * - *
Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Flow flow = Flow.newBuilder().build();
- * Flow response = flowsClient.createFlow(parent, flow);
- * }
- *
- *
* @param parent Required. The agent to create a flow for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param flow Required. The flow to create.
@@ -199,20 +174,10 @@ public final Flow createFlow(AgentName parent, Flow flow) {
return createFlow(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a flow in the specified agent.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Flow flow = Flow.newBuilder().build();
- * Flow response = flowsClient.createFlow(parent.toString(), flow);
- * }
- *
- *
* @param parent Required. The agent to create a flow for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param flow Required. The flow to create.
@@ -224,24 +189,10 @@ public final Flow createFlow(String parent, Flow flow) {
return createFlow(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a flow in the specified agent.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Flow flow = Flow.newBuilder().build();
- * CreateFlowRequest request = CreateFlowRequest.newBuilder()
- * .setParent(parent.toString())
- * .setFlow(flow)
- * .build();
- * Flow response = flowsClient.createFlow(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
*/
@@ -249,43 +200,20 @@ public final Flow createFlow(CreateFlowRequest request) {
return createFlowCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a flow in the specified agent.
*
* Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Flow flow = Flow.newBuilder().build();
- * CreateFlowRequest request = CreateFlowRequest.newBuilder()
- * .setParent(parent.toString())
- * .setFlow(flow)
- * .build();
- * ApiFuture<Flow> future = flowsClient.createFlowCallable().futureCall(request);
- * // Do something
- * Flow response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * flowsClient.deleteFlow(name);
- * }
- *
- *
* @param name Required. The name of the flow to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -296,19 +224,10 @@ public final void deleteFlow(FlowName name) {
deleteFlow(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a specified flow.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * flowsClient.deleteFlow(name.toString());
- * }
- *
- *
* @param name Required. The name of the flow to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -318,22 +237,10 @@ public final void deleteFlow(String name) {
deleteFlow(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a specified flow.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * DeleteFlowRequest request = DeleteFlowRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * flowsClient.deleteFlow(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
*/
@@ -341,43 +248,20 @@ public final void deleteFlow(DeleteFlowRequest request) {
deleteFlowCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a specified flow.
*
* Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * DeleteFlowRequest request = DeleteFlowRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = flowsClient.deleteFlowCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (Flow element : flowsClient.listFlows(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The agent containing the flows. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -388,21 +272,10 @@ public final ListFlowsPagedResponse listFlows(AgentName parent) {
return listFlows(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all flows in the specified agent.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (Flow element : flowsClient.listFlows(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The agent containing the flows. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -412,24 +285,10 @@ public final ListFlowsPagedResponse listFlows(String parent) {
return listFlows(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all flows in the specified agent.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListFlowsRequest request = ListFlowsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Flow element : flowsClient.listFlows(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
*/
@@ -437,74 +296,30 @@ public final ListFlowsPagedResponse listFlows(ListFlowsRequest request) {
return listFlowsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all flows in the specified agent.
*
* Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListFlowsRequest request = ListFlowsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListFlowsPagedResponse> future = flowsClient.listFlowsPagedCallable().futureCall(request);
- * // Do something
- * for (Flow element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListFlowsRequest request = ListFlowsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListFlowsResponse response = flowsClient.listFlowsCallable().call(request);
- * for (Flow element : response.getFlowsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Flow response = flowsClient.getFlow(name);
- * }
- *
- *
* @param name Required. The name of the flow to get. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -515,19 +330,10 @@ public final Flow getFlow(FlowName name) {
return getFlow(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified flow.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Flow response = flowsClient.getFlow(name.toString());
- * }
- *
- *
* @param name Required. The name of the flow to get. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -537,22 +343,10 @@ public final Flow getFlow(String name) {
return getFlow(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified flow.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * GetFlowRequest request = GetFlowRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Flow response = flowsClient.getFlow(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
*/
@@ -560,42 +354,20 @@ public final Flow getFlow(GetFlowRequest request) {
return getFlowCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified flow.
*
* Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * GetFlowRequest request = GetFlowRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Flow> future = flowsClient.getFlowCallable().futureCall(request);
- * // Do something
- * Flow response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * Flow flow = Flow.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Flow response = flowsClient.updateFlow(flow, updateMask);
- * }
- *
- *
* @param flow Required. The flow to update.
* @param updateMask Required. The mask to control which fields get updated. If `update_mask` is
* not specified, an error will be returned.
@@ -607,24 +379,10 @@ public final Flow updateFlow(Flow flow, FieldMask updateMask) {
return updateFlow(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified flow.
*
- * Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * Flow flow = Flow.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateFlowRequest request = UpdateFlowRequest.newBuilder()
- * .setFlow(flow)
- * .setUpdateMask(updateMask)
- * .build();
- * Flow response = flowsClient.updateFlow(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
*/
@@ -632,144 +390,69 @@ public final Flow updateFlow(UpdateFlowRequest request) {
return updateFlowCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified flow.
*
* Sample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * Flow flow = Flow.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateFlowRequest request = UpdateFlowRequest.newBuilder()
- * .setFlow(flow)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Flow> future = flowsClient.updateFlowCallable().futureCall(request);
- * // Do something
- * Flow response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * flowsClient.trainFlowAsync(name).get();
- * }
- *
- *
* @param name Required. The flow to train. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow 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 OperationFutureSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * flowsClient.trainFlowAsync(name.toString()).get();
- * }
- *
- *
* @param name Required. The flow to train. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow 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 OperationFutureSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * TrainFlowRequest request = TrainFlowRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * flowsClient.trainFlowAsync(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 OperationFutureSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * TrainFlowRequest request = TrainFlowRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, Struct> future = flowsClient.trainFlowOperationCallable().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 OperationCallableSample code: - * - *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * TrainFlowRequest request = TrainFlowRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = flowsClient.trainFlowCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of createFlow to 30 seconds: * - *
- *
- * FlowsSettings.Builder flowsSettingsBuilder =
- * FlowsSettings.newBuilder();
+ * {@code
+ * FlowsSettings.Builder flowsSettingsBuilder = FlowsSettings.newBuilder();
* flowsSettingsBuilder
* .createFlowSettings()
* .setRetrySettings(
- * flowsSettingsBuilder.createFlowSettings().getRetrySettings().toBuilder()
+ * flowsSettingsBuilder
+ * .createFlowSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* FlowsSettings flowsSettings = flowsSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class FlowsSettings extends ClientSettingsThis 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 (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * Intent response = intentsClient.getIntent(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the intentsClient object to clean up resources such as + *
Note: close() needs to be called on the IntentsClient 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 @@ -79,28 +71,24 @@ * *
To customize credentials: * - *
- *
+ * {@code
* IntentsSettings intentsSettings =
* IntentsSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * IntentsClient intentsClient =
- * IntentsClient.create(intentsSettings);
- *
- *
+ * IntentsClient intentsClient = IntentsClient.create(intentsSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
- * IntentsSettings intentsSettings =
- * IntentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * IntentsClient intentsClient =
- * IntentsClient.create(intentsSettings);
- *
- *
+ * {@code + * IntentsSettings intentsSettings = IntentsSettings.newBuilder().setEndpoint(myEndpoint).build(); + * IntentsClient intentsClient = IntentsClient.create(intentsSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class IntentsClient implements BackgroundResource { private final IntentsSettings settings; @@ -121,7 +109,7 @@ public static final IntentsClient create(IntentsSettings settings) throws IOExce /** * Constructs an instance of IntentsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use IntentsSettings}. + * advanced usage - prefer using create(IntentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final IntentsClient create(IntentsStub stub) { @@ -152,21 +140,10 @@ public IntentsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * - *
Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The agent to list all intents for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -179,21 +156,10 @@ public final ListIntentsPagedResponse listIntents(AgentName parent) {
return listIntents(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all intents in the specified agent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (Intent element : intentsClient.listIntents(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The agent to list all intents for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -203,24 +169,10 @@ public final ListIntentsPagedResponse listIntents(String parent) {
return listIntents(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all intents in the specified agent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListIntentsRequest request = ListIntentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Intent element : intentsClient.listIntents(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
*/
@@ -228,75 +180,31 @@ public final ListIntentsPagedResponse listIntents(ListIntentsRequest request) {
return listIntentsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all intents in the specified agent.
*
* Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListIntentsRequest request = ListIntentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListIntentsPagedResponse> future = intentsClient.listIntentsPagedCallable().futureCall(request);
- * // Do something
- * for (Intent element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListIntentsRequest request = ListIntentsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListIntentsResponse response = intentsClient.listIntentsCallable().call(request);
- * for (Intent element : response.getIntentsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * Intent response = intentsClient.getIntent(name);
- * }
- *
- *
* @param name Required. The name of the intent. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -307,19 +215,10 @@ public final Intent getIntent(IntentName name) {
return getIntent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified intent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * Intent response = intentsClient.getIntent(name.toString());
- * }
- *
- *
* @param name Required. The name of the intent. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -329,22 +228,10 @@ public final Intent getIntent(String name) {
return getIntent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified intent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * GetIntentRequest request = GetIntentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Intent response = intentsClient.getIntent(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
*/
@@ -352,42 +239,20 @@ public final Intent getIntent(GetIntentRequest request) {
return getIntentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified intent.
*
* Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * GetIntentRequest request = GetIntentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Intent> future = intentsClient.getIntentCallable().futureCall(request);
- * // Do something
- * Intent response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Intent intent = Intent.newBuilder().build();
- * Intent response = intentsClient.createIntent(parent, intent);
- * }
- *
- *
* @param parent Required. The agent to create an intent for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param intent Required. The intent to create.
@@ -402,20 +267,10 @@ public final Intent createIntent(AgentName parent, Intent intent) {
return createIntent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an intent in the specified agent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Intent intent = Intent.newBuilder().build();
- * Intent response = intentsClient.createIntent(parent.toString(), intent);
- * }
- *
- *
* @param parent Required. The agent to create an intent for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param intent Required. The intent to create.
@@ -427,24 +282,10 @@ public final Intent createIntent(String parent, Intent intent) {
return createIntent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an intent in the specified agent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Intent intent = Intent.newBuilder().build();
- * CreateIntentRequest request = CreateIntentRequest.newBuilder()
- * .setParent(parent.toString())
- * .setIntent(intent)
- * .build();
- * Intent response = intentsClient.createIntent(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
*/
@@ -452,44 +293,20 @@ public final Intent createIntent(CreateIntentRequest request) {
return createIntentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an intent in the specified agent.
*
* Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Intent intent = Intent.newBuilder().build();
- * CreateIntentRequest request = CreateIntentRequest.newBuilder()
- * .setParent(parent.toString())
- * .setIntent(intent)
- * .build();
- * ApiFuture<Intent> future = intentsClient.createIntentCallable().futureCall(request);
- * // Do something
- * Intent response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * Intent intent = Intent.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Intent response = intentsClient.updateIntent(intent, updateMask);
- * }
- *
- *
* @param intent Required. The intent to update.
* @param updateMask The mask to control which fields get updated. If the mask is not present, all
* fields will be updated.
@@ -501,22 +318,10 @@ public final Intent updateIntent(Intent intent, FieldMask updateMask) {
return updateIntent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified intent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * Intent intent = Intent.newBuilder().build();
- * UpdateIntentRequest request = UpdateIntentRequest.newBuilder()
- * .setIntent(intent)
- * .build();
- * Intent response = intentsClient.updateIntent(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
*/
@@ -524,41 +329,20 @@ public final Intent updateIntent(UpdateIntentRequest request) {
return updateIntentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified intent.
*
* Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * Intent intent = Intent.newBuilder().build();
- * UpdateIntentRequest request = UpdateIntentRequest.newBuilder()
- * .setIntent(intent)
- * .build();
- * ApiFuture<Intent> future = intentsClient.updateIntentCallable().futureCall(request);
- * // Do something
- * Intent response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * intentsClient.deleteIntent(name);
- * }
- *
- *
* @param name Required. The name of the intent to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -569,19 +353,10 @@ public final void deleteIntent(IntentName name) {
deleteIntent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified intent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * intentsClient.deleteIntent(name.toString());
- * }
- *
- *
* @param name Required. The name of the intent to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -591,22 +366,10 @@ public final void deleteIntent(String name) {
deleteIntent(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified intent.
*
- * Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[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
*/
@@ -614,23 +377,11 @@ public final void deleteIntent(DeleteIntentRequest request) {
deleteIntentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified intent.
*
* Sample code: - * - *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = intentsClient.deleteIntentCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getIntent to 30 seconds: * - *
- *
- * IntentsSettings.Builder intentsSettingsBuilder =
- * IntentsSettings.newBuilder();
+ * {@code
+ * IntentsSettings.Builder intentsSettingsBuilder = IntentsSettings.newBuilder();
* intentsSettingsBuilder
* .getIntentSettings()
* .setRetrySettings(
- * intentsSettingsBuilder.getIntentSettings().getRetrySettings().toBuilder()
+ * intentsSettingsBuilder
+ * .getIntentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* IntentsSettings intentsSettings = intentsSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class IntentsSettings extends ClientSettingsThis 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 (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * Page response = pagesClient.getPage(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the pagesClient object to clean up resources such as + *
Note: close() needs to be called on the PagesClient 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 @@ -79,28 +71,24 @@ * *
To customize credentials: * - *
- *
+ * {@code
* PagesSettings pagesSettings =
* PagesSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * PagesClient pagesClient =
- * PagesClient.create(pagesSettings);
- *
- *
+ * PagesClient pagesClient = PagesClient.create(pagesSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
- * PagesSettings pagesSettings =
- * PagesSettings.newBuilder().setEndpoint(myEndpoint).build();
- * PagesClient pagesClient =
- * PagesClient.create(pagesSettings);
- *
- *
+ * {@code + * PagesSettings pagesSettings = PagesSettings.newBuilder().setEndpoint(myEndpoint).build(); + * PagesClient pagesClient = PagesClient.create(pagesSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class PagesClient implements BackgroundResource { private final PagesSettings settings; @@ -121,7 +109,7 @@ public static final PagesClient create(PagesSettings settings) throws IOExceptio /** * Constructs an instance of PagesClient, using the given stub for making calls. This is for - * advanced usage - prefer to use PagesSettings}. + * advanced usage - prefer using create(PagesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final PagesClient create(PagesStub stub) { @@ -152,21 +140,10 @@ public PagesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * - *
Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * for (Page element : pagesClient.listPages(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The flow to list all pages for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -177,21 +154,10 @@ public final ListPagesPagedResponse listPages(FlowName parent) {
return listPages(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all pages in the specified flow.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * for (Page element : pagesClient.listPages(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The flow to list all pages for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -201,24 +167,10 @@ public final ListPagesPagedResponse listPages(String parent) {
return listPages(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all pages in the specified flow.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListPagesRequest request = ListPagesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Page element : pagesClient.listPages(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
*/
@@ -226,74 +178,30 @@ public final ListPagesPagedResponse listPages(ListPagesRequest request) {
return listPagesPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all pages in the specified flow.
*
* Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListPagesRequest request = ListPagesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListPagesPagedResponse> future = pagesClient.listPagesPagedCallable().futureCall(request);
- * // Do something
- * for (Page element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListPagesRequest request = ListPagesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListPagesResponse response = pagesClient.listPagesCallable().call(request);
- * for (Page element : response.getPagesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * Page response = pagesClient.getPage(name);
- * }
- *
- *
* @param name Required. The name of the page. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow
* ID>/pages/<Page ID>`.
@@ -305,19 +213,10 @@ public final Page getPage(PageName name) {
return getPage(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified page.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * Page response = pagesClient.getPage(name.toString());
- * }
- *
- *
* @param name Required. The name of the page. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow
* ID>/pages/<Page ID>`.
@@ -328,22 +227,10 @@ public final Page getPage(String name) {
return getPage(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified page.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * GetPageRequest request = GetPageRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Page response = pagesClient.getPage(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
*/
@@ -351,42 +238,20 @@ public final Page getPage(GetPageRequest request) {
return getPageCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified page.
*
* Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * GetPageRequest request = GetPageRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Page> future = pagesClient.getPageCallable().futureCall(request);
- * // Do something
- * Page response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Page page = Page.newBuilder().build();
- * Page response = pagesClient.createPage(parent, page);
- * }
- *
- *
* @param parent Required. The flow to create a page for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @param page Required. The page to create.
@@ -401,20 +266,10 @@ public final Page createPage(FlowName parent, Page page) {
return createPage(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a page in the specified flow.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Page page = Page.newBuilder().build();
- * Page response = pagesClient.createPage(parent.toString(), page);
- * }
- *
- *
* @param parent Required. The flow to create a page for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @param page Required. The page to create.
@@ -426,24 +281,10 @@ public final Page createPage(String parent, Page page) {
return createPage(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a page in the specified flow.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Page page = Page.newBuilder().build();
- * CreatePageRequest request = CreatePageRequest.newBuilder()
- * .setParent(parent.toString())
- * .setPage(page)
- * .build();
- * Page response = pagesClient.createPage(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
*/
@@ -451,44 +292,20 @@ public final Page createPage(CreatePageRequest request) {
return createPageCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a page in the specified flow.
*
* Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Page page = Page.newBuilder().build();
- * CreatePageRequest request = CreatePageRequest.newBuilder()
- * .setParent(parent.toString())
- * .setPage(page)
- * .build();
- * ApiFuture<Page> future = pagesClient.createPageCallable().futureCall(request);
- * // Do something
- * Page response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * Page page = Page.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Page response = pagesClient.updatePage(page, updateMask);
- * }
- *
- *
* @param page Required. The page to update.
* @param updateMask The mask to control which fields get updated. If the mask is not present, all
* fields will be updated.
@@ -500,22 +317,10 @@ public final Page updatePage(Page page, FieldMask updateMask) {
return updatePage(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified page.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * Page page = Page.newBuilder().build();
- * UpdatePageRequest request = UpdatePageRequest.newBuilder()
- * .setPage(page)
- * .build();
- * Page response = pagesClient.updatePage(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
*/
@@ -523,41 +328,20 @@ public final Page updatePage(UpdatePageRequest request) {
return updatePageCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified page.
*
* Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * Page page = Page.newBuilder().build();
- * UpdatePageRequest request = UpdatePageRequest.newBuilder()
- * .setPage(page)
- * .build();
- * ApiFuture<Page> future = pagesClient.updatePageCallable().futureCall(request);
- * // Do something
- * Page response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * pagesClient.deletePage(name);
- * }
- *
- *
* @param name Required. The name of the page to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow
* ID>/pages/<Page ID>`.
@@ -569,19 +353,10 @@ public final void deletePage(PageName name) {
deletePage(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified page.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * pagesClient.deletePage(name.toString());
- * }
- *
- *
* @param name Required. The name of the page to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow
* ID>/pages/<Page ID>`.
@@ -592,22 +367,10 @@ public final void deletePage(String name) {
deletePage(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified page.
*
- * Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * DeletePageRequest request = DeletePageRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * pagesClient.deletePage(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
*/
@@ -615,23 +378,11 @@ public final void deletePage(DeletePageRequest request) {
deletePageCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified page.
*
* Sample code: - * - *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * DeletePageRequest request = DeletePageRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = pagesClient.deletePageCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getPage to 30 seconds: * - *
- *
- * PagesSettings.Builder pagesSettingsBuilder =
- * PagesSettings.newBuilder();
+ * {@code
+ * PagesSettings.Builder pagesSettingsBuilder = PagesSettings.newBuilder();
* pagesSettingsBuilder
* .getPageSettings()
* .setRetrySettings(
- * pagesSettingsBuilder.getPageSettings().getRetrySettings().toBuilder()
+ * pagesSettingsBuilder
+ * .getPageSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* PagesSettings pagesSettings = pagesSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class PagesSettings extends ClientSettingsThis 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 (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(parent, securitySettings);
- * }
- *
- *
- *
- * Note: close() needs to be called on the securitySettingsServiceClient object to clean up + *
Note: close() needs to be called on the SecuritySettingsServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). * @@ -81,28 +72,27 @@ * *
To customize credentials: * - *
- *
+ * {@code
* SecuritySettingsServiceSettings securitySettingsServiceSettings =
* SecuritySettingsServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* SecuritySettingsServiceClient securitySettingsServiceClient =
* SecuritySettingsServiceClient.create(securitySettingsServiceSettings);
- *
- *
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* SecuritySettingsServiceSettings securitySettingsServiceSettings =
* SecuritySettingsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* SecuritySettingsServiceClient securitySettingsServiceClient =
* SecuritySettingsServiceClient.create(securitySettingsServiceSettings);
- *
- *
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class SecuritySettingsServiceClient implements BackgroundResource { private final SecuritySettingsServiceSettings settings; @@ -124,7 +114,7 @@ public static final SecuritySettingsServiceClient create(SecuritySettingsService /** * Constructs an instance of SecuritySettingsServiceClient, using the given stub for making calls. - * This is for advanced usage - prefer to use SecuritySettingsServiceSettings}. + * This is for advanced usage - prefer using create(SecuritySettingsServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final SecuritySettingsServiceClient create(SecuritySettingsServiceStub stub) { @@ -157,20 +147,10 @@ public SecuritySettingsServiceStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create security settings in the specified location. * - *
Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(parent, securitySettings);
- * }
- *
- *
* @param parent Required. The location to create an
* [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] for. Format:
* `projects/<Project ID>/locations/<Location ID>`.
@@ -187,20 +167,10 @@ public final SecuritySettings createSecuritySettings(
return createSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create security settings in the specified location.
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(parent.toString(), securitySettings);
- * }
- *
- *
* @param parent Required. The location to create an
* [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] for. Format:
* `projects/<Project ID>/locations/<Location ID>`.
@@ -217,24 +187,10 @@ public final SecuritySettings createSecuritySettings(
return createSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create security settings in the specified location.
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * CreateSecuritySettingsRequest request = CreateSecuritySettingsRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSecuritySettings(securitySettings)
- * .build();
- * SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(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
*/
@@ -242,45 +198,22 @@ public final SecuritySettings createSecuritySettings(CreateSecuritySettingsReque
return createSecuritySettingsCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create security settings in the specified location.
*
* Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * CreateSecuritySettingsRequest request = CreateSecuritySettingsRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSecuritySettings(securitySettings)
- * .build();
- * ApiFuture<SecuritySettings> future = securitySettingsServiceClient.createSecuritySettingsCallable().futureCall(request);
- * // Do something
- * SecuritySettings response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
- * SecuritySettings response = securitySettingsServiceClient.getSecuritySettings(name);
- * }
- *
- *
* @param name Required. Resource name of the settings. Format: `projects/<Project
* ID>/locations/<Location ID>/securitySettings/<security settings ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -293,20 +226,11 @@ public final SecuritySettings getSecuritySettings(SecuritySettingsName name) {
return getSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The
* returned settings may be stale by up to 1 minute.
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
- * SecuritySettings response = securitySettingsServiceClient.getSecuritySettings(name.toString());
- * }
- *
- *
* @param name Required. Resource name of the settings. Format: `projects/<Project
* ID>/locations/<Location ID>/securitySettings/<security settings ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -317,23 +241,11 @@ public final SecuritySettings getSecuritySettings(String name) {
return getSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The
* returned settings may be stale by up to 1 minute.
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
- * GetSecuritySettingsRequest request = GetSecuritySettingsRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * SecuritySettings response = securitySettingsServiceClient.getSecuritySettings(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
*/
@@ -341,44 +253,22 @@ public final SecuritySettings getSecuritySettings(GetSecuritySettingsRequest req
return getSecuritySettingsCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The
* returned settings may be stale by up to 1 minute.
*
* Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
- * GetSecuritySettingsRequest request = GetSecuritySettingsRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<SecuritySettings> future = securitySettingsServiceClient.getSecuritySettingsCallable().futureCall(request);
- * // Do something
- * SecuritySettings response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * SecuritySettings response = securitySettingsServiceClient.updateSecuritySettings(securitySettings, updateMask);
- * }
- *
- *
* @param securitySettings Required. [SecuritySettings] object that contains values for each of
* the fields to update.
* @param updateMask Required. The mask to control which fields get updated. If the mask is not
@@ -395,24 +285,10 @@ public final SecuritySettings updateSecuritySettings(
return updateSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateSecuritySettingsRequest request = UpdateSecuritySettingsRequest.newBuilder()
- * .setSecuritySettings(securitySettings)
- * .setUpdateMask(updateMask)
- * .build();
- * SecuritySettings response = securitySettingsServiceClient.updateSecuritySettings(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
*/
@@ -420,46 +296,21 @@ public final SecuritySettings updateSecuritySettings(UpdateSecuritySettingsReque
return updateSecuritySettingsCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
*
* Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateSecuritySettingsRequest request = UpdateSecuritySettingsRequest.newBuilder()
- * .setSecuritySettings(securitySettings)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<SecuritySettings> future = securitySettingsServiceClient.updateSecuritySettingsCallable().futureCall(request);
- * // Do something
- * SecuritySettings response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (SecuritySettings element : securitySettingsServiceClient.listSecuritySettings(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The location to list all security settings for. Format:
* `projects/<Project ID>/locations/<Location ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -472,21 +323,10 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings(LocationName
return listSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all security settings in the specified location.
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * for (SecuritySettings element : securitySettingsServiceClient.listSecuritySettings(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The location to list all security settings for. Format:
* `projects/<Project ID>/locations/<Location ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -497,24 +337,10 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings(String paren
return listSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all security settings in the specified location.
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListSecuritySettingsRequest request = ListSecuritySettingsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (SecuritySettings element : securitySettingsServiceClient.listSecuritySettings(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
*/
@@ -523,76 +349,32 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings(
return listSecuritySettingsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all security settings in the specified location.
*
* Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListSecuritySettingsRequest request = ListSecuritySettingsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListSecuritySettingsPagedResponse> future = securitySettingsServiceClient.listSecuritySettingsPagedCallable().futureCall(request);
- * // Do something
- * for (SecuritySettings element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * ListSecuritySettingsRequest request = ListSecuritySettingsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListSecuritySettingsResponse response = securitySettingsServiceClient.listSecuritySettingsCallable().call(request);
- * for (SecuritySettings element : response.getSecuritySettingsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
- * securitySettingsServiceClient.deleteSecuritySettings(name);
- * }
- *
- *
* @param name Required. The name of the
* [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] to delete. Format:
* `projects/<Project ID>/locations/<Location ID>/securitySettings/<Security
@@ -607,19 +389,10 @@ public final void deleteSecuritySettings(SecuritySettingsName name) {
deleteSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
- * securitySettingsServiceClient.deleteSecuritySettings(name.toString());
- * }
- *
- *
* @param name Required. The name of the
* [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] to delete. Format:
* `projects/<Project ID>/locations/<Location ID>/securitySettings/<Security
@@ -632,22 +405,10 @@ public final void deleteSecuritySettings(String name) {
deleteSecuritySettings(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
*
- * Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
- * DeleteSecuritySettingsRequest request = DeleteSecuritySettingsRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * securitySettingsServiceClient.deleteSecuritySettings(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
*/
@@ -655,23 +416,11 @@ public final void deleteSecuritySettings(DeleteSecuritySettingsRequest request)
deleteSecuritySettingsCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
*
* Sample code: - * - *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
- * DeleteSecuritySettingsRequest request = DeleteSecuritySettingsRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = securitySettingsServiceClient.deleteSecuritySettingsCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of createSecuritySettings to 30 seconds: * - *
- *
+ * {@code
* SecuritySettingsServiceSettings.Builder securitySettingsServiceSettingsBuilder =
* SecuritySettingsServiceSettings.newBuilder();
* securitySettingsServiceSettingsBuilder
* .createSecuritySettingsSettings()
* .setRetrySettings(
- * securitySettingsServiceSettingsBuilder.createSecuritySettingsSettings().getRetrySettings().toBuilder()
+ * securitySettingsServiceSettingsBuilder
+ * .createSecuritySettingsSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
- * SecuritySettingsServiceSettings securitySettingsServiceSettings = securitySettingsServiceSettingsBuilder.build();
- *
- *
+ * SecuritySettingsServiceSettings securitySettingsServiceSettings =
+ * securitySettingsServiceSettingsBuilder.build();
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class SecuritySettingsServiceSettings
extends ClientSettingsThis 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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the sessionEntityTypesClient object to clean up resources + *
Note: close() needs to be called on the SessionEntityTypesClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * @@ -81,28 +73,27 @@ * *
To customize credentials: * - *
- *
+ * {@code
* SessionEntityTypesSettings sessionEntityTypesSettings =
* SessionEntityTypesSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* SessionEntityTypesClient sessionEntityTypesClient =
* SessionEntityTypesClient.create(sessionEntityTypesSettings);
- *
- *
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* SessionEntityTypesSettings sessionEntityTypesSettings =
* SessionEntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
* SessionEntityTypesClient sessionEntityTypesClient =
* SessionEntityTypesClient.create(sessionEntityTypesSettings);
- *
- *
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class SessionEntityTypesClient implements BackgroundResource { private final SessionEntityTypesSettings settings; @@ -124,7 +115,7 @@ public static final SessionEntityTypesClient create(SessionEntityTypesSettings s /** * Constructs an instance of SessionEntityTypesClient, using the given stub for making calls. This - * is for advanced usage - prefer to use SessionEntityTypesSettings}. + * is for advanced usage - prefer using create(SessionEntityTypesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final SessionEntityTypesClient create(SessionEntityTypesStub stub) { @@ -156,21 +147,10 @@ public SessionEntityTypesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * - *
Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The session to list all session entity types from. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
@@ -186,21 +166,10 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(SessionN
return listSessionEntityTypes(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all session entity types in the specified session.
*
- * Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The session to list all session entity types from. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
@@ -214,24 +183,10 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(String p
return listSessionEntityTypes(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all session entity types in the specified session.
*
- * Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(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
*/
@@ -240,76 +195,32 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(
return listSessionEntityTypesPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all session entity types in the specified session.
*
* Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListSessionEntityTypesPagedResponse> future = sessionEntityTypesClient.listSessionEntityTypesPagedCallable().futureCall(request);
- * // Do something
- * for (SessionEntityType element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListSessionEntityTypesResponse response = sessionEntityTypesClient.listSessionEntityTypesCallable().call(request);
- * for (SessionEntityType element : response.getSessionEntityTypesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
- * }
- *
- *
* @param name Required. The name of the session entity type. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session
* ID>/entityTypes/<Entity Type ID>` or `projects/<Project
@@ -326,19 +237,10 @@ public final SessionEntityType getSessionEntityType(SessionEntityTypeName name)
return getSessionEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified session entity type.
*
- * Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name.toString());
- * }
- *
- *
* @param name Required. The name of the session entity type. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session
* ID>/entityTypes/<Entity Type ID>` or `projects/<Project
@@ -353,22 +255,10 @@ public final SessionEntityType getSessionEntityType(String name) {
return getSessionEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified session entity type.
*
- * Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(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
*/
@@ -376,45 +266,23 @@ public final SessionEntityType getSessionEntityType(GetSessionEntityTypeRequest
return getSessionEntityTypeCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified session entity type.
*
* Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<SessionEntityType> future = sessionEntityTypesClient.getSessionEntityTypeCallable().futureCall(request);
- * // Do something
- * SessionEntityType response = future.get();
- * }
- *
*/
public final UnaryCallableIf the specified session entity type already exists, overrides the session entity type. * - *
Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
- * SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(parent, sessionEntityType);
- * }
- *
- *
* @param parent Required. The session to create a session entity type for. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
@@ -433,22 +301,12 @@ public final SessionEntityType createSessionEntityType(
return createSessionEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a session entity type.
*
* If the specified session entity type already exists, overrides the session entity type. * - *
Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
- * SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(parent.toString(), sessionEntityType);
- * }
- *
- *
* @param parent Required. The session to create a session entity type for. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
@@ -467,26 +325,12 @@ public final SessionEntityType createSessionEntityType(
return createSessionEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a session entity type.
*
* If the specified session entity type already exists, overrides the session entity type. * - *
Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
- * CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSessionEntityType(sessionEntityType)
- * .build();
- * SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(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
*/
@@ -494,47 +338,23 @@ public final SessionEntityType createSessionEntityType(CreateSessionEntityTypeRe
return createSessionEntityTypeCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a session entity type.
*
* If the specified session entity type already exists, overrides the session entity type. * *
Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
- * CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSessionEntityType(sessionEntityType)
- * .build();
- * ApiFuture<SessionEntityType> future = sessionEntityTypesClient.createSessionEntityTypeCallable().futureCall(request);
- * // Do something
- * SessionEntityType response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(sessionEntityType, updateMask);
- * }
- *
- *
* @param sessionEntityType Required. The session entity type to update. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
@@ -555,22 +375,10 @@ public final SessionEntityType updateSessionEntityType(
return updateSessionEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified session entity type.
*
- * Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
- * UpdateSessionEntityTypeRequest request = UpdateSessionEntityTypeRequest.newBuilder()
- * .setSessionEntityType(sessionEntityType)
- * .build();
- * SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(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
*/
@@ -578,42 +386,21 @@ public final SessionEntityType updateSessionEntityType(UpdateSessionEntityTypeRe
return updateSessionEntityTypeCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified session entity type.
*
* Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
- * UpdateSessionEntityTypeRequest request = UpdateSessionEntityTypeRequest.newBuilder()
- * .setSessionEntityType(sessionEntityType)
- * .build();
- * ApiFuture<SessionEntityType> future = sessionEntityTypesClient.updateSessionEntityTypeCallable().futureCall(request);
- * // Do something
- * SessionEntityType response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * sessionEntityTypesClient.deleteSessionEntityType(name);
- * }
- *
- *
* @param name Required. The name of the session entity type to delete. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
@@ -631,19 +418,10 @@ public final void deleteSessionEntityType(SessionEntityTypeName name) {
deleteSessionEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified session entity type.
*
- * Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * sessionEntityTypesClient.deleteSessionEntityType(name.toString());
- * }
- *
- *
* @param name Required. The name of the session entity type to delete. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
@@ -659,22 +437,10 @@ public final void deleteSessionEntityType(String name) {
deleteSessionEntityType(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified session entity type.
*
- * Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[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
*/
@@ -682,23 +448,11 @@ public final void deleteSessionEntityType(DeleteSessionEntityTypeRequest request
deleteSessionEntityTypeCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified session entity type.
*
* Sample code: - * - *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = sessionEntityTypesClient.deleteSessionEntityTypeCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getSessionEntityType to 30 seconds: * - *
- *
+ * {@code
* SessionEntityTypesSettings.Builder sessionEntityTypesSettingsBuilder =
* SessionEntityTypesSettings.newBuilder();
* sessionEntityTypesSettingsBuilder
* .getSessionEntityTypeSettings()
* .setRetrySettings(
- * sessionEntityTypesSettingsBuilder.getSessionEntityTypeSettings().getRetrySettings().toBuilder()
+ * sessionEntityTypesSettingsBuilder
+ * .getSessionEntityTypeSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
- * SessionEntityTypesSettings sessionEntityTypesSettings = sessionEntityTypesSettingsBuilder.build();
- *
- *
+ * SessionEntityTypesSettings sessionEntityTypesSettings =
+ * sessionEntityTypesSettingsBuilder.build();
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class SessionEntityTypesSettings extends ClientSettingsThis 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 (SessionsClient sessionsClient = SessionsClient.create()) {
- * SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * QueryInput queryInput = QueryInput.newBuilder().build();
- * DetectIntentRequest request = DetectIntentRequest.newBuilder()
- * .setSession(session.toString())
- * .setQueryInput(queryInput)
- * .build();
- * DetectIntentResponse response = sessionsClient.detectIntent(request);
- * }
- *
- *
- *
- * Note: close() needs to be called on the sessionsClient object to clean up resources such as + *
Note: close() needs to be called on the SessionsClient 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 @@ -76,28 +63,25 @@ * *
To customize credentials: * - *
- *
+ * {@code
* SessionsSettings sessionsSettings =
* SessionsSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * SessionsClient sessionsClient =
- * SessionsClient.create(sessionsSettings);
- *
- *
+ * SessionsClient sessionsClient = SessionsClient.create(sessionsSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* SessionsSettings sessionsSettings =
* SessionsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SessionsClient sessionsClient =
- * SessionsClient.create(sessionsSettings);
- *
- *
+ * SessionsClient sessionsClient = SessionsClient.create(sessionsSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class SessionsClient implements BackgroundResource { private final SessionsSettings settings; @@ -118,7 +102,7 @@ public static final SessionsClient create(SessionsSettings settings) throws IOEx /** * Constructs an instance of SessionsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use SessionsSettings}. + * advanced usage - prefer using create(SessionsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final SessionsClient create(SessionsStub stub) { @@ -149,26 +133,12 @@ public SessionsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Processes a natural language query and returns structured, actionable data as a result. This * method is not idempotent, because it may cause session entity types to be updated, which in * turn might affect results of future queries. * - *
Sample code: - * - *
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- * SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * QueryInput queryInput = QueryInput.newBuilder().build();
- * DetectIntentRequest request = DetectIntentRequest.newBuilder()
- * .setSession(session.toString())
- * .setQueryInput(queryInput)
- * .build();
- * DetectIntentResponse response = sessionsClient.detectIntent(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
*/
@@ -176,79 +146,35 @@ public final DetectIntentResponse detectIntent(DetectIntentRequest request) {
return detectIntentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Processes a natural language query and returns structured, actionable data as a result. This
* method is not idempotent, because it may cause session entity types to be updated, which in
* turn might affect results of future queries.
*
* Sample code: - * - *
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- * SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * QueryInput queryInput = QueryInput.newBuilder().build();
- * DetectIntentRequest request = DetectIntentRequest.newBuilder()
- * .setSession(session.toString())
- * .setQueryInput(queryInput)
- * .build();
- * ApiFuture<DetectIntentResponse> future = sessionsClient.detectIntentCallable().futureCall(request);
- * // Do something
- * DetectIntentResponse response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- * BidiStream<StreamingDetectIntentRequest, StreamingDetectIntentResponse> bidiStream =
- * sessionsClient.streamingDetectIntentCallable().call();
- *
- * QueryInput queryInput = QueryInput.newBuilder().build();
- * StreamingDetectIntentRequest request = StreamingDetectIntentRequest.newBuilder()
- * .setQueryInput(queryInput)
- * .build();
- * bidiStream.send(request);
- * for (StreamingDetectIntentResponse response : bidiStream) {
- * // Do something when receive a response
- * }
- * }
- *
*/
public final BidiStreamingCallableSample code: - * - *
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- * SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * QueryInput queryInput = QueryInput.newBuilder().build();
- * MatchIntentRequest request = MatchIntentRequest.newBuilder()
- * .setSession(session.toString())
- * .setQueryInput(queryInput)
- * .build();
- * MatchIntentResponse response = sessionsClient.matchIntent(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
*/
@@ -256,31 +182,17 @@ public final MatchIntentResponse matchIntent(MatchIntentRequest request) {
return matchIntentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns preliminary intent match results, doesn't change the session status.
*
* Sample code: - * - *
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- * SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * QueryInput queryInput = QueryInput.newBuilder().build();
- * MatchIntentRequest request = MatchIntentRequest.newBuilder()
- * .setSession(session.toString())
- * .setQueryInput(queryInput)
- * .build();
- * ApiFuture<MatchIntentResponse> future = sessionsClient.matchIntentCallable().futureCall(request);
- * // Do something
- * MatchIntentResponse response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- * FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build();
- * FulfillIntentResponse response = sessionsClient.fulfillIntent(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
*/
@@ -304,7 +207,7 @@ public final FulfillIntentResponse fulfillIntent(FulfillIntentRequest request) {
return fulfillIntentCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Fulfills a matched intent returned by
* [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be called after
@@ -313,15 +216,6 @@ public final FulfillIntentResponse fulfillIntent(FulfillIntentRequest request) {
* behavior is undefined.
*
* Sample code: - * - *
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- * FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build();
- * ApiFuture<FulfillIntentResponse> future = sessionsClient.fulfillIntentCallable().futureCall(request);
- * // Do something
- * FulfillIntentResponse response = future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of detectIntent to 30 seconds: * - *
- *
- * SessionsSettings.Builder sessionsSettingsBuilder =
- * SessionsSettings.newBuilder();
+ * {@code
+ * SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder();
* sessionsSettingsBuilder
* .detectIntentSettings()
* .setRetrySettings(
- * sessionsSettingsBuilder.detectIntentSettings().getRetrySettings().toBuilder()
+ * sessionsSettingsBuilder
+ * .detectIntentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* SessionsSettings sessionsSettings = sessionsSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class SessionsSettings extends ClientSettingsThis 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 (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the transitionRouteGroupsClient object to clean up + *
Note: close() needs to be called on the TransitionRouteGroupsClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). * @@ -81,28 +73,27 @@ * *
To customize credentials: * - *
- *
+ * {@code
* TransitionRouteGroupsSettings transitionRouteGroupsSettings =
* TransitionRouteGroupsSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* TransitionRouteGroupsClient transitionRouteGroupsClient =
* TransitionRouteGroupsClient.create(transitionRouteGroupsSettings);
- *
- *
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* TransitionRouteGroupsSettings transitionRouteGroupsSettings =
* TransitionRouteGroupsSettings.newBuilder().setEndpoint(myEndpoint).build();
* TransitionRouteGroupsClient transitionRouteGroupsClient =
* TransitionRouteGroupsClient.create(transitionRouteGroupsSettings);
- *
- *
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class TransitionRouteGroupsClient implements BackgroundResource { private final TransitionRouteGroupsSettings settings; @@ -124,7 +115,7 @@ public static final TransitionRouteGroupsClient create(TransitionRouteGroupsSett /** * Constructs an instance of TransitionRouteGroupsClient, using the given stub for making calls. - * This is for advanced usage - prefer to use TransitionRouteGroupsSettings}. + * This is for advanced usage - prefer using create(TransitionRouteGroupsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final TransitionRouteGroupsClient create(TransitionRouteGroupsStub stub) { @@ -156,21 +147,10 @@ public TransitionRouteGroupsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * - *
Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The flow to list all transition route groups for. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
@@ -184,21 +164,10 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(Fl
return listTransitionRouteGroups(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all transition route groups in the specified flow.
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The flow to list all transition route groups for. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
@@ -210,24 +179,10 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(St
return listTransitionRouteGroups(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all transition route groups in the specified flow.
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(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
*/
@@ -236,25 +191,11 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(
return listTransitionRouteGroupsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all transition route groups in the specified flow.
*
* Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListTransitionRouteGroupsPagedResponse> future = transitionRouteGroupsClient.listTransitionRouteGroupsPagedCallable().futureCall(request);
- * // Do something
- * for (TransitionRouteGroup element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallable<
ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsPagedResponse>
@@ -262,52 +203,22 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(
return stub.listTransitionRouteGroupsPagedCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all transition route groups in the specified flow.
*
* Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListTransitionRouteGroupsResponse response = transitionRouteGroupsClient.listTransitionRouteGroupsCallable().call(request);
- * for (TransitionRouteGroup element : response.getTransitionRouteGroupsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
- * }
- *
- *
* @param name Required. The name of the
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
@@ -322,20 +233,11 @@ public final TransitionRouteGroup getTransitionRouteGroup(TransitionRouteGroupNa
return getTransitionRouteGroup(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name.toString());
- * }
- *
- *
* @param name Required. The name of the
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
@@ -348,23 +250,11 @@ public final TransitionRouteGroup getTransitionRouteGroup(String name) {
return getTransitionRouteGroup(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(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
*/
@@ -373,45 +263,23 @@ public final TransitionRouteGroup getTransitionRouteGroup(
return getTransitionRouteGroupCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
*
* Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.getTransitionRouteGroupCallable().futureCall(request);
- * // Do something
- * TransitionRouteGroup response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
- * TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(parent, transitionRouteGroup);
- * }
- *
- *
* @param parent Required. The flow to create an
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
@@ -429,21 +297,11 @@ public final TransitionRouteGroup createTransitionRouteGroup(
return createTransitionRouteGroup(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the
* specified flow.
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
- * TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(parent.toString(), transitionRouteGroup);
- * }
- *
- *
* @param parent Required. The flow to create an
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
@@ -461,25 +319,11 @@ public final TransitionRouteGroup createTransitionRouteGroup(
return createTransitionRouteGroup(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the
* specified flow.
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
- * CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTransitionRouteGroup(transitionRouteGroup)
- * .build();
- * TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(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
*/
@@ -488,47 +332,23 @@ public final TransitionRouteGroup createTransitionRouteGroup(
return createTransitionRouteGroupCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the
* specified flow.
*
* Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
- * CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTransitionRouteGroup(transitionRouteGroup)
- * .build();
- * ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.createTransitionRouteGroupCallable().futureCall(request);
- * // Do something
- * TransitionRouteGroup response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * TransitionRouteGroup response = transitionRouteGroupsClient.updateTransitionRouteGroup(transitionRouteGroup, updateMask);
- * }
- *
- *
* @param transitionRouteGroup Required. The transition route group to update.
* @param updateMask The mask to control which fields get updated.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -543,23 +363,11 @@ public final TransitionRouteGroup updateTransitionRouteGroup(
return updateTransitionRouteGroup(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
- * UpdateTransitionRouteGroupRequest request = UpdateTransitionRouteGroupRequest.newBuilder()
- * .setTransitionRouteGroup(transitionRouteGroup)
- * .build();
- * TransitionRouteGroup response = transitionRouteGroupsClient.updateTransitionRouteGroup(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
*/
@@ -568,44 +376,23 @@ public final TransitionRouteGroup updateTransitionRouteGroup(
return updateTransitionRouteGroupCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
*
* Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
- * UpdateTransitionRouteGroupRequest request = UpdateTransitionRouteGroupRequest.newBuilder()
- * .setTransitionRouteGroup(transitionRouteGroup)
- * .build();
- * ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.updateTransitionRouteGroupCallable().futureCall(request);
- * // Do something
- * TransitionRouteGroup response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * transitionRouteGroupsClient.deleteTransitionRouteGroup(name);
- * }
- *
- *
* @param name Required. The name of the
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] to delete.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
@@ -620,20 +407,11 @@ public final void deleteTransitionRouteGroup(TransitionRouteGroupName name) {
deleteTransitionRouteGroup(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * transitionRouteGroupsClient.deleteTransitionRouteGroup(name.toString());
- * }
- *
- *
* @param name Required. The name of the
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] to delete.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
@@ -646,23 +424,11 @@ public final void deleteTransitionRouteGroup(String name) {
deleteTransitionRouteGroup(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
*
- * Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * transitionRouteGroupsClient.deleteTransitionRouteGroup(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
*/
@@ -670,24 +436,12 @@ public final void deleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest r
deleteTransitionRouteGroupCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified
* [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
*
* Sample code: - * - *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = transitionRouteGroupsClient.deleteTransitionRouteGroupCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getTransitionRouteGroup to 30 seconds: * - *
- *
+ * {@code
* TransitionRouteGroupsSettings.Builder transitionRouteGroupsSettingsBuilder =
* TransitionRouteGroupsSettings.newBuilder();
* transitionRouteGroupsSettingsBuilder
* .getTransitionRouteGroupSettings()
* .setRetrySettings(
- * transitionRouteGroupsSettingsBuilder.getTransitionRouteGroupSettings().getRetrySettings().toBuilder()
+ * transitionRouteGroupsSettingsBuilder
+ * .getTransitionRouteGroupSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
- * TransitionRouteGroupsSettings transitionRouteGroupsSettings = transitionRouteGroupsSettingsBuilder.build();
- *
- *
+ * TransitionRouteGroupsSettings transitionRouteGroupsSettings =
+ * transitionRouteGroupsSettingsBuilder.build();
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class TransitionRouteGroupsSettings extends ClientSettingsThis 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 (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * Version response = versionsClient.getVersion(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the versionsClient object to clean up resources such as + *
Note: close() needs to be called on the VersionsClient 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 @@ -84,28 +76,25 @@ * *
To customize credentials: * - *
- *
+ * {@code
* VersionsSettings versionsSettings =
* VersionsSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * VersionsClient versionsClient =
- * VersionsClient.create(versionsSettings);
- *
- *
+ * VersionsClient versionsClient = VersionsClient.create(versionsSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* VersionsSettings versionsSettings =
* VersionsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * VersionsClient versionsClient =
- * VersionsClient.create(versionsSettings);
- *
- *
+ * VersionsClient versionsClient = VersionsClient.create(versionsSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class VersionsClient implements BackgroundResource { private final VersionsSettings settings; @@ -127,7 +116,7 @@ public static final VersionsClient create(VersionsSettings settings) throws IOEx /** * Constructs an instance of VersionsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use VersionsSettings}. + * advanced usage - prefer using create(VersionsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final VersionsClient create(VersionsStub stub) { @@ -164,27 +153,14 @@ public VersionsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow]. * - *
Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * for (Version element : versionsClient.listVersions(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions
* for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
@@ -198,21 +174,10 @@ public final ListVersionsPagedResponse listVersions(FlowName parent) {
return listVersions(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
*
- * Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * for (Version element : versionsClient.listVersions(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions
* for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
@@ -223,24 +188,10 @@ public final ListVersionsPagedResponse listVersions(String parent) {
return listVersions(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
*
- * Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListVersionsRequest request = ListVersionsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Version element : versionsClient.listVersions(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
*/
@@ -248,75 +199,31 @@ public final ListVersionsPagedResponse listVersions(ListVersionsRequest request)
return listVersionsPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
*
* Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListVersionsRequest request = ListVersionsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListVersionsPagedResponse> future = versionsClient.listVersionsPagedCallable().futureCall(request);
- * // Do something
- * for (Version element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * ListVersionsRequest request = ListVersionsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListVersionsResponse response = versionsClient.listVersionsCallable().call(request);
- * for (Version element : response.getVersionsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * Version response = versionsClient.getVersion(name);
- * }
- *
- *
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>/versions/<Version ID>`.
@@ -328,19 +235,10 @@ public final Version getVersion(VersionName name) {
return getVersion(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
*
- * Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * Version response = versionsClient.getVersion(name.toString());
- * }
- *
- *
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. Format:
* `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>/versions/<Version ID>`.
@@ -351,22 +249,10 @@ public final Version getVersion(String name) {
return getVersion(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
*
- * Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * GetVersionRequest request = GetVersionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Version response = versionsClient.getVersion(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
*/
@@ -374,51 +260,27 @@ public final Version getVersion(GetVersionRequest request) {
return getVersionCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
*
* Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * GetVersionRequest request = GetVersionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Version> future = versionsClient.getVersionCallable().futureCall(request);
- * // Do something
- * Version response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Version version = Version.newBuilder().build();
- * Version response = versionsClient.createVersionAsync(parent, version).get();
- * }
- *
- *
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @param version Required. The version to create.
* @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 OperationFutureSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Version version = Version.newBuilder().build();
- * Version response = versionsClient.createVersionAsync(parent.toString(), version).get();
- * }
- *
- *
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`.
* @param version Required. The version to create.
* @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 OperationFutureSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Version version = Version.newBuilder().build();
- * CreateVersionRequest request = CreateVersionRequest.newBuilder()
- * .setParent(parent.toString())
- * .setVersion(version)
- * .build();
- * Version response = versionsClient.createVersionAsync(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 OperationFutureSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Version version = Version.newBuilder().build();
- * CreateVersionRequest request = CreateVersionRequest.newBuilder()
- * .setParent(parent.toString())
- * .setVersion(version)
- * .build();
- * OperationFuture<Version, CreateVersionOperationMetadata> future = versionsClient.createVersionOperationCallable().futureCall(request);
- * // Do something
- * Version response = future.get();
- * }
- *
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallableSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
- * Version version = Version.newBuilder().build();
- * CreateVersionRequest request = CreateVersionRequest.newBuilder()
- * .setParent(parent.toString())
- * .setVersion(version)
- * .build();
- * ApiFuture<Operation> future = versionsClient.createVersionCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * Version version = Version.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Version response = versionsClient.updateVersion(version, updateMask);
- * }
- *
- *
* @param version Required. The version to update.
* @param updateMask Required. The mask to control which fields get updated. Currently only
* `description` and `display_name` can be updated.
@@ -565,24 +360,10 @@ public final Version updateVersion(Version version, FieldMask updateMask) {
return updateVersion(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
*
- * Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * Version version = Version.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateVersionRequest request = UpdateVersionRequest.newBuilder()
- * .setVersion(version)
- * .setUpdateMask(updateMask)
- * .build();
- * Version response = versionsClient.updateVersion(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
*/
@@ -590,43 +371,20 @@ public final Version updateVersion(UpdateVersionRequest request) {
return updateVersionCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
*
* Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * Version version = Version.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateVersionRequest request = UpdateVersionRequest.newBuilder()
- * .setVersion(version)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Version> future = versionsClient.updateVersionCallable().futureCall(request);
- * // Do something
- * Version response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * versionsClient.deleteVersion(name);
- * }
- *
- *
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to
* delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>/versions/<Version ID>`.
@@ -638,19 +396,10 @@ public final void deleteVersion(VersionName name) {
deleteVersion(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
*
- * Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * versionsClient.deleteVersion(name.toString());
- * }
- *
- *
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to
* delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>/versions/<Version ID>`.
@@ -661,22 +410,10 @@ public final void deleteVersion(String name) {
deleteVersion(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
*
- * Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * DeleteVersionRequest request = DeleteVersionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * versionsClient.deleteVersion(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
*/
@@ -684,144 +421,71 @@ public final void deleteVersion(DeleteVersionRequest request) {
deleteVersionCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
*
* Sample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * DeleteVersionRequest request = DeleteVersionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = versionsClient.deleteVersionCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * versionsClient.loadVersionAsync(name).get();
- * }
- *
- *
* @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to
* draft version. Format: `projects/<Project ID>/locations/<Location
* ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version 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 OperationFutureSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * versionsClient.loadVersionAsync(name.toString()).get();
- * }
- *
- *
* @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to
* draft version. Format: `projects/<Project ID>/locations/<Location
* ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version 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 OperationFutureSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * LoadVersionRequest request = LoadVersionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * versionsClient.loadVersionAsync(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 OperationFutureSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * LoadVersionRequest request = LoadVersionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, Struct> future = versionsClient.loadVersionOperationCallable().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 OperationCallableSample code: - * - *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * LoadVersionRequest request = LoadVersionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = versionsClient.loadVersionCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getVersion to 30 seconds: * - *
- *
- * VersionsSettings.Builder versionsSettingsBuilder =
- * VersionsSettings.newBuilder();
+ * {@code
+ * VersionsSettings.Builder versionsSettingsBuilder = VersionsSettings.newBuilder();
* versionsSettingsBuilder
* .getVersionSettings()
* .setRetrySettings(
- * versionsSettingsBuilder.getVersionSettings().getRetrySettings().toBuilder()
+ * versionsSettingsBuilder
+ * .getVersionSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* VersionsSettings versionsSettings = versionsSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class VersionsSettings extends ClientSettingsThis 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 (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * Webhook response = webhooksClient.getWebhook(name);
- * }
- *
- *
- *
- * Note: close() needs to be called on the webhooksClient object to clean up resources such as + *
Note: close() needs to be called on the WebhooksClient 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 @@ -79,28 +71,25 @@ * *
To customize credentials: * - *
- *
+ * {@code
* WebhooksSettings webhooksSettings =
* WebhooksSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
- * WebhooksClient webhooksClient =
- * WebhooksClient.create(webhooksSettings);
- *
- *
+ * WebhooksClient webhooksClient = WebhooksClient.create(webhooksSettings);
+ * }
*
- * To customize the endpoint:
+ * To customize the endpoint: * - *
- *
+ * {@code
* WebhooksSettings webhooksSettings =
* WebhooksSettings.newBuilder().setEndpoint(myEndpoint).build();
- * WebhooksClient webhooksClient =
- * WebhooksClient.create(webhooksSettings);
- *
- *
+ * WebhooksClient webhooksClient = WebhooksClient.create(webhooksSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class WebhooksClient implements BackgroundResource { private final WebhooksSettings settings; @@ -121,7 +110,7 @@ public static final WebhooksClient create(WebhooksSettings settings) throws IOEx /** * Constructs an instance of WebhooksClient, using the given stub for making calls. This is for - * advanced usage - prefer to use WebhooksSettings}. + * advanced usage - prefer using create(WebhooksSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final WebhooksClient create(WebhooksStub stub) { @@ -152,21 +141,10 @@ public WebhooksStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * - *
Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (Webhook element : webhooksClient.listWebhooks(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The agent to list all webhooks for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -179,21 +157,10 @@ public final ListWebhooksPagedResponse listWebhooks(AgentName parent) {
return listWebhooks(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all webhooks in the specified agent.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * for (Webhook element : webhooksClient.listWebhooks(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
* @param parent Required. The agent to list all webhooks for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -203,24 +170,10 @@ public final ListWebhooksPagedResponse listWebhooks(String parent) {
return listWebhooks(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all webhooks in the specified agent.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (Webhook element : webhooksClient.listWebhooks(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
*/
@@ -228,75 +181,31 @@ public final ListWebhooksPagedResponse listWebhooks(ListWebhooksRequest request)
return listWebhooksPagedCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all webhooks in the specified agent.
*
* Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListWebhooksPagedResponse> future = webhooksClient.listWebhooksPagedCallable().futureCall(request);
- * // Do something
- * for (Webhook element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListWebhooksResponse response = webhooksClient.listWebhooksCallable().call(request);
- * for (Webhook element : response.getWebhooksList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * Webhook response = webhooksClient.getWebhook(name);
- * }
- *
- *
* @param name Required. The name of the webhook. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -307,19 +216,10 @@ public final Webhook getWebhook(WebhookName name) {
return getWebhook(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified webhook.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * Webhook response = webhooksClient.getWebhook(name.toString());
- * }
- *
- *
* @param name Required. The name of the webhook. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -329,22 +229,10 @@ public final Webhook getWebhook(String name) {
return getWebhook(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified webhook.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * GetWebhookRequest request = GetWebhookRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Webhook response = webhooksClient.getWebhook(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
*/
@@ -352,42 +240,20 @@ public final Webhook getWebhook(GetWebhookRequest request) {
return getWebhookCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified webhook.
*
* Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * GetWebhookRequest request = GetWebhookRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Webhook> future = webhooksClient.getWebhookCallable().futureCall(request);
- * // Do something
- * Webhook response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Webhook webhook = Webhook.newBuilder().build();
- * Webhook response = webhooksClient.createWebhook(parent, webhook);
- * }
- *
- *
* @param parent Required. The agent to create a webhook for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param webhook Required. The webhook to create.
@@ -402,20 +268,10 @@ public final Webhook createWebhook(AgentName parent, Webhook webhook) {
return createWebhook(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a webhook in the specified agent.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Webhook webhook = Webhook.newBuilder().build();
- * Webhook response = webhooksClient.createWebhook(parent.toString(), webhook);
- * }
- *
- *
* @param parent Required. The agent to create a webhook for. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>`.
* @param webhook Required. The webhook to create.
@@ -427,24 +283,10 @@ public final Webhook createWebhook(String parent, Webhook webhook) {
return createWebhook(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a webhook in the specified agent.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Webhook webhook = Webhook.newBuilder().build();
- * CreateWebhookRequest request = CreateWebhookRequest.newBuilder()
- * .setParent(parent.toString())
- * .setWebhook(webhook)
- * .build();
- * Webhook response = webhooksClient.createWebhook(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
*/
@@ -452,44 +294,20 @@ public final Webhook createWebhook(CreateWebhookRequest request) {
return createWebhookCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a webhook in the specified agent.
*
* Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Webhook webhook = Webhook.newBuilder().build();
- * CreateWebhookRequest request = CreateWebhookRequest.newBuilder()
- * .setParent(parent.toString())
- * .setWebhook(webhook)
- * .build();
- * ApiFuture<Webhook> future = webhooksClient.createWebhookCallable().futureCall(request);
- * // Do something
- * Webhook response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * Webhook webhook = Webhook.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * Webhook response = webhooksClient.updateWebhook(webhook, updateMask);
- * }
- *
- *
* @param webhook Required. The webhook to update.
* @param updateMask The mask to control which fields get updated. If the mask is not present, all
* fields will be updated.
@@ -501,22 +319,10 @@ public final Webhook updateWebhook(Webhook webhook, FieldMask updateMask) {
return updateWebhook(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified webhook.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * Webhook webhook = Webhook.newBuilder().build();
- * UpdateWebhookRequest request = UpdateWebhookRequest.newBuilder()
- * .setWebhook(webhook)
- * .build();
- * Webhook response = webhooksClient.updateWebhook(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
*/
@@ -524,41 +330,20 @@ public final Webhook updateWebhook(UpdateWebhookRequest request) {
return updateWebhookCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the specified webhook.
*
* Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * Webhook webhook = Webhook.newBuilder().build();
- * UpdateWebhookRequest request = UpdateWebhookRequest.newBuilder()
- * .setWebhook(webhook)
- * .build();
- * ApiFuture<Webhook> future = webhooksClient.updateWebhookCallable().futureCall(request);
- * // Do something
- * Webhook response = future.get();
- * }
- *
*/
public final UnaryCallableSample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * webhooksClient.deleteWebhook(name);
- * }
- *
- *
* @param name Required. The name of the webhook to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -569,19 +354,10 @@ public final void deleteWebhook(WebhookName name) {
deleteWebhook(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified webhook.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * webhooksClient.deleteWebhook(name.toString());
- * }
- *
- *
* @param name Required. The name of the webhook to delete. Format: `projects/<Project
* ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -591,22 +367,10 @@ public final void deleteWebhook(String name) {
deleteWebhook(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified webhook.
*
- * Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * webhooksClient.deleteWebhook(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
*/
@@ -614,23 +378,11 @@ public final void deleteWebhook(DeleteWebhookRequest request) {
deleteWebhookCallable().call(request);
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified webhook.
*
* Sample code: - * - *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = webhooksClient.deleteWebhookCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*/
public final UnaryCallableFor example, to set the total timeout of getWebhook to 30 seconds: * - *
- *
- * WebhooksSettings.Builder webhooksSettingsBuilder =
- * WebhooksSettings.newBuilder();
+ * {@code
+ * WebhooksSettings.Builder webhooksSettingsBuilder = WebhooksSettings.newBuilder();
* webhooksSettingsBuilder
* .getWebhookSettings()
* .setRetrySettings(
- * webhooksSettingsBuilder.getWebhookSettings().getRetrySettings().toBuilder()
+ * webhooksSettingsBuilder
+ * .getWebhookSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* WebhooksSettings webhooksSettings = webhooksSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
public class WebhooksSettings extends ClientSettingsThe interfaces provided are listed below, along with usage samples. - * - *
=========== PagesClient =========== - * - *
Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page]. - * - *
Sample for PagesClient: - * - *
- *
- * try (PagesClient pagesClient = PagesClient.create()) {
- * PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- * Page response = pagesClient.getPage(name);
- * }
- *
- *
- *
- * =========== FlowsClient ===========
- *
- * Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. - * - *
Sample for FlowsClient: - * - *
- *
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Flow flow = Flow.newBuilder().build();
- * Flow response = flowsClient.createFlow(parent, flow);
- * }
- *
- *
- *
- * ============ AgentsClient ============
+ * ======================= AgentsClient ======================= * *
Service Description: Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent]. * *
Sample for AgentsClient: * - *
- *
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- * AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- * Agent response = agentsClient.getAgent(name);
- * }
- *
- *
- *
- * ================= EntityTypesClient =================
+ * ======================= EntityTypesClient ======================= * *
Service Description: Service for managing * [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType]. * *
Sample for EntityTypesClient: * - *
- *
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- * EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- * EntityType response = entityTypesClient.getEntityType(name);
- * }
- *
- *
- *
- * ================== EnvironmentsClient ==================
+ * ======================= EnvironmentsClient ======================= * *
Service Description: Service for managing * [Environments][google.cloud.dialogflow.cx.v3.Environment]. * *
Sample for EnvironmentsClient: * - *
- *
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- * EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- * Environment response = environmentsClient.getEnvironment(name);
- * }
- *
- *
+ * ======================= FlowsClient ======================= * - * ============= IntentsClient ============= - * - *
Service Description: Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent]. + *
Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. * - *
Sample for IntentsClient: + *
Sample for FlowsClient: * - *
- *
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- * IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- * Intent response = intentsClient.getIntent(name);
- * }
- *
- *
+ * ======================= IntentsClient ======================= * - * ============================= SecuritySettingsServiceClient ============================= + *
Service Description: Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent]. * - *
Service Description: Service for managing security settings for Dialogflow. + *
Sample for IntentsClient: * - *
Sample for SecuritySettingsServiceClient: + *
======================= PagesClient ======================= * - *
- *
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- * SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(parent, securitySettings);
- * }
- *
- *
+ * Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page]. * - * ======================== SessionEntityTypesClient ======================== + *
Sample for PagesClient: * - *
Service Description: Service for managing - * [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType]. + *
======================= SecuritySettingsServiceClient ======================= * - *
Sample for SessionEntityTypesClient: + *
Service Description: Service for managing security settings for Dialogflow. * - *
- *
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- * SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- * SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
- * }
- *
- *
+ * Sample for SecuritySettingsServiceClient: * - * ============== SessionsClient ============== + *
======================= SessionsClient ======================= * *
Service Description: A session represents an interaction with a user. You retrieve user input * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to @@ -152,67 +69,33 @@ * *
Sample for SessionsClient: * - *
- *
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- * SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- * QueryInput queryInput = QueryInput.newBuilder().build();
- * DetectIntentRequest request = DetectIntentRequest.newBuilder()
- * .setSession(session.toString())
- * .setQueryInput(queryInput)
- * .build();
- * DetectIntentResponse response = sessionsClient.detectIntent(request);
- * }
- *
- *
- *
- * =========================== TransitionRouteGroupsClient ===========================
+ * ======================= SessionEntityTypesClient ======================= + * + *
Service Description: Service for managing + * [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType]. + * + *
Sample for SessionEntityTypesClient: + * + *
======================= TransitionRouteGroupsClient ======================= * *
Service Description: Service for managing * [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * *
Sample for TransitionRouteGroupsClient: * - *
- *
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- * TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- * TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
- * }
- *
- *
- *
- * ============== VersionsClient ==============
+ * ======================= VersionsClient ======================= * *
Service Description: Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version]. * *
Sample for VersionsClient: * - *
- *
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- * VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- * Version response = versionsClient.getVersion(name);
- * }
- *
- *
- *
- * ============== WebhooksClient ==============
+ * ======================= WebhooksClient ======================= * *
Service Description: Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook]. * *
Sample for WebhooksClient: - * - *
- *
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- * WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- * Webhook response = webhooksClient.getWebhook(name);
- * }
- *
- *
*/
-@Generated("by gapic-generator")
+@Generated("by gapic-generator-java")
package com.google.cloud.dialogflow.cx.v3;
import javax.annotation.Generated;
diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStub.java
index 17fc87869..df817663c 100644
--- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStub.java
+++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStub.java
@@ -5,7 +5,7 @@
* 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
+ * 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,
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.google.cloud.dialogflow.cx.v3.stub;
import static com.google.cloud.dialogflow.cx.v3.AgentsClient.ListAgentsPagedResponse;
-import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
@@ -37,17 +37,15 @@
import com.google.protobuf.Struct;
import javax.annotation.Generated;
-// AUTO-GENERATED DOCUMENTATION AND CLASS
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
- * Base stub class for Dialogflow API.
+ * Base stub class for the Agents service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class AgentsStub implements BackgroundResource {
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationsStub getOperationsStub() {
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
}
@@ -76,7 +74,6 @@ public UnaryCallable For example, to set the total timeout of getAgent to 30 seconds:
*
- * This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class EntityTypesStub implements BackgroundResource {
public UnaryCallable For example, to set the total timeout of getEntityType to 30 seconds:
*
- * This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class EnvironmentsStub implements BackgroundResource {
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationsStub getOperationsStub() {
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
}
@@ -66,7 +64,6 @@ public UnaryCallable For example, to set the total timeout of getEnvironment to 30 seconds:
*
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@BetaApi
+@Generated("by gapic-generator-java")
public class AgentsStubSettings extends StubSettings
- * AgentsStubSettings.Builder agentsSettingsBuilder =
- * AgentsStubSettings.newBuilder();
+ *
- * {@code
+ * AgentsStubSettings.Builder agentsSettingsBuilder = AgentsStubSettings.newBuilder();
* agentsSettingsBuilder
* .getAgentSettings()
* .setRetrySettings(
- * agentsSettingsBuilder.getAgentSettings().getRetrySettings().toBuilder()
+ * agentsSettingsBuilder
+ * .getAgentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AgentsStubSettings agentsSettings = agentsSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@BetaApi
+@Generated("by gapic-generator-java")
public class EntityTypesStubSettings extends StubSettings
+ *
- * {@code
* EntityTypesStubSettings.Builder entityTypesSettingsBuilder =
* EntityTypesStubSettings.newBuilder();
* entityTypesSettingsBuilder
* .getEntityTypeSettings()
* .setRetrySettings(
- * entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ * entityTypesSettingsBuilder
+ * .getEntityTypeSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* EntityTypesStubSettings entityTypesSettings = entityTypesSettingsBuilder.build();
- *
- *
+ * }
*/
-@Generated("by gapic-generator")
+@BetaApi
+@Generated("by gapic-generator-java")
public class EnvironmentsStubSettings extends StubSettings
+ *
- * {@code
* EnvironmentsStubSettings.Builder environmentsSettingsBuilder =
* EnvironmentsStubSettings.newBuilder();
* environmentsSettingsBuilder
* .getEnvironmentSettings()
* .setRetrySettings(
- * environmentsSettingsBuilder.getEnvironmentSettings().getRetrySettings().toBuilder()
+ * environmentsSettingsBuilder
+ * .getEnvironmentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* EnvironmentsStubSettings environmentsSettings = environmentsSettingsBuilder.build();
- *