{@code * try (AgentsClient agentsClient = AgentsClient.create()) { - * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * for (Agent element : agentsClient.listAgents(parent).iterateAll()) { * // doThingsWith(element); * } @@ -220,7 +220,7 @@ public final ListAgentsPagedResponse listAgents(String parent) { * try (AgentsClient agentsClient = AgentsClient.create()) { * ListAgentsRequest request = * ListAgentsRequest.newBuilder() - * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -247,7 +247,7 @@ public final ListAgentsPagedResponse listAgents(ListAgentsRequest request) { * try (AgentsClient agentsClient = AgentsClient.create()) { * ListAgentsRequest request = * ListAgentsRequest.newBuilder() - * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -273,7 +273,7 @@ public final UnaryCallablelistAgent * try (AgentsClient agentsClient = AgentsClient.create()) { * ListAgentsRequest request = * ListAgentsRequest.newBuilder() - * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -428,7 +428,7 @@ public final Agent createAgent(LocationName parent, Agent agent) { * * {@code * try (AgentsClient agentsClient = AgentsClient.create()) { - * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * Agent agent = Agent.newBuilder().build(); * Agent response = agentsClient.createAgent(parent, agent); * } @@ -458,7 +458,7 @@ public final Agent createAgent(String parent, Agent agent) { * try (AgentsClient agentsClient = AgentsClient.create()) { * CreateAgentRequest request = * CreateAgentRequest.newBuilder() - * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setAgent(Agent.newBuilder().build()) * .build(); * Agent response = agentsClient.createAgent(request); @@ -485,7 +485,7 @@ public final Agent createAgent(CreateAgentRequest request) { * try (AgentsClient agentsClient = AgentsClient.create()) { * CreateAgentRequest request = * CreateAgentRequest.newBuilder() - * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setAgent(Agent.newBuilder().build()) * .build(); * ApiFuturefuture = agentsClient.createAgentCallable().futureCall(request); @@ -671,7 +671,9 @@ public final UnaryCallable deleteAgentCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Exports the specified agent to a binary file. This method is a [long-running + * Exports the specified agent to a binary file. + * + * This method is a [long-running * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The * returned `Operation` type has the following method-specific fields: * @@ -705,7 +707,9 @@ public final OperationFuture
exportAgentAsync( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Exports the specified agent to a binary file. This method is a [long-running + * Exports the specified agent to a binary file. + * + * This method is a [long-running * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The * returned `Operation` type has the following method-specific fields: * @@ -739,7 +743,9 @@ public final OperationFuture
exportAgentAsync( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Exports the specified agent to a binary file. This method is a [long-running + * Exports the specified agent to a binary file. + * + * This method is a [long-running * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The * returned `Operation` type has the following method-specific fields: * @@ -776,6 +782,15 @@ public final UnaryCallable
exportAgentCallable() * Replaces the current agent with a new one. Note that all existing resources in agent (e.g. * intents, entity types, flows) will be removed. * + *
This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Note: You should always train flows prior to sending them queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -805,6 +820,15 @@ public final OperationFuture
restoreAgentAsync(RestoreAgentReques * Replaces the current agent with a new one. Note that all existing resources in agent (e.g. * intents, entity types, flows) will be removed. * + *
This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Note: You should always train flows prior to sending them queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -835,6 +859,15 @@ public final OperationFuture
restoreAgentAsync(RestoreAgentReques * Replaces the current agent with a new one. Note that all existing resources in agent (e.g. * intents, entity types, flows) will be removed. * + *
This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Note: You should always train flows prior to sending them queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ChangelogsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ChangelogsClient.java new file mode 100644 index 000000000..59e5b251a --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ChangelogsClient.java @@ -0,0 +1,490 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.cx.v3; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3.stub.ChangelogsStub; +import com.google.cloud.dialogflow.cx.v3.stub.ChangelogsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for managing [Changelogs][google.cloud.dialogflow.cx.v3.Changelog]. + * + *
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: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * ChangelogName name = ChangelogName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[CHANGELOG]"); + * Changelog response = changelogsClient.getChangelog(name); + * } + * }+ * + *Note: close() needs to be called on the ChangelogsClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
+ *
+ * + *- A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
- A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
- A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of ChangelogsSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * ChangelogsSettings changelogsSettings = + * ChangelogsSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * ChangelogsClient changelogsClient = ChangelogsClient.create(changelogsSettings); + * }+ * + *To customize the endpoint: + * + *
{@code + * ChangelogsSettings changelogsSettings = + * ChangelogsSettings.newBuilder().setEndpoint(myEndpoint).build(); + * ChangelogsClient changelogsClient = ChangelogsClient.create(changelogsSettings); + * }+ * + *Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ChangelogsClient implements BackgroundResource { + private final ChangelogsSettings settings; + private final ChangelogsStub stub; + + /** Constructs an instance of ChangelogsClient with default settings. */ + public static final ChangelogsClient create() throws IOException { + return create(ChangelogsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ChangelogsClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ChangelogsClient create(ChangelogsSettings settings) throws IOException { + return new ChangelogsClient(settings); + } + + /** + * Constructs an instance of ChangelogsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ChangelogsSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ChangelogsClient create(ChangelogsStub stub) { + return new ChangelogsClient(stub); + } + + /** + * Constructs an instance of ChangelogsClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected ChangelogsClient(ChangelogsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ChangelogsStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ChangelogsClient(ChangelogsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ChangelogsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ChangelogsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of Changelogs. + * + *
Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + * for (Changelog element : changelogsClient.listChangelogs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The agent containing the changelogs. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListChangelogsPagedResponse listChangelogs(AgentName parent) { + ListChangelogsRequest request = + ListChangelogsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listChangelogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of Changelogs. + * + *Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); + * for (Changelog element : changelogsClient.listChangelogs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The agent containing the changelogs. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListChangelogsPagedResponse listChangelogs(String parent) { + ListChangelogsRequest request = ListChangelogsRequest.newBuilder().setParent(parent).build(); + return listChangelogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of Changelogs. + * + *Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * ListChangelogsRequest request = + * ListChangelogsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Changelog element : changelogsClient.listChangelogs(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListChangelogsPagedResponse listChangelogs(ListChangelogsRequest request) { + return listChangelogsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of Changelogs. + * + *Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * ListChangelogsRequest request = + * ListChangelogsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * changelogsClient.listChangelogsPagedCallable().futureCall(request); + * // Do something. + * for (Changelog element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * } + listChangelogsPagedCallable() { + return stub.listChangelogsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of Changelogs. + * + * Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * ListChangelogsRequest request = + * ListChangelogsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListChangelogsResponse response = changelogsClient.listChangelogsCallable().call(request); + * for (Changelog element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable+ listChangelogsCallable() { + return stub.listChangelogsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified Changelog. + * + * Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * ChangelogName name = ChangelogName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[CHANGELOG]"); + * Changelog response = changelogsClient.getChangelog(name); + * } + * }+ * + * @param name Required. The name of the changelog to get. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/changelogs/<Changelog + * ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Changelog getChangelog(ChangelogName name) { + GetChangelogRequest request = + GetChangelogRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getChangelog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified Changelog. + * + *Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * String name = + * ChangelogName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[CHANGELOG]").toString(); + * Changelog response = changelogsClient.getChangelog(name); + * } + * }+ * + * @param name Required. The name of the changelog to get. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/changelogs/<Changelog + * ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Changelog getChangelog(String name) { + GetChangelogRequest request = GetChangelogRequest.newBuilder().setName(name).build(); + return getChangelog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified Changelog. + * + *Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * GetChangelogRequest request = + * GetChangelogRequest.newBuilder() + * .setName( + * ChangelogName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[CHANGELOG]").toString()) + * .build(); + * Changelog response = changelogsClient.getChangelog(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Changelog getChangelog(GetChangelogRequest request) { + return getChangelogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified Changelog. + * + *Sample code: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * GetChangelogRequest request = + * GetChangelogRequest.newBuilder() + * .setName( + * ChangelogName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[CHANGELOG]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = changelogsClient.getChangelogCallable().futureCall(request); + * // Do something. + * Changelog response = future.get(); + * } + * } getChangelogCallable() { + return stub.getChangelogCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListChangelogsPagedResponse + extends AbstractPagedListResponse< + ListChangelogsRequest, + ListChangelogsResponse, + Changelog, + ListChangelogsPage, + ListChangelogsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListChangelogsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListChangelogsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListChangelogsPagedResponse(ListChangelogsPage page) { + super(page, ListChangelogsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListChangelogsPage + extends AbstractPage< + ListChangelogsRequest, ListChangelogsResponse, Changelog, ListChangelogsPage> { + + private ListChangelogsPage( + PageContext context, + ListChangelogsResponse response) { + super(context, response); + } + + private static ListChangelogsPage createEmptyPage() { + return new ListChangelogsPage(null, null); + } + + @Override + protected ListChangelogsPage createPage( + PageContext context, + ListChangelogsResponse response) { + return new ListChangelogsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListChangelogsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListChangelogsRequest, + ListChangelogsResponse, + Changelog, + ListChangelogsPage, + ListChangelogsFixedSizeCollection> { + + private ListChangelogsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListChangelogsFixedSizeCollection createEmptyCollection() { + return new ListChangelogsFixedSizeCollection(null, 0); + } + + @Override + protected ListChangelogsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListChangelogsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ChangelogsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ChangelogsSettings.java new file mode 100644 index 000000000..33bd0f8c0 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ChangelogsSettings.java @@ -0,0 +1,196 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.cx.v3; + +import static com.google.cloud.dialogflow.cx.v3.ChangelogsClient.ListChangelogsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.dialogflow.cx.v3.stub.ChangelogsStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ChangelogsClient}. + * + * The default instance has everything set to sensible defaults: + * + *
+ *
+ * + *- The default service address (dialogflow.googleapis.com) and default port (443) are used. + *
- Credentials are acquired automatically through Application Default Credentials. + *
- Retries are configured for idempotent methods but not for non-idempotent methods. + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getChangelog to 30 seconds: + * + *
{@code + * ChangelogsSettings.Builder changelogsSettingsBuilder = ChangelogsSettings.newBuilder(); + * changelogsSettingsBuilder + * .getChangelogSettings() + * .setRetrySettings( + * changelogsSettingsBuilder + * .getChangelogSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * ChangelogsSettings changelogsSettings = changelogsSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class ChangelogsSettings extends ClientSettings{ + + /** Returns the object with the settings used for calls to listChangelogs. */ + public PagedCallSettings< + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> + listChangelogsSettings() { + return ((ChangelogsStubSettings) getStubSettings()).listChangelogsSettings(); + } + + /** Returns the object with the settings used for calls to getChangelog. */ + public UnaryCallSettings getChangelogSettings() { + return ((ChangelogsStubSettings) getStubSettings()).getChangelogSettings(); + } + + public static final ChangelogsSettings create(ChangelogsStubSettings stub) throws IOException { + return new ChangelogsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ChangelogsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ChangelogsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ChangelogsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ChangelogsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ChangelogsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ChangelogsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ChangelogsStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ChangelogsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ChangelogsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ChangelogsStubSettings.newBuilder(clientContext)); + } + + protected Builder(ChangelogsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ChangelogsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ChangelogsStubSettings.newBuilder()); + } + + public ChangelogsStubSettings.Builder getStubSettingsBuilder() { + return ((ChangelogsStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction
, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listChangelogs. */ + public PagedCallSettings.Builder< + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> + listChangelogsSettings() { + return getStubSettingsBuilder().listChangelogsSettings(); + } + + /** Returns the builder for the settings used for calls to getChangelog. */ + public UnaryCallSettings.Builder getChangelogSettings() { + return getStubSettingsBuilder().getChangelogSettings(); + } + + @Override + public ChangelogsSettings build() throws IOException { + return new ChangelogsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/DeploymentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/DeploymentsClient.java new file mode 100644 index 000000000..1bd280af1 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/DeploymentsClient.java @@ -0,0 +1,513 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.cx.v3; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3.stub.DeploymentsStub; +import com.google.cloud.dialogflow.cx.v3.stub.DeploymentsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for managing + * [Deployments][google.cloud.dialogflow.cx.v3.Deployment]. + * + * 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: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * DeploymentName name = + * DeploymentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]"); + * Deployment response = deploymentsClient.getDeployment(name); + * } + * }+ * + *Note: close() needs to be called on the DeploymentsClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
+ *
+ * + *- A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
- A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
- A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of DeploymentsSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * DeploymentsSettings deploymentsSettings = + * DeploymentsSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * DeploymentsClient deploymentsClient = DeploymentsClient.create(deploymentsSettings); + * }+ * + *To customize the endpoint: + * + *
{@code + * DeploymentsSettings deploymentsSettings = + * DeploymentsSettings.newBuilder().setEndpoint(myEndpoint).build(); + * DeploymentsClient deploymentsClient = DeploymentsClient.create(deploymentsSettings); + * }+ * + *Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class DeploymentsClient implements BackgroundResource { + private final DeploymentsSettings settings; + private final DeploymentsStub stub; + + /** Constructs an instance of DeploymentsClient with default settings. */ + public static final DeploymentsClient create() throws IOException { + return create(DeploymentsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DeploymentsClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final DeploymentsClient create(DeploymentsSettings settings) throws IOException { + return new DeploymentsClient(settings); + } + + /** + * Constructs an instance of DeploymentsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(DeploymentsSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final DeploymentsClient create(DeploymentsStub stub) { + return new DeploymentsClient(stub); + } + + /** + * Constructs an instance of DeploymentsClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected DeploymentsClient(DeploymentsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DeploymentsStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected DeploymentsClient(DeploymentsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final DeploymentsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DeploymentsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of all deployments in the specified + * [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * + *
Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * EnvironmentName parent = + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + * for (Deployment element : deploymentsClient.listDeployments(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to list + * all environments for. Format: `projects/<Project ID>/locations/<Location + * ID>/agents/<Agent ID>/environments/<Environment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentsPagedResponse listDeployments(EnvironmentName parent) { + ListDeploymentsRequest request = + ListDeploymentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of all deployments in the specified + * [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * + *Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * String parent = + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]").toString(); + * for (Deployment element : deploymentsClient.listDeployments(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to list + * all environments for. Format: `projects/<Project ID>/locations/<Location + * ID>/agents/<Agent ID>/environments/<Environment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentsPagedResponse listDeployments(String parent) { + ListDeploymentsRequest request = ListDeploymentsRequest.newBuilder().setParent(parent).build(); + return listDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of all deployments in the specified + * [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * + *Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * ListDeploymentsRequest request = + * ListDeploymentsRequest.newBuilder() + * .setParent( + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Deployment element : deploymentsClient.listDeployments(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeploymentsPagedResponse listDeployments(ListDeploymentsRequest request) { + return listDeploymentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of all deployments in the specified + * [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * + *Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * ListDeploymentsRequest request = + * ListDeploymentsRequest.newBuilder() + * .setParent( + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deploymentsClient.listDeploymentsPagedCallable().futureCall(request); + * // Do something. + * for (Deployment element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * } + listDeploymentsPagedCallable() { + return stub.listDeploymentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the list of all deployments in the specified + * [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * + * Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * ListDeploymentsRequest request = + * ListDeploymentsRequest.newBuilder() + * .setParent( + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListDeploymentsResponse response = + * deploymentsClient.listDeploymentsCallable().call(request); + * for (Deployment element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable+ listDeploymentsCallable() { + return stub.listDeploymentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. + * + * Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * DeploymentName name = + * DeploymentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]"); + * Deployment response = deploymentsClient.getDeployment(name); + * } + * }+ * + * @param name Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. + * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/environments/<Environment ID>/deployments/<Deployment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment getDeployment(DeploymentName name) { + GetDeploymentRequest request = + GetDeploymentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. + * + *Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * String name = + * DeploymentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]") + * .toString(); + * Deployment response = deploymentsClient.getDeployment(name); + * } + * }+ * + * @param name Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. + * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + * ID>/environments/<Environment ID>/deployments/<Deployment ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment getDeployment(String name) { + GetDeploymentRequest request = GetDeploymentRequest.newBuilder().setName(name).build(); + return getDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. + * + *Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * GetDeploymentRequest request = + * GetDeploymentRequest.newBuilder() + * .setName( + * DeploymentName.of( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]") + * .toString()) + * .build(); + * Deployment response = deploymentsClient.getDeployment(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Deployment getDeployment(GetDeploymentRequest request) { + return getDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. + * + *Sample code: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * GetDeploymentRequest request = + * GetDeploymentRequest.newBuilder() + * .setName( + * DeploymentName.of( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = deploymentsClient.getDeploymentCallable().futureCall(request); + * // Do something. + * Deployment response = future.get(); + * } + * } getDeploymentCallable() { + return stub.getDeploymentCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListDeploymentsPagedResponse + extends AbstractPagedListResponse< + ListDeploymentsRequest, + ListDeploymentsResponse, + Deployment, + ListDeploymentsPage, + ListDeploymentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDeploymentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDeploymentsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDeploymentsPagedResponse(ListDeploymentsPage page) { + super(page, ListDeploymentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDeploymentsPage + extends AbstractPage< + ListDeploymentsRequest, ListDeploymentsResponse, Deployment, ListDeploymentsPage> { + + private ListDeploymentsPage( + PageContext context, + ListDeploymentsResponse response) { + super(context, response); + } + + private static ListDeploymentsPage createEmptyPage() { + return new ListDeploymentsPage(null, null); + } + + @Override + protected ListDeploymentsPage createPage( + PageContext context, + ListDeploymentsResponse response) { + return new ListDeploymentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDeploymentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDeploymentsRequest, + ListDeploymentsResponse, + Deployment, + ListDeploymentsPage, + ListDeploymentsFixedSizeCollection> { + + private ListDeploymentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDeploymentsFixedSizeCollection createEmptyCollection() { + return new ListDeploymentsFixedSizeCollection(null, 0); + } + + @Override + protected ListDeploymentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDeploymentsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/DeploymentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/DeploymentsSettings.java new file mode 100644 index 000000000..914d0ef2f --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/DeploymentsSettings.java @@ -0,0 +1,196 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.cx.v3; + +import static com.google.cloud.dialogflow.cx.v3.DeploymentsClient.ListDeploymentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.dialogflow.cx.v3.stub.DeploymentsStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DeploymentsClient}. + * + * The default instance has everything set to sensible defaults: + * + *
+ *
+ * + *- The default service address (dialogflow.googleapis.com) and default port (443) are used. + *
- Credentials are acquired automatically through Application Default Credentials. + *
- Retries are configured for idempotent methods but not for non-idempotent methods. + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getDeployment to 30 seconds: + * + *
{@code + * DeploymentsSettings.Builder deploymentsSettingsBuilder = DeploymentsSettings.newBuilder(); + * deploymentsSettingsBuilder + * .getDeploymentSettings() + * .setRetrySettings( + * deploymentsSettingsBuilder + * .getDeploymentSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * DeploymentsSettings deploymentsSettings = deploymentsSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class DeploymentsSettings extends ClientSettings{ + + /** Returns the object with the settings used for calls to listDeployments. */ + public PagedCallSettings< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings() { + return ((DeploymentsStubSettings) getStubSettings()).listDeploymentsSettings(); + } + + /** Returns the object with the settings used for calls to getDeployment. */ + public UnaryCallSettings getDeploymentSettings() { + return ((DeploymentsStubSettings) getStubSettings()).getDeploymentSettings(); + } + + public static final DeploymentsSettings create(DeploymentsStubSettings stub) throws IOException { + return new DeploymentsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DeploymentsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DeploymentsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DeploymentsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DeploymentsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DeploymentsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DeploymentsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DeploymentsStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DeploymentsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DeploymentsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DeploymentsStubSettings.newBuilder(clientContext)); + } + + protected Builder(DeploymentsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DeploymentsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DeploymentsStubSettings.newBuilder()); + } + + public DeploymentsStubSettings.Builder getStubSettingsBuilder() { + return ((DeploymentsStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction
, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listDeployments. */ + public PagedCallSettings.Builder< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings() { + return getStubSettingsBuilder().listDeploymentsSettings(); + } + + /** Returns the builder for the settings used for calls to getDeployment. */ + public UnaryCallSettings.Builder getDeploymentSettings() { + return getStubSettingsBuilder().getDeploymentSettings(); + } + + @Override + public DeploymentsSettings build() throws IOException { + return new DeploymentsSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java index a7485aa37..ad57fce01 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java @@ -184,8 +184,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) { * * {@code * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { - * String parent = - * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) { * // doThingsWith(element); * } @@ -211,9 +210,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(String parent) { * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { * ListEntityTypesRequest request = * ListEntityTypesRequest.newBuilder() - * .setParent( - * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setLanguageCode("languageCode-2092349083") * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -241,9 +238,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { * ListEntityTypesRequest request = * ListEntityTypesRequest.newBuilder() - * .setParent( - * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setLanguageCode("languageCode-2092349083") * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -272,9 +267,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { * ListEntityTypesRequest request = * ListEntityTypesRequest.newBuilder() - * .setParent( - * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setLanguageCode("languageCode-2092349083") * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -442,8 +435,7 @@ public final EntityType createEntityType(AgentName parent, EntityType entityType * *{@code * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { - * String parent = - * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * EntityType entityType = EntityType.newBuilder().build(); * EntityType response = entityTypesClient.createEntityType(parent, entityType); * } @@ -473,9 +465,7 @@ public final EntityType createEntityType(String parent, EntityType entityType) { * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { * CreateEntityTypeRequest request = * CreateEntityTypeRequest.newBuilder() - * .setParent( - * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setEntityType(EntityType.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); @@ -503,9 +493,7 @@ public final EntityType createEntityType(CreateEntityTypeRequest request) { * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { * CreateEntityTypeRequest request = * CreateEntityTypeRequest.newBuilder() - * .setParent( - * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setEntityType(EntityType.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java index 6336cdf75..034a4ce42 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java @@ -203,8 +203,7 @@ public final ListEnvironmentsPagedResponse listEnvironments(AgentName parent) { * *{@code * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { - * String parent = - * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * for (Environment element : environmentsClient.listEnvironments(parent).iterateAll()) { * // doThingsWith(element); * } @@ -233,9 +232,7 @@ public final ListEnvironmentsPagedResponse listEnvironments(String parent) { * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { * ListEnvironmentsRequest request = * ListEnvironmentsRequest.newBuilder() - * .setParent( - * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -263,9 +260,7 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { * ListEnvironmentsRequest request = * ListEnvironmentsRequest.newBuilder() - * .setParent( - * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -294,9 +289,7 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { * ListEnvironmentsRequest request = * ListEnvironmentsRequest.newBuilder() - * .setParent( - * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -425,6 +418,14 @@ public final UnaryCallablegetEnvironmentCal * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code @@ -456,12 +457,19 @@ public final OperationFuturecreateEnvironmentAsync( * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { - * String parent = - * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * Environment environment = Environment.newBuilder().build(); * Environment response = environmentsClient.createEnvironmentAsync(parent, environment).get(); * } @@ -485,15 +493,21 @@ public final OperationFuturecreateEnvironmentAsync( * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { * CreateEnvironmentRequest request = * CreateEnvironmentRequest.newBuilder() - * .setParent( - * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setEnvironment(Environment.newBuilder().build()) * .build(); * Environment response = environmentsClient.createEnvironmentAsync(request).get(); @@ -513,15 +527,21 @@ public final OperationFuturecreateEnvironmentAsync( * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { * CreateEnvironmentRequest request = * CreateEnvironmentRequest.newBuilder() - * .setParent( - * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setEnvironment(Environment.newBuilder().build()) * .build(); * OperationFuturefuture = @@ -541,15 +561,21 @@ public final OperationFuture createEnvironmentAsync( * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { * CreateEnvironmentRequest request = * CreateEnvironmentRequest.newBuilder() - * .setParent( - * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") - * .toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setEnvironment(Environment.newBuilder().build()) * .build(); * ApiFuturefuture = @@ -567,6 +593,14 @@ public final UnaryCallable createEnvironmen /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code @@ -596,6 +630,14 @@ public final OperationFutureupdateEnvironmentAsync( /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code @@ -621,6 +663,14 @@ public final OperationFutureupdateEnvironmentAsync( /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code @@ -646,6 +696,14 @@ public final OperationFutureupdateEnvironmentAsync( /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment] + * *
Sample code: * *
{@code @@ -926,6 +984,15 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( * Kicks off a continuous test under the specified * [Environment][google.cloud.dialogflow.cx.v3.Environment]. * + *This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [RunContinuousTestMetadata][google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata] - + * `response`: + * [RunContinuousTestResponse][google.cloud.dialogflow.cx.v3.RunContinuousTestResponse] + * *
Sample code: * *
{@code @@ -953,6 +1020,15 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( * Kicks off a continuous test under the specified * [Environment][google.cloud.dialogflow.cx.v3.Environment]. * + *This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [RunContinuousTestMetadata][google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata] - + * `response`: + * [RunContinuousTestResponse][google.cloud.dialogflow.cx.v3.RunContinuousTestResponse] + * *
Sample code: * *
{@code @@ -981,6 +1057,15 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( * Kicks off a continuous test under the specified * [Environment][google.cloud.dialogflow.cx.v3.Environment]. * + *This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [RunContinuousTestMetadata][google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata] - + * `response`: + * [RunContinuousTestResponse][google.cloud.dialogflow.cx.v3.RunContinuousTestResponse] + * *
Sample code: * *
{@code @@ -1042,9 +1127,7 @@ public final ListContinuousTestResultsPagedResponse listContinuousTestResults( *{@code * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { * String parent = - * ContinuousTestResultName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[CONTINUOUS_TEST_RESULT]") - * .toString(); + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]").toString(); * for (ContinuousTestResult element : * environmentsClient.listContinuousTestResults(parent).iterateAll()) { * // doThingsWith(element); @@ -1074,12 +1157,7 @@ public final ListContinuousTestResultsPagedResponse listContinuousTestResults(St * ListContinuousTestResultsRequest request = * ListContinuousTestResultsRequest.newBuilder() * .setParent( - * ContinuousTestResultName.of( - * "[PROJECT]", - * "[LOCATION]", - * "[AGENT]", - * "[ENVIRONMENT]", - * "[CONTINUOUS_TEST_RESULT]") + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -1110,12 +1188,7 @@ public final ListContinuousTestResultsPagedResponse listContinuousTestResults( * ListContinuousTestResultsRequest request = * ListContinuousTestResultsRequest.newBuilder() * .setParent( - * ContinuousTestResultName.of( - * "[PROJECT]", - * "[LOCATION]", - * "[AGENT]", - * "[ENVIRONMENT]", - * "[CONTINUOUS_TEST_RESULT]") + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -1146,12 +1219,7 @@ public final ListContinuousTestResultsPagedResponse listContinuousTestResults( * ListContinuousTestResultsRequest request = * ListContinuousTestResultsRequest.newBuilder() * .setParent( - * ContinuousTestResultName.of( - * "[PROJECT]", - * "[LOCATION]", - * "[AGENT]", - * "[ENVIRONMENT]", - * "[CONTINUOUS_TEST_RESULT]") + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -1177,6 +1245,112 @@ public final ListContinuousTestResultsPagedResponse listContinuousTestResults( return stub.listContinuousTestResultsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys a flow to the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * + *This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: [DeployFlowMetadata][google.cloud.dialogflow.cx.v3.DeployFlowMetadata] - + * `response`: [DeployFlowResponse][google.cloud.dialogflow.cx.v3.DeployFlowResponse] + * + *
Sample code: + * + *
{@code + * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { + * DeployFlowRequest request = + * DeployFlowRequest.newBuilder() + * .setEnvironment( + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + * .toString()) + * .setFlowVersion( + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + * .toString()) + * .build(); + * DeployFlowResponse response = environmentsClient.deployFlowAsync(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 + */ + public final OperationFuturedeployFlowAsync( + DeployFlowRequest request) { + return deployFlowOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys a flow to the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: [DeployFlowMetadata][google.cloud.dialogflow.cx.v3.DeployFlowMetadata] - + * `response`: [DeployFlowResponse][google.cloud.dialogflow.cx.v3.DeployFlowResponse] + * + *
Sample code: + * + *
{@code + * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { + * DeployFlowRequest request = + * DeployFlowRequest.newBuilder() + * .setEnvironment( + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + * .toString()) + * .setFlowVersion( + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + * .toString()) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * environmentsClient.deployFlowOperationCallable().futureCall(request); + * // Do something. + * DeployFlowResponse response = future.get(); + * } + * } + deployFlowOperationCallable() { + return stub.deployFlowOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deploys a flow to the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: [DeployFlowMetadata][google.cloud.dialogflow.cx.v3.DeployFlowMetadata] - + * `response`: [DeployFlowResponse][google.cloud.dialogflow.cx.v3.DeployFlowResponse] + * + *
Sample code: + * + *
{@code + * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) { + * DeployFlowRequest request = + * DeployFlowRequest.newBuilder() + * .setEnvironment( + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + * .toString()) + * .setFlowVersion( + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = environmentsClient.deployFlowCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * } deployFlowCallable() { + return stub.deployFlowCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsSettings.java index 53c80202f..7ab0aaf86 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsSettings.java @@ -143,6 +143,17 @@ public UnaryCallSettings runContinuousTestS return ((EnvironmentsStubSettings) getStubSettings()).listContinuousTestResultsSettings(); } + /** Returns the object with the settings used for calls to deployFlow. */ + public UnaryCallSettings deployFlowSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).deployFlowSettings(); + } + + /** Returns the object with the settings used for calls to deployFlow. */ + public OperationCallSettings + deployFlowOperationSettings() { + return ((EnvironmentsStubSettings) getStubSettings()).deployFlowOperationSettings(); + } + public static final EnvironmentsSettings create(EnvironmentsStubSettings stub) throws IOException { return new EnvironmentsSettings.Builder(stub.toBuilder()).build(); @@ -312,6 +323,17 @@ public UnaryCallSettings.Builder deleteEnvironm return getStubSettingsBuilder().listContinuousTestResultsSettings(); } + /** Returns the builder for the settings used for calls to deployFlow. */ + public UnaryCallSettings.Builder deployFlowSettings() { + return getStubSettingsBuilder().deployFlowSettings(); + } + + /** Returns the builder for the settings used for calls to deployFlow. */ + public OperationCallSettings.Builder + deployFlowOperationSettings() { + return getStubSettingsBuilder().deployFlowOperationSettings(); + } + @Override public EnvironmentsSettings build() throws IOException { return new EnvironmentsSettings(this); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ExperimentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ExperimentsClient.java index 6d2715e3c..6051e1001 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ExperimentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/ExperimentsClient.java @@ -189,8 +189,7 @@ public final ListExperimentsPagedResponse listExperiments(EnvironmentName parent * {@code * try (ExperimentsClient experimentsClient = ExperimentsClient.create()) { * String parent = - * ExperimentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]") - * .toString(); + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]").toString(); * for (Experiment element : experimentsClient.listExperiments(parent).iterateAll()) { * // doThingsWith(element); * } @@ -219,8 +218,7 @@ public final ListExperimentsPagedResponse listExperiments(String parent) { * ListExperimentsRequest request = * ListExperimentsRequest.newBuilder() * .setParent( - * ExperimentName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]") + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -250,8 +248,7 @@ public final ListExperimentsPagedResponse listExperiments(ListExperimentsRequest * ListExperimentsRequest request = * ListExperimentsRequest.newBuilder() * .setParent( - * ExperimentName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]") + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -282,8 +279,7 @@ public final ListExperimentsPagedResponse listExperiments(ListExperimentsRequest * ListExperimentsRequest request = * ListExperimentsRequest.newBuilder() * .setParent( - * ExperimentName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]") + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -452,8 +448,7 @@ public final Experiment createExperiment(EnvironmentName parent, Experiment expe *{@code * try (ExperimentsClient experimentsClient = ExperimentsClient.create()) { * String parent = - * ExperimentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]") - * .toString(); + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]").toString(); * Experiment experiment = Experiment.newBuilder().build(); * Experiment response = experimentsClient.createExperiment(parent, experiment); * } @@ -484,8 +479,7 @@ public final Experiment createExperiment(String parent, Experiment experiment) { * CreateExperimentRequest request = * CreateExperimentRequest.newBuilder() * .setParent( - * ExperimentName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]") + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) * .setExperiment(Experiment.newBuilder().build()) * .build(); @@ -512,8 +506,7 @@ public final Experiment createExperiment(CreateExperimentRequest request) { * CreateExperimentRequest request = * CreateExperimentRequest.newBuilder() * .setParent( - * ExperimentName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]") + * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) * .setExperiment(Experiment.newBuilder().build()) * .build(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java index 79d1543f6..c85fde22b 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java @@ -204,7 +204,7 @@ public final Flow createFlow(AgentName parent, Flow flow) { * *{@code * try (FlowsClient flowsClient = FlowsClient.create()) { - * String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * Flow flow = Flow.newBuilder().build(); * Flow response = flowsClient.createFlow(parent, flow); * } @@ -234,7 +234,7 @@ public final Flow createFlow(String parent, Flow flow) { * try (FlowsClient flowsClient = FlowsClient.create()) { * CreateFlowRequest request = * CreateFlowRequest.newBuilder() - * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setFlow(Flow.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); @@ -262,7 +262,7 @@ public final Flow createFlow(CreateFlowRequest request) { * try (FlowsClient flowsClient = FlowsClient.create()) { * CreateFlowRequest request = * CreateFlowRequest.newBuilder() - * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setFlow(Flow.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); @@ -401,7 +401,7 @@ public final ListFlowsPagedResponse listFlows(AgentName parent) { * *{@code * try (FlowsClient flowsClient = FlowsClient.create()) { - * String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * for (Flow element : flowsClient.listFlows(parent).iterateAll()) { * // doThingsWith(element); * } @@ -427,7 +427,7 @@ public final ListFlowsPagedResponse listFlows(String parent) { * try (FlowsClient flowsClient = FlowsClient.create()) { * ListFlowsRequest request = * ListFlowsRequest.newBuilder() - * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setLanguageCode("languageCode-2092349083") @@ -455,7 +455,7 @@ public final ListFlowsPagedResponse listFlows(ListFlowsRequest request) { * try (FlowsClient flowsClient = FlowsClient.create()) { * ListFlowsRequest request = * ListFlowsRequest.newBuilder() - * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setLanguageCode("languageCode-2092349083") @@ -482,7 +482,7 @@ public final UnaryCallablelistFlowsPa * try (FlowsClient flowsClient = FlowsClient.create()) { * ListFlowsRequest request = * ListFlowsRequest.newBuilder() - * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setLanguageCode("languageCode-2092349083") @@ -685,6 +685,15 @@ public final UnaryCallable updateFlowCallable() { /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Note: You should always train a flow prior to sending it queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -711,6 +720,15 @@ public final OperationFuture
trainFlowAsync(FlowName name) { /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Note: You should always train a flow prior to sending it queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -736,6 +754,15 @@ public final OperationFuture
trainFlowAsync(String name) { /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Note: You should always train a flow prior to sending it queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -762,6 +789,15 @@ public final OperationFuture
trainFlowAsync(TrainFlowRequest requ /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Note: You should always train a flow prior to sending it queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -788,6 +824,15 @@ public final OperationCallable
trainFlowOperati /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Note: You should always train a flow prior to sending it queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -973,6 +1018,14 @@ public final FlowValidationResult getFlowValidationResult( /** * Imports the specified flow to the specified agent from a binary file. * + *
This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [ImportFlowResponse][google.cloud.dialogflow.cx.v3.ImportFlowResponse] + * *
Note: You should always train a flow prior to sending it queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -982,7 +1035,7 @@ public final FlowValidationResult getFlowValidationResult( * try (FlowsClient flowsClient = FlowsClient.create()) { * ImportFlowRequest request = * ImportFlowRequest.newBuilder() - * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .build(); * ImportFlowResponse response = flowsClient.importFlowAsync(request).get(); * } @@ -1000,6 +1053,14 @@ public final OperationFuture
importFlowAsync( /** * Imports the specified flow to the specified agent from a binary file. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [ImportFlowResponse][google.cloud.dialogflow.cx.v3.ImportFlowResponse] + * *
Note: You should always train a flow prior to sending it queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -1009,7 +1070,7 @@ public final OperationFuture
importFlowAsync( * try (FlowsClient flowsClient = FlowsClient.create()) { * ImportFlowRequest request = * ImportFlowRequest.newBuilder() - * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .build(); * OperationFuture future = * flowsClient.importFlowOperationCallable().futureCall(request); @@ -1027,6 +1088,14 @@ public final OperationFuture importFlowAsync( /** * Imports the specified flow to the specified agent from a binary file. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [ImportFlowResponse][google.cloud.dialogflow.cx.v3.ImportFlowResponse] + * *
Note: You should always train a flow prior to sending it queries. See the [training * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). * @@ -1036,7 +1105,7 @@ public final OperationFuture
importFlowAsync( * try (FlowsClient flowsClient = FlowsClient.create()) { * ImportFlowRequest request = * ImportFlowRequest.newBuilder() - * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .build(); * ApiFuture future = flowsClient.importFlowCallable().futureCall(request); * // Do something. @@ -1052,6 +1121,14 @@ public final UnaryCallable importFlowCallable() { /** * Exports the specified flow to a binary file. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [ExportFlowResponse][google.cloud.dialogflow.cx.v3.ExportFlowResponse] + * *
Note that resources (e.g. intents, entities, webhooks) that the flow references will also be * exported. * @@ -1081,6 +1158,14 @@ public final OperationFuture
exportFlowAsync( /** * Exports the specified flow to a binary file. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [ExportFlowResponse][google.cloud.dialogflow.cx.v3.ExportFlowResponse] + * *
Note that resources (e.g. intents, entities, webhooks) that the flow references will also be * exported. * @@ -1110,6 +1195,14 @@ public final OperationFuture
exportFlowAsync( /** * Exports the specified flow to a binary file. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: [ExportFlowResponse][google.cloud.dialogflow.cx.v3.ExportFlowResponse] + * *
Note that resources (e.g. intents, entities, webhooks) that the flow references will also be * exported. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java index bfd368d3e..6f93919f1 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java @@ -180,7 +180,7 @@ public final ListIntentsPagedResponse listIntents(AgentName parent) { * *
{@code * try (IntentsClient intentsClient = IntentsClient.create()) { - * String parent = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * for (Intent element : intentsClient.listIntents(parent).iterateAll()) { * // doThingsWith(element); * } @@ -206,7 +206,7 @@ public final ListIntentsPagedResponse listIntents(String parent) { * try (IntentsClient intentsClient = IntentsClient.create()) { * ListIntentsRequest request = * ListIntentsRequest.newBuilder() - * .setParent(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setLanguageCode("languageCode-2092349083") * .setIntentView(IntentView.forNumber(0)) * .setPageSize(883849137) @@ -235,7 +235,7 @@ public final ListIntentsPagedResponse listIntents(ListIntentsRequest request) { * try (IntentsClient intentsClient = IntentsClient.create()) { * ListIntentsRequest request = * ListIntentsRequest.newBuilder() - * .setParent(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setLanguageCode("languageCode-2092349083") * .setIntentView(IntentView.forNumber(0)) * .setPageSize(883849137) @@ -264,7 +264,7 @@ public final ListIntentsPagedResponse listIntents(ListIntentsRequest request) { * try (IntentsClient intentsClient = IntentsClient.create()) { * ListIntentsRequest request = * ListIntentsRequest.newBuilder() - * .setParent(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setLanguageCode("languageCode-2092349083") * .setIntentView(IntentView.forNumber(0)) * .setPageSize(883849137) @@ -423,7 +423,7 @@ public final Intent createIntent(AgentName parent, Intent intent) { * *{@code * try (IntentsClient intentsClient = IntentsClient.create()) { - * String parent = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * Intent intent = Intent.newBuilder().build(); * Intent response = intentsClient.createIntent(parent, intent); * } @@ -453,7 +453,7 @@ public final Intent createIntent(String parent, Intent intent) { * try (IntentsClient intentsClient = IntentsClient.create()) { * CreateIntentRequest request = * CreateIntentRequest.newBuilder() - * .setParent(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setIntent(Intent.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); @@ -481,7 +481,7 @@ public final Intent createIntent(CreateIntentRequest request) { * try (IntentsClient intentsClient = IntentsClient.create()) { * CreateIntentRequest request = * CreateIntentRequest.newBuilder() - * .setParent(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setIntent(Intent.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java index 0d6d08487..20ada5ca2 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java @@ -178,8 +178,7 @@ public final ListPagesPagedResponse listPages(FlowName parent) { * *{@code * try (PagesClient pagesClient = PagesClient.create()) { - * String parent = - * PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString(); + * String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString(); * for (Page element : pagesClient.listPages(parent).iterateAll()) { * // doThingsWith(element); * } @@ -205,8 +204,7 @@ public final ListPagesPagedResponse listPages(String parent) { * try (PagesClient pagesClient = PagesClient.create()) { * ListPagesRequest request = * ListPagesRequest.newBuilder() - * .setParent( - * PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setLanguageCode("languageCode-2092349083") * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -234,8 +232,7 @@ public final ListPagesPagedResponse listPages(ListPagesRequest request) { * try (PagesClient pagesClient = PagesClient.create()) { * ListPagesRequest request = * ListPagesRequest.newBuilder() - * .setParent( - * PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setLanguageCode("languageCode-2092349083") * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -262,8 +259,7 @@ public final UnaryCallablelistPagesPa * try (PagesClient pagesClient = PagesClient.create()) { * ListPagesRequest request = * ListPagesRequest.newBuilder() - * .setParent( - * PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setLanguageCode("languageCode-2092349083") * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -426,8 +422,7 @@ public final Page createPage(FlowName parent, Page page) { * * {@code * try (PagesClient pagesClient = PagesClient.create()) { - * String parent = - * PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString(); + * String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString(); * Page page = Page.newBuilder().build(); * Page response = pagesClient.createPage(parent, page); * } @@ -457,8 +452,7 @@ public final Page createPage(String parent, Page page) { * try (PagesClient pagesClient = PagesClient.create()) { * CreatePageRequest request = * CreatePageRequest.newBuilder() - * .setParent( - * PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setPage(Page.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); @@ -486,8 +480,7 @@ public final Page createPage(CreatePageRequest request) { * try (PagesClient pagesClient = PagesClient.create()) { * CreatePageRequest request = * CreatePageRequest.newBuilder() - * .setParent( - * PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setPage(Page.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java index a800c4d50..774f7cc7d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java @@ -196,8 +196,7 @@ public final SecuritySettings createSecuritySettings( *{@code * try (SecuritySettingsServiceClient securitySettingsServiceClient = * SecuritySettingsServiceClient.create()) { - * String parent = - * SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]").toString(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * SecuritySettings securitySettings = SecuritySettings.newBuilder().build(); * SecuritySettings response = * securitySettingsServiceClient.createSecuritySettings(parent, securitySettings); @@ -231,9 +230,7 @@ public final SecuritySettings createSecuritySettings( * SecuritySettingsServiceClient.create()) { * CreateSecuritySettingsRequest request = * CreateSecuritySettingsRequest.newBuilder() - * .setParent( - * SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setSecuritySettings(SecuritySettings.newBuilder().build()) * .build(); * SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(request); @@ -258,9 +255,7 @@ public final SecuritySettings createSecuritySettings(CreateSecuritySettingsReque * SecuritySettingsServiceClient.create()) { * CreateSecuritySettingsRequest request = * CreateSecuritySettingsRequest.newBuilder() - * .setParent( - * SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setSecuritySettings(SecuritySettings.newBuilder().build()) * .build(); * ApiFuturefuture = @@ -505,8 +500,7 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings(LocationName * {@code * try (SecuritySettingsServiceClient securitySettingsServiceClient = * SecuritySettingsServiceClient.create()) { - * String parent = - * SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]").toString(); + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); * for (SecuritySettings element : * securitySettingsServiceClient.listSecuritySettings(parent).iterateAll()) { * // doThingsWith(element); @@ -535,9 +529,7 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings(String paren * SecuritySettingsServiceClient.create()) { * ListSecuritySettingsRequest request = * ListSecuritySettingsRequest.newBuilder() - * .setParent( - * SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -567,9 +559,7 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings( * SecuritySettingsServiceClient.create()) { * ListSecuritySettingsRequest request = * ListSecuritySettingsRequest.newBuilder() - * .setParent( - * SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -598,9 +588,7 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings( * SecuritySettingsServiceClient.create()) { * ListSecuritySettingsRequest request = * ListSecuritySettingsRequest.newBuilder() - * .setParent( - * SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") - * .toString()) + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java index 3a80a1340..6ac803cb5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java @@ -196,8 +196,8 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(SessionN *{@code * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) { * String parent = - * SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") * .toString(); * for (SessionEntityType element : * sessionEntityTypesClient.listSessionEntityTypes(parent).iterateAll()) { @@ -230,8 +230,8 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(String p * ListSessionEntityTypesRequest request = * ListSessionEntityTypesRequest.newBuilder() * .setParent( - * SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -262,8 +262,8 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes( * ListSessionEntityTypesRequest request = * ListSessionEntityTypesRequest.newBuilder() * .setParent( - * SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -293,8 +293,8 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes( * ListSessionEntityTypesRequest request = * ListSessionEntityTypesRequest.newBuilder() * .setParent( - * SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") * .toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") @@ -478,8 +478,8 @@ public final SessionEntityType createSessionEntityType( *{@code * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) { * String parent = - * SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") * .toString(); * SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); * SessionEntityType response = @@ -516,8 +516,8 @@ public final SessionEntityType createSessionEntityType( * CreateSessionEntityTypeRequest request = * CreateSessionEntityTypeRequest.newBuilder() * .setParent( - * SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") * .toString()) * .setSessionEntityType(SessionEntityType.newBuilder().build()) * .build(); @@ -543,8 +543,8 @@ public final SessionEntityType createSessionEntityType(CreateSessionEntityTypeRe * CreateSessionEntityTypeRequest request = * CreateSessionEntityTypeRequest.newBuilder() * .setParent( - * SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") * .toString()) * .setSessionEntityType(SessionEntityType.newBuilder().build()) * .build(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TestCasesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TestCasesClient.java index 5a4c0a7c3..f28dca0de 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TestCasesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TestCasesClient.java @@ -197,8 +197,7 @@ public final ListTestCasesPagedResponse listTestCases(AgentName parent) { * *{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { - * String parent = - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * for (TestCase element : testCasesClient.listTestCases(parent).iterateAll()) { * // doThingsWith(element); * } @@ -224,8 +223,7 @@ public final ListTestCasesPagedResponse listTestCases(String parent) { * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ListTestCasesRequest request = * ListTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -252,8 +250,7 @@ public final ListTestCasesPagedResponse listTestCases(ListTestCasesRequest reque * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ListTestCasesRequest request = * ListTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -280,8 +277,7 @@ public final ListTestCasesPagedResponse listTestCases(ListTestCasesRequest reque * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ListTestCasesRequest request = * ListTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -337,8 +333,7 @@ public final void batchDeleteTestCases(AgentName parent) { * *{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { - * String parent = - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * testCasesClient.batchDeleteTestCases(parent); * } * }@@ -363,8 +358,7 @@ public final void batchDeleteTestCases(String parent) { * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * BatchDeleteTestCasesRequest request = * BatchDeleteTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .addAllNames(new ArrayList()) * .build(); * testCasesClient.batchDeleteTestCases(request); @@ -388,8 +382,7 @@ public final void batchDeleteTestCases(BatchDeleteTestCasesRequest request) { * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * BatchDeleteTestCasesRequest request = * BatchDeleteTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .addAllNames(new ArrayList ()) * .build(); * ApiFuture future = testCasesClient.batchDeleteTestCasesCallable().futureCall(request); @@ -532,8 +525,7 @@ public final TestCase createTestCase(AgentName parent, TestCase testCase) { * * {@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { - * String parent = - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * TestCase testCase = TestCase.newBuilder().build(); * TestCase response = testCasesClient.createTestCase(parent, testCase); * } @@ -560,8 +552,7 @@ public final TestCase createTestCase(String parent, TestCase testCase) { * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * CreateTestCaseRequest request = * CreateTestCaseRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setTestCase(TestCase.newBuilder().build()) * .build(); * TestCase response = testCasesClient.createTestCase(request); @@ -585,8 +576,7 @@ public final TestCase createTestCase(CreateTestCaseRequest request) { * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * CreateTestCaseRequest request = * CreateTestCaseRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setTestCase(TestCase.newBuilder().build()) * .build(); * ApiFuturefuture = testCasesClient.createTestCaseCallable().futureCall(request); @@ -675,7 +665,9 @@ public final UnaryCallable updateTestCaseCallab // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Kicks off a test case run. This method is a [long-running + * Kicks off a test case run. + * + * This method is a [long-running * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The * returned `Operation` type has the following method-specific fields: * @@ -708,7 +700,9 @@ public final OperationFuture
runTestCa // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Kicks off a test case run. This method is a [long-running + * Kicks off a test case run. + * + * This method is a [long-running * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The * returned `Operation` type has the following method-specific fields: * @@ -741,7 +735,9 @@ public final OperationFuture
runTestCa // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Kicks off a test case run. This method is a [long-running + * Kicks off a test case run. + * + * This method is a [long-running * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The * returned `Operation` type has the following method-specific fields: * @@ -774,14 +770,22 @@ public final UnaryCallable
runTestCaseCallable() /** * Kicks off a batch run of test cases. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata] - + * `response`: + * [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * BatchRunTestCasesRequest request = * BatchRunTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setEnvironment( * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) @@ -803,14 +807,22 @@ public final UnaryCallablerunTestCaseCallable() /** * Kicks off a batch run of test cases. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata] - + * `response`: + * [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * BatchRunTestCasesRequest request = * BatchRunTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setEnvironment( * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) @@ -833,14 +845,22 @@ public final UnaryCallablerunTestCaseCallable() /** * Kicks off a batch run of test cases. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata] - + * `response`: + * [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * BatchRunTestCasesRequest request = * BatchRunTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setEnvironment( * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") * .toString()) @@ -909,14 +929,21 @@ public final CalculateCoverageResponse calculateCoverage(CalculateCoverageReques * cases and won't overwite any existing ones. The provided ID in the imported test case is * neglected. * + *This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata] - `response`: + * [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3.ImportTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ImportTestCasesRequest request = * ImportTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .build(); * ImportTestCasesResponse response = testCasesClient.importTestCasesAsync(request).get(); * } @@ -936,14 +963,21 @@ public final CalculateCoverageResponse calculateCoverage(CalculateCoverageReques * cases and won't overwite any existing ones. The provided ID in the imported test case is * neglected. * + *This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata] - `response`: + * [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3.ImportTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ImportTestCasesRequest request = * ImportTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .build(); * OperationFuturefuture = * testCasesClient.importTestCasesOperationCallable().futureCall(request); @@ -964,14 +998,21 @@ public final CalculateCoverageResponse calculateCoverage(CalculateCoverageReques * cases and won't overwite any existing ones. The provided ID in the imported test case is * neglected. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata] - `response`: + * [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3.ImportTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ImportTestCasesRequest request = * ImportTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .build(); * ApiFuturefuture = testCasesClient.importTestCasesCallable().futureCall(request); * // Do something. @@ -988,14 +1029,21 @@ public final UnaryCallable importTestCasesCal * Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be * applied to export a subset of test cases. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata] - `response`: + * [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3.ExportTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ExportTestCasesRequest request = * ExportTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setFilter("filter-1274492040") * .build(); * ExportTestCasesResponse response = testCasesClient.exportTestCasesAsync(request).get(); @@ -1015,14 +1063,21 @@ public final UnaryCallableimportTestCasesCal * Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be * applied to export a subset of test cases. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata] - `response`: + * [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3.ExportTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ExportTestCasesRequest request = * ExportTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setFilter("filter-1274492040") * .build(); * OperationFuturefuture = @@ -1043,14 +1098,21 @@ public final UnaryCallable importTestCasesCal * Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be * applied to export a subset of test cases. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata] - `response`: + * [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3.ExportTestCasesResponse] + * *
Sample code: * *
{@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * ExportTestCasesRequest request = * ExportTestCasesRequest.newBuilder() - * .setParent( - * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setFilter("filter-1274492040") * .build(); * ApiFuturefuture = testCasesClient.exportTestCasesCallable().futureCall(request); @@ -1101,8 +1163,7 @@ public final ListTestCaseResultsPagedResponse listTestCaseResults(TestCaseName p * {@code * try (TestCasesClient testCasesClient = TestCasesClient.create()) { * String parent = - * TestCaseResultName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]") - * .toString(); + * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString(); * for (TestCaseResult element : testCasesClient.listTestCaseResults(parent).iterateAll()) { * // doThingsWith(element); * } @@ -1132,9 +1193,7 @@ public final ListTestCaseResultsPagedResponse listTestCaseResults(String parent) * ListTestCaseResultsRequest request = * ListTestCaseResultsRequest.newBuilder() * .setParent( - * TestCaseResultName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]") - * .toString()) + * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") @@ -1164,9 +1223,7 @@ public final ListTestCaseResultsPagedResponse listTestCaseResults( * ListTestCaseResultsRequest request = * ListTestCaseResultsRequest.newBuilder() * .setParent( - * TestCaseResultName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]") - * .toString()) + * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") @@ -1196,9 +1253,7 @@ public final ListTestCaseResultsPagedResponse listTestCaseResults( * ListTestCaseResultsRequest request = * ListTestCaseResultsRequest.newBuilder() * .setParent( - * TestCaseResultName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]", "[RESULT]") - * .toString()) + * TestCaseName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TEST_CASE]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setFilter("filter-1274492040") diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java index 52bd0e970..c80d10407 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java @@ -194,10 +194,7 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(Fl *{@code * try (TransitionRouteGroupsClient transitionRouteGroupsClient = * TransitionRouteGroupsClient.create()) { - * String parent = - * TransitionRouteGroupName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") - * .toString(); + * String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString(); * for (TransitionRouteGroup element : * transitionRouteGroupsClient.listTransitionRouteGroups(parent).iterateAll()) { * // doThingsWith(element); @@ -227,14 +224,7 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(St * TransitionRouteGroupsClient.create()) { * ListTransitionRouteGroupsRequest request = * ListTransitionRouteGroupsRequest.newBuilder() - * .setParent( - * TransitionRouteGroupName.of( - * "[PROJECT]", - * "[LOCATION]", - * "[AGENT]", - * "[FLOW]", - * "[TRANSITION_ROUTE_GROUP]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setLanguageCode("languageCode-2092349083") @@ -265,14 +255,7 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( * TransitionRouteGroupsClient.create()) { * ListTransitionRouteGroupsRequest request = * ListTransitionRouteGroupsRequest.newBuilder() - * .setParent( - * TransitionRouteGroupName.of( - * "[PROJECT]", - * "[LOCATION]", - * "[AGENT]", - * "[FLOW]", - * "[TRANSITION_ROUTE_GROUP]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setLanguageCode("languageCode-2092349083") @@ -303,14 +286,7 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( * TransitionRouteGroupsClient.create()) { * ListTransitionRouteGroupsRequest request = * ListTransitionRouteGroupsRequest.newBuilder() - * .setParent( - * TransitionRouteGroupName.of( - * "[PROJECT]", - * "[LOCATION]", - * "[AGENT]", - * "[FLOW]", - * "[TRANSITION_ROUTE_GROUP]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .setLanguageCode("languageCode-2092349083") @@ -515,10 +491,7 @@ public final TransitionRouteGroup createTransitionRouteGroup( *{@code * try (TransitionRouteGroupsClient transitionRouteGroupsClient = * TransitionRouteGroupsClient.create()) { - * String parent = - * TransitionRouteGroupName.of( - * "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") - * .toString(); + * String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString(); * TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); * TransitionRouteGroup response = * transitionRouteGroupsClient.createTransitionRouteGroup(parent, transitionRouteGroup); @@ -557,14 +530,7 @@ public final TransitionRouteGroup createTransitionRouteGroup( * TransitionRouteGroupsClient.create()) { * CreateTransitionRouteGroupRequest request = * CreateTransitionRouteGroupRequest.newBuilder() - * .setParent( - * TransitionRouteGroupName.of( - * "[PROJECT]", - * "[LOCATION]", - * "[AGENT]", - * "[FLOW]", - * "[TRANSITION_ROUTE_GROUP]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setTransitionRouteGroup(TransitionRouteGroup.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); @@ -596,14 +562,7 @@ public final TransitionRouteGroup createTransitionRouteGroup( * TransitionRouteGroupsClient.create()) { * CreateTransitionRouteGroupRequest request = * CreateTransitionRouteGroupRequest.newBuilder() - * .setParent( - * TransitionRouteGroupName.of( - * "[PROJECT]", - * "[LOCATION]", - * "[AGENT]", - * "[FLOW]", - * "[TRANSITION_ROUTE_GROUP]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setTransitionRouteGroup(TransitionRouteGroup.newBuilder().build()) * .setLanguageCode("languageCode-2092349083") * .build(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java index ca85d0192..f653517ac 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java @@ -199,8 +199,7 @@ public final ListVersionsPagedResponse listVersions(FlowName parent) { * *{@code * try (VersionsClient versionsClient = VersionsClient.create()) { - * String parent = - * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]").toString(); + * String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString(); * for (Version element : versionsClient.listVersions(parent).iterateAll()) { * // doThingsWith(element); * } @@ -227,9 +226,7 @@ public final ListVersionsPagedResponse listVersions(String parent) { * try (VersionsClient versionsClient = VersionsClient.create()) { * ListVersionsRequest request = * ListVersionsRequest.newBuilder() - * .setParent( - * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -256,9 +253,7 @@ public final ListVersionsPagedResponse listVersions(ListVersionsRequest request) * try (VersionsClient versionsClient = VersionsClient.create()) { * ListVersionsRequest request = * ListVersionsRequest.newBuilder() - * .setParent( - * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -285,9 +280,7 @@ public final ListVersionsPagedResponse listVersions(ListVersionsRequest request) * try (VersionsClient versionsClient = VersionsClient.create()) { * ListVersionsRequest request = * ListVersionsRequest.newBuilder() - * .setParent( - * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -413,6 +406,14 @@ public final UnaryCallablegetVersionCallable() { * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata] + * - `response`: [Version][google.cloud.dialogflow.cx.v3.Version] + * *
Sample code: * *
{@code @@ -444,12 +445,19 @@ public final OperationFuturecreateVers * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata] + * - `response`: [Version][google.cloud.dialogflow.cx.v3.Version] + * *
Sample code: * *
{@code * try (VersionsClient versionsClient = VersionsClient.create()) { - * String parent = - * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]").toString(); + * String parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString(); * Version version = Version.newBuilder().build(); * Version response = versionsClient.createVersionAsync(parent, version).get(); * } @@ -473,15 +481,21 @@ public final OperationFuturecreateVers * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata] + * - `response`: [Version][google.cloud.dialogflow.cx.v3.Version] + * *
Sample code: * *
{@code * try (VersionsClient versionsClient = VersionsClient.create()) { * CreateVersionRequest request = * CreateVersionRequest.newBuilder() - * .setParent( - * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setVersion(Version.newBuilder().build()) * .build(); * Version response = versionsClient.createVersionAsync(request).get(); @@ -501,15 +515,21 @@ public final OperationFuturecreateVers * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata] + * - `response`: [Version][google.cloud.dialogflow.cx.v3.Version] + * *
Sample code: * *
{@code * try (VersionsClient versionsClient = VersionsClient.create()) { * CreateVersionRequest request = * CreateVersionRequest.newBuilder() - * .setParent( - * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setVersion(Version.newBuilder().build()) * .build(); * OperationFuturefuture = @@ -529,15 +549,21 @@ public final OperationFuture createVers * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: + * [CreateVersionOperationMetadata][google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata] + * - `response`: [Version][google.cloud.dialogflow.cx.v3.Version] + * *
Sample code: * *
{@code * try (VersionsClient versionsClient = VersionsClient.create()) { * CreateVersionRequest request = * CreateVersionRequest.newBuilder() - * .setParent( - * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") - * .toString()) + * .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) * .setVersion(Version.newBuilder().build()) * .build(); * ApiFuturefuture = versionsClient.createVersionCallable().futureCall(request); @@ -724,6 +750,15 @@ public final UnaryCallable deleteVersionCallable() /** * Loads resources in the specified version to the draft flow. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Sample code: * *
{@code @@ -749,6 +784,15 @@ public final OperationFutureloadVersionAsync(VersionName name) { /** * Loads resources in the specified version to the draft flow. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Sample code: * *
{@code @@ -773,6 +817,15 @@ public final OperationFutureloadVersionAsync(String name) { /** * Loads resources in the specified version to the draft flow. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Sample code: * *
{@code @@ -799,6 +852,15 @@ public final OperationFutureloadVersionAsync(LoadVersionRequest /** * Loads resources in the specified version to the draft flow. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Sample code: * *
{@code @@ -825,6 +887,15 @@ public final OperationCallableloadVersionOpe /** * Loads resources in the specified version to the draft flow. * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The + * returned `Operation` type has the following method-specific fields: + * + *
- `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * *
Sample code: * *
{@code @@ -846,6 +917,119 @@ public final UnaryCallableloadVersionCallable() return stub.loadVersionCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Compares the specified base version with target version. + * + * Sample code: + * + *
{@code + * try (VersionsClient versionsClient = VersionsClient.create()) { + * VersionName baseVersion = + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + * CompareVersionsResponse response = versionsClient.compareVersions(baseVersion); + * } + * }+ * + * @param baseVersion Required. Name of the base flow version to compare with the target version. + * Use version ID `0` to indicate the draft version of the specified flow. + *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 + */ + public final CompareVersionsResponse compareVersions(VersionName baseVersion) { + CompareVersionsRequest request = + CompareVersionsRequest.newBuilder() + .setBaseVersion(baseVersion == null ? null : baseVersion.toString()) + .build(); + return compareVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Compares the specified base version with target version. + * + *
Sample code: + * + *
{@code + * try (VersionsClient versionsClient = VersionsClient.create()) { + * String baseVersion = + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]").toString(); + * CompareVersionsResponse response = versionsClient.compareVersions(baseVersion); + * } + * }+ * + * @param baseVersion Required. Name of the base flow version to compare with the target version. + * Use version ID `0` to indicate the draft version of the specified flow. + *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 + */ + public final CompareVersionsResponse compareVersions(String baseVersion) { + CompareVersionsRequest request = + CompareVersionsRequest.newBuilder().setBaseVersion(baseVersion).build(); + return compareVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Compares the specified base version with target version. + * + *
Sample code: + * + *
{@code + * try (VersionsClient versionsClient = VersionsClient.create()) { + * CompareVersionsRequest request = + * CompareVersionsRequest.newBuilder() + * .setBaseVersion( + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + * .toString()) + * .setTargetVersion( + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + * .toString()) + * .setLanguageCode("languageCode-2092349083") + * .build(); + * CompareVersionsResponse response = versionsClient.compareVersions(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CompareVersionsResponse compareVersions(CompareVersionsRequest request) { + return compareVersionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Compares the specified base version with target version. + * + *Sample code: + * + *
{@code + * try (VersionsClient versionsClient = VersionsClient.create()) { + * CompareVersionsRequest request = + * CompareVersionsRequest.newBuilder() + * .setBaseVersion( + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + * .toString()) + * .setTargetVersion( + * VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + * .toString()) + * .setLanguageCode("languageCode-2092349083") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * versionsClient.compareVersionsCallable().futureCall(request); + * // Do something. + * CompareVersionsResponse response = future.get(); + * } + * } + compareVersionsCallable() { + return stub.compareVersionsCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java index 15c2fa80c..8ec6fef26 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java @@ -114,6 +114,12 @@ public OperationCallSettings loadVersionOpera return ((VersionsStubSettings) getStubSettings()).loadVersionOperationSettings(); } + /** Returns the object with the settings used for calls to compareVersions. */ + public UnaryCallSettings + compareVersionsSettings() { + return ((VersionsStubSettings) getStubSettings()).compareVersionsSettings(); + } + public static final VersionsSettings create(VersionsStubSettings stub) throws IOException { return new VersionsSettings.Builder(stub.toBuilder()).build(); } @@ -255,6 +261,12 @@ public UnaryCallSettings.Builder loadVersionSetti return getStubSettingsBuilder().loadVersionOperationSettings(); } + /** Returns the builder for the settings used for calls to compareVersions. */ + public UnaryCallSettings.Builder + compareVersionsSettings() { + return getStubSettingsBuilder().compareVersionsSettings(); + } + @Override public VersionsSettings build() throws IOException { return new VersionsSettings(this); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java index 58c9ff207..94dd7e08c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java @@ -181,7 +181,7 @@ public final ListWebhooksPagedResponse listWebhooks(AgentName parent) { * * {@code * try (WebhooksClient webhooksClient = WebhooksClient.create()) { - * String parent = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * for (Webhook element : webhooksClient.listWebhooks(parent).iterateAll()) { * // doThingsWith(element); * } @@ -207,8 +207,7 @@ public final ListWebhooksPagedResponse listWebhooks(String parent) { * try (WebhooksClient webhooksClient = WebhooksClient.create()) { * ListWebhooksRequest request = * ListWebhooksRequest.newBuilder() - * .setParent( - * WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -235,8 +234,7 @@ public final ListWebhooksPagedResponse listWebhooks(ListWebhooksRequest request) * try (WebhooksClient webhooksClient = WebhooksClient.create()) { * ListWebhooksRequest request = * ListWebhooksRequest.newBuilder() - * .setParent( - * WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -263,8 +261,7 @@ public final ListWebhooksPagedResponse listWebhooks(ListWebhooksRequest request) * try (WebhooksClient webhooksClient = WebhooksClient.create()) { * ListWebhooksRequest request = * ListWebhooksRequest.newBuilder() - * .setParent( - * WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setPageSize(883849137) * .setPageToken("pageToken873572522") * .build(); @@ -413,7 +410,7 @@ public final Webhook createWebhook(AgentName parent, Webhook webhook) { * *{@code * try (WebhooksClient webhooksClient = WebhooksClient.create()) { - * String parent = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString(); + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); * Webhook webhook = Webhook.newBuilder().build(); * Webhook response = webhooksClient.createWebhook(parent, webhook); * } @@ -440,8 +437,7 @@ public final Webhook createWebhook(String parent, Webhook webhook) { * try (WebhooksClient webhooksClient = WebhooksClient.create()) { * CreateWebhookRequest request = * CreateWebhookRequest.newBuilder() - * .setParent( - * WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setWebhook(Webhook.newBuilder().build()) * .build(); * Webhook response = webhooksClient.createWebhook(request); @@ -465,8 +461,7 @@ public final Webhook createWebhook(CreateWebhookRequest request) { * try (WebhooksClient webhooksClient = WebhooksClient.create()) { * CreateWebhookRequest request = * CreateWebhookRequest.newBuilder() - * .setParent( - * WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) * .setWebhook(Webhook.newBuilder().build()) * .build(); * ApiFuture* + *future = webhooksClient.createWebhookCallable().futureCall(request); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/gapic_metadata.json b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/gapic_metadata.json index 683008f78..398904795 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/gapic_metadata.json +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/gapic_metadata.json @@ -41,6 +41,36 @@ } } }, + "Changelogs": { + "clients": { + "grpc": { + "libraryClient": "ChangelogsClient", + "rpcs": { + "GetChangelog": { + "methods": ["getChangelog", "getChangelog", "getChangelog", "getChangelogCallable"] + }, + "ListChangelogs": { + "methods": ["listChangelogs", "listChangelogs", "listChangelogs", "listChangelogsPagedCallable", "listChangelogsCallable"] + } + } + } + } + }, + "Deployments": { + "clients": { + "grpc": { + "libraryClient": "DeploymentsClient", + "rpcs": { + "GetDeployment": { + "methods": ["getDeployment", "getDeployment", "getDeployment", "getDeploymentCallable"] + }, + "ListDeployments": { + "methods": ["listDeployments", "listDeployments", "listDeployments", "listDeploymentsPagedCallable", "listDeploymentsCallable"] + } + } + } + } + }, "EntityTypes": { "clients": { "grpc": { @@ -76,6 +106,9 @@ "DeleteEnvironment": { "methods": ["deleteEnvironment", "deleteEnvironment", "deleteEnvironment", "deleteEnvironmentCallable"] }, + "DeployFlow": { + "methods": ["deployFlowAsync", "deployFlowOperationCallable", "deployFlowCallable"] + }, "GetEnvironment": { "methods": ["getEnvironment", "getEnvironment", "getEnvironment", "getEnvironmentCallable"] }, @@ -358,6 +391,9 @@ "grpc": { "libraryClient": "VersionsClient", "rpcs": { + "CompareVersions": { + "methods": ["compareVersions", "compareVersions", "compareVersions", "compareVersionsCallable"] + }, "CreateVersion": { "methods": ["createVersionAsync", "createVersionAsync", "createVersionAsync", "createVersionOperationCallable", "createVersionCallable"] }, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/package-info.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/package-info.java index 3acd198fe..9a851728a 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/package-info.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/package-info.java @@ -32,6 +32,35 @@ * } * } ======================= ChangelogsClient ======================= + * + *
Service Description: Service for managing + * [Changelogs][google.cloud.dialogflow.cx.v3.Changelog]. + * + *
Sample for ChangelogsClient: + * + *
{@code + * try (ChangelogsClient changelogsClient = ChangelogsClient.create()) { + * ChangelogName name = ChangelogName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[CHANGELOG]"); + * Changelog response = changelogsClient.getChangelog(name); + * } + * }+ * + *======================= DeploymentsClient ======================= + * + *
Service Description: Service for managing + * [Deployments][google.cloud.dialogflow.cx.v3.Deployment]. + * + *
Sample for DeploymentsClient: + * + *
{@code + * try (DeploymentsClient deploymentsClient = DeploymentsClient.create()) { + * DeploymentName name = + * DeploymentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]"); + * Deployment response = deploymentsClient.getDeployment(name); + * } + * }+ * *======================= EntityTypesClient ======================= * *
Service Description: Service for managing diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/ChangelogsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/ChangelogsStub.java new file mode 100644 index 000000000..83130880e --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/ChangelogsStub.java @@ -0,0 +1,53 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.cx.v3.stub; + +import static com.google.cloud.dialogflow.cx.v3.ChangelogsClient.ListChangelogsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3.Changelog; +import com.google.cloud.dialogflow.cx.v3.GetChangelogRequest; +import com.google.cloud.dialogflow.cx.v3.ListChangelogsRequest; +import com.google.cloud.dialogflow.cx.v3.ListChangelogsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Changelogs service API. + * + *
This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ChangelogsStub implements BackgroundResource { + + public UnaryCallable
+ listChangelogsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listChangelogsPagedCallable()"); + } + + public UnaryCallable listChangelogsCallable() { + throw new UnsupportedOperationException("Not implemented: listChangelogsCallable()"); + } + + public UnaryCallable getChangelogCallable() { + throw new UnsupportedOperationException("Not implemented: getChangelogCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/ChangelogsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/ChangelogsStubSettings.java new file mode 100644 index 000000000..e7dc4cb5c --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/ChangelogsStubSettings.java @@ -0,0 +1,371 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.cx.v3.stub; + +import static com.google.cloud.dialogflow.cx.v3.ChangelogsClient.ListChangelogsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3.Changelog; +import com.google.cloud.dialogflow.cx.v3.GetChangelogRequest; +import com.google.cloud.dialogflow.cx.v3.ListChangelogsRequest; +import com.google.cloud.dialogflow.cx.v3.ListChangelogsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ChangelogsStub}. + * + * The default instance has everything set to sensible defaults: + * + *
+ *
+ * + *- The default service address (dialogflow.googleapis.com) and default port (443) are used. + *
- Credentials are acquired automatically through Application Default Credentials. + *
- Retries are configured for idempotent methods but not for non-idempotent methods. + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getChangelog to 30 seconds: + * + *
{@code + * ChangelogsStubSettings.Builder changelogsSettingsBuilder = ChangelogsStubSettings.newBuilder(); + * changelogsSettingsBuilder + * .getChangelogSettings() + * .setRetrySettings( + * changelogsSettingsBuilder + * .getChangelogSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * ChangelogsStubSettings changelogsSettings = changelogsSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class ChangelogsStubSettings extends StubSettings{ + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList. builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings< + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> + listChangelogsSettings; + private final UnaryCallSettings getChangelogSettings; + + private static final PagedListDescriptor + LIST_CHANGELOGS_PAGE_STR_DESC = + new PagedListDescriptor () { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListChangelogsRequest injectToken(ListChangelogsRequest payload, String token) { + return ListChangelogsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListChangelogsRequest injectPageSize( + ListChangelogsRequest payload, int pageSize) { + return ListChangelogsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListChangelogsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListChangelogsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListChangelogsResponse payload) { + return payload.getChangelogsList() == null + ? ImmutableList. of() + : payload.getChangelogsList(); + } + }; + + private static final PagedListResponseFactory< + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> + LIST_CHANGELOGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListChangelogsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CHANGELOGS_PAGE_STR_DESC, request, context); + return ListChangelogsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listChangelogs. */ + public PagedCallSettings< + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> + listChangelogsSettings() { + return listChangelogsSettings; + } + + /** Returns the object with the settings used for calls to getChangelog. */ + public UnaryCallSettings getChangelogSettings() { + return getChangelogSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ChangelogsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcChangelogsStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "dialogflow.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "dialogflow.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ChangelogsStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ChangelogsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listChangelogsSettings = settingsBuilder.listChangelogsSettings().build(); + getChangelogSettings = settingsBuilder.getChangelogSettings().build(); + } + + /** Builder for ChangelogsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList > unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> + listChangelogsSettings; + private final UnaryCallSettings.Builder getChangelogSettings; + private static final ImmutableMap > + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder > definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists. newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listChangelogsSettings = PagedCallSettings.newBuilder(LIST_CHANGELOGS_PAGE_STR_FACT); + getChangelogSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList. >of( + listChangelogsSettings, getChangelogSettings); + initDefaults(this); + } + + protected Builder(ChangelogsStubSettings settings) { + super(settings); + + listChangelogsSettings = settings.listChangelogsSettings.toBuilder(); + getChangelogSettings = settings.getChangelogSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList. >of( + listChangelogsSettings, getChangelogSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listChangelogsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getChangelogSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + * Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction
, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList > unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listChangelogs. */ + public PagedCallSettings.Builder< + ListChangelogsRequest, ListChangelogsResponse, ListChangelogsPagedResponse> + listChangelogsSettings() { + return listChangelogsSettings; + } + + /** Returns the builder for the settings used for calls to getChangelog. */ + public UnaryCallSettings.Builder getChangelogSettings() { + return getChangelogSettings; + } + + @Override + public ChangelogsStubSettings build() throws IOException { + return new ChangelogsStubSettings(this); + } + } +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/DeploymentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/DeploymentsStub.java new file mode 100644 index 000000000..935fec5fd --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/DeploymentsStub.java @@ -0,0 +1,53 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.cx.v3.stub; + +import static com.google.cloud.dialogflow.cx.v3.DeploymentsClient.ListDeploymentsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3.Deployment; +import com.google.cloud.dialogflow.cx.v3.GetDeploymentRequest; +import com.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest; +import com.google.cloud.dialogflow.cx.v3.ListDeploymentsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Deployments service API. + * + * This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class DeploymentsStub implements BackgroundResource { + + public UnaryCallable
+ listDeploymentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDeploymentsPagedCallable()"); + } + + public UnaryCallable listDeploymentsCallable() { + throw new UnsupportedOperationException("Not implemented: listDeploymentsCallable()"); + } + + public UnaryCallable getDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: getDeploymentCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/DeploymentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/DeploymentsStubSettings.java new file mode 100644 index 000000000..a26bb0be3 --- /dev/null +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/DeploymentsStubSettings.java @@ -0,0 +1,374 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.cx.v3.stub; + +import static com.google.cloud.dialogflow.cx.v3.DeploymentsClient.ListDeploymentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dialogflow.cx.v3.Deployment; +import com.google.cloud.dialogflow.cx.v3.GetDeploymentRequest; +import com.google.cloud.dialogflow.cx.v3.ListDeploymentsRequest; +import com.google.cloud.dialogflow.cx.v3.ListDeploymentsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DeploymentsStub}. + * + * The default instance has everything set to sensible defaults: + * + *
+ *
+ * + *- The default service address (dialogflow.googleapis.com) and default port (443) are used. + *
- Credentials are acquired automatically through Application Default Credentials. + *
- Retries are configured for idempotent methods but not for non-idempotent methods. + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getDeployment to 30 seconds: + * + *
{@code + * DeploymentsStubSettings.Builder deploymentsSettingsBuilder = + * DeploymentsStubSettings.newBuilder(); + * deploymentsSettingsBuilder + * .getDeploymentSettings() + * .setRetrySettings( + * deploymentsSettingsBuilder + * .getDeploymentSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * DeploymentsStubSettings deploymentsSettings = deploymentsSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class DeploymentsStubSettings extends StubSettings{ + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList. builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/dialogflow") + .build(); + + private final PagedCallSettings< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings; + private final UnaryCallSettings getDeploymentSettings; + + private static final PagedListDescriptor< + ListDeploymentsRequest, ListDeploymentsResponse, Deployment> + LIST_DEPLOYMENTS_PAGE_STR_DESC = + new PagedListDescriptor () { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDeploymentsRequest injectToken( + ListDeploymentsRequest payload, String token) { + return ListDeploymentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDeploymentsRequest injectPageSize( + ListDeploymentsRequest payload, int pageSize) { + return ListDeploymentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDeploymentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDeploymentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDeploymentsResponse payload) { + return payload.getDeploymentsList() == null + ? ImmutableList. of() + : payload.getDeploymentsList(); + } + }; + + private static final PagedListResponseFactory< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + LIST_DEPLOYMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDeploymentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DEPLOYMENTS_PAGE_STR_DESC, request, context); + return ListDeploymentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listDeployments. */ + public PagedCallSettings< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings() { + return listDeploymentsSettings; + } + + /** Returns the object with the settings used for calls to getDeployment. */ + public UnaryCallSettings getDeploymentSettings() { + return getDeploymentSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DeploymentsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDeploymentsStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "dialogflow.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "dialogflow.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DeploymentsStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DeploymentsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listDeploymentsSettings = settingsBuilder.listDeploymentsSettings().build(); + getDeploymentSettings = settingsBuilder.getDeploymentSettings().build(); + } + + /** Builder for DeploymentsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList > unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListDeploymentsRequest, ListDeploymentsResponse, ListDeploymentsPagedResponse> + listDeploymentsSettings; + private final UnaryCallSettings.Builder getDeploymentSettings; + private static final ImmutableMap > + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder > definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists. newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listDeploymentsSettings = PagedCallSettings.newBuilder(LIST_DEPLOYMENTS_PAGE_STR_FACT); + getDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList. >of( + listDeploymentsSettings, getDeploymentSettings); + initDefaults(this); + } + + protected Builder(DeploymentsStubSettings settings) { + super(settings); + + listDeploymentsSettings = settings.listDeploymentsSettings.toBuilder(); + getDeploymentSettings = settings.getDeploymentSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.