Skip to content

Commit 59f9d8c

Browse files
feat: [dialogflow-cx] add support for AdvancedSettings (#9918)
* feat: add support for AdvancedSettings feat: add Intent import/export APIs feat: add Inline destination chore: remove the extraneous backend config PiperOrigin-RevId: 569217741 Source-Link: googleapis/googleapis@f91419c Source-Link: https://github.com/googleapis/googleapis-gen/commit/0f779fa21b349c00882615f5072b635833f8a6e5 Copy-Tag: eyJwIjoiamF2YS1kaWFsb2dmbG93LWN4Ly5Pd2xCb3QueWFtbCIsImgiOiIwZjc3OWZhMjFiMzQ5YzAwODgyNjE1ZjUwNzJiNjM1ODMzZjhhNmU1In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 2502903 commit 59f9d8c

File tree

64 files changed

+15884
-631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+15884
-631
lines changed

java-dialogflow-cx/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,20 @@ If you are using Maven without the BOM, add this to your dependencies:
4545
<dependency>
4646
<groupId>com.google.cloud</groupId>
4747
<artifactId>google-cloud-dialogflow-cx</artifactId>
48-
<version>0.37.0</version>
48+
<version>0.35.0</version>
4949
</dependency>
5050
```
5151

5252
If you are using Gradle without BOM, add this to your dependencies:
5353

5454
```Groovy
55-
implementation 'com.google.cloud:google-cloud-dialogflow-cx:0.37.0'
55+
implementation 'com.google.cloud:google-cloud-dialogflow-cx:0.35.0'
5656
```
5757

5858
If you are using SBT, add this to your dependencies:
5959

6060
```Scala
61-
libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow-cx" % "0.37.0"
61+
libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow-cx" % "0.35.0"
6262
```
6363
<!-- {x-version-update-end} -->
6464

java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java

+250
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020
import com.google.api.core.ApiFutures;
2121
import com.google.api.core.BetaApi;
2222
import com.google.api.gax.core.BackgroundResource;
23+
import com.google.api.gax.httpjson.longrunning.OperationsClient;
24+
import com.google.api.gax.longrunning.OperationFuture;
2325
import com.google.api.gax.paging.AbstractFixedSizeCollection;
2426
import com.google.api.gax.paging.AbstractPage;
2527
import com.google.api.gax.paging.AbstractPagedListResponse;
28+
import com.google.api.gax.rpc.OperationCallable;
2629
import com.google.api.gax.rpc.PageContext;
2730
import com.google.api.gax.rpc.UnaryCallable;
2831
import com.google.cloud.dialogflow.cx.v3beta1.stub.IntentsStub;
@@ -32,6 +35,7 @@
3235
import com.google.cloud.location.ListLocationsResponse;
3336
import com.google.cloud.location.Location;
3437
import com.google.common.util.concurrent.MoreExecutors;
38+
import com.google.longrunning.Operation;
3539
import com.google.protobuf.Empty;
3640
import com.google.protobuf.FieldMask;
3741
import java.io.IOException;
@@ -131,6 +135,8 @@
131135
public class IntentsClient implements BackgroundResource {
132136
private final IntentsSettings settings;
133137
private final IntentsStub stub;
138+
private final OperationsClient httpJsonOperationsClient;
139+
private final com.google.longrunning.OperationsClient operationsClient;
134140

135141
/** Constructs an instance of IntentsClient with default settings. */
136142
public static final IntentsClient create() throws IOException {
@@ -160,11 +166,17 @@ public static final IntentsClient create(IntentsStub stub) {
160166
protected IntentsClient(IntentsSettings settings) throws IOException {
161167
this.settings = settings;
162168
this.stub = ((IntentsStubSettings) settings.getStubSettings()).createStub();
169+
this.operationsClient =
170+
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
171+
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
163172
}
164173

165174
protected IntentsClient(IntentsStub stub) {
166175
this.settings = null;
167176
this.stub = stub;
177+
this.operationsClient =
178+
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
179+
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
168180
}
169181

170182
public final IntentsSettings getSettings() {
@@ -175,6 +187,23 @@ public IntentsStub getStub() {
175187
return stub;
176188
}
177189

190+
/**
191+
* Returns the OperationsClient that can be used to query the status of a long-running operation
192+
* returned by another API method call.
193+
*/
194+
public final com.google.longrunning.OperationsClient getOperationsClient() {
195+
return operationsClient;
196+
}
197+
198+
/**
199+
* Returns the OperationsClient that can be used to query the status of a long-running operation
200+
* returned by another API method call.
201+
*/
202+
@BetaApi
203+
public final OperationsClient getHttpJsonOperationsClient() {
204+
return httpJsonOperationsClient;
205+
}
206+
178207
// AUTO-GENERATED DOCUMENTATION AND METHOD.
179208
/**
180209
* Returns the list of all intents in the specified agent.
@@ -810,6 +839,227 @@ public final UnaryCallable<DeleteIntentRequest, Empty> deleteIntentCallable() {
810839
return stub.deleteIntentCallable();
811840
}
812841

842+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
843+
/**
844+
* Imports the specified intents into the agent.
845+
*
846+
* <p>This method is a [long-running
847+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
848+
* returned `Operation` type has the following method-specific fields:
849+
*
850+
* <p>- `metadata`:
851+
* [ImportIntentsMetadata][google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata] - `response`:
852+
* [ImportIntentsResponse][google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse]
853+
*
854+
* <p>Sample code:
855+
*
856+
* <pre>{@code
857+
* // This snippet has been automatically generated and should be regarded as a code template only.
858+
* // It will require modifications to work:
859+
* // - It may require correct/in-range values for request initialization.
860+
* // - It may require specifying regional endpoints when creating the service client as shown in
861+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
862+
* try (IntentsClient intentsClient = IntentsClient.create()) {
863+
* ImportIntentsRequest request =
864+
* ImportIntentsRequest.newBuilder()
865+
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
866+
* .build();
867+
* ImportIntentsResponse response = intentsClient.importIntentsAsync(request).get();
868+
* }
869+
* }</pre>
870+
*
871+
* @param request The request object containing all of the parameters for the API call.
872+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
873+
*/
874+
public final OperationFuture<ImportIntentsResponse, ImportIntentsMetadata> importIntentsAsync(
875+
ImportIntentsRequest request) {
876+
return importIntentsOperationCallable().futureCall(request);
877+
}
878+
879+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
880+
/**
881+
* Imports the specified intents into the agent.
882+
*
883+
* <p>This method is a [long-running
884+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
885+
* returned `Operation` type has the following method-specific fields:
886+
*
887+
* <p>- `metadata`:
888+
* [ImportIntentsMetadata][google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata] - `response`:
889+
* [ImportIntentsResponse][google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse]
890+
*
891+
* <p>Sample code:
892+
*
893+
* <pre>{@code
894+
* // This snippet has been automatically generated and should be regarded as a code template only.
895+
* // It will require modifications to work:
896+
* // - It may require correct/in-range values for request initialization.
897+
* // - It may require specifying regional endpoints when creating the service client as shown in
898+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
899+
* try (IntentsClient intentsClient = IntentsClient.create()) {
900+
* ImportIntentsRequest request =
901+
* ImportIntentsRequest.newBuilder()
902+
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
903+
* .build();
904+
* OperationFuture<ImportIntentsResponse, ImportIntentsMetadata> future =
905+
* intentsClient.importIntentsOperationCallable().futureCall(request);
906+
* // Do something.
907+
* ImportIntentsResponse response = future.get();
908+
* }
909+
* }</pre>
910+
*/
911+
public final OperationCallable<ImportIntentsRequest, ImportIntentsResponse, ImportIntentsMetadata>
912+
importIntentsOperationCallable() {
913+
return stub.importIntentsOperationCallable();
914+
}
915+
916+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
917+
/**
918+
* Imports the specified intents into the agent.
919+
*
920+
* <p>This method is a [long-running
921+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
922+
* returned `Operation` type has the following method-specific fields:
923+
*
924+
* <p>- `metadata`:
925+
* [ImportIntentsMetadata][google.cloud.dialogflow.cx.v3beta1.ImportIntentsMetadata] - `response`:
926+
* [ImportIntentsResponse][google.cloud.dialogflow.cx.v3beta1.ImportIntentsResponse]
927+
*
928+
* <p>Sample code:
929+
*
930+
* <pre>{@code
931+
* // This snippet has been automatically generated and should be regarded as a code template only.
932+
* // It will require modifications to work:
933+
* // - It may require correct/in-range values for request initialization.
934+
* // - It may require specifying regional endpoints when creating the service client as shown in
935+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
936+
* try (IntentsClient intentsClient = IntentsClient.create()) {
937+
* ImportIntentsRequest request =
938+
* ImportIntentsRequest.newBuilder()
939+
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
940+
* .build();
941+
* ApiFuture<Operation> future = intentsClient.importIntentsCallable().futureCall(request);
942+
* // Do something.
943+
* Operation response = future.get();
944+
* }
945+
* }</pre>
946+
*/
947+
public final UnaryCallable<ImportIntentsRequest, Operation> importIntentsCallable() {
948+
return stub.importIntentsCallable();
949+
}
950+
951+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
952+
/**
953+
* Exports the selected intents.
954+
*
955+
* <p>This method is a [long-running
956+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
957+
* returned `Operation` type has the following method-specific fields:
958+
*
959+
* <p>- `metadata`:
960+
* [ExportIntentsMetadata][google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata] - `response`:
961+
* [ExportIntentsResponse][google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse]
962+
*
963+
* <p>Sample code:
964+
*
965+
* <pre>{@code
966+
* // This snippet has been automatically generated and should be regarded as a code template only.
967+
* // It will require modifications to work:
968+
* // - It may require correct/in-range values for request initialization.
969+
* // - It may require specifying regional endpoints when creating the service client as shown in
970+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
971+
* try (IntentsClient intentsClient = IntentsClient.create()) {
972+
* ExportIntentsRequest request =
973+
* ExportIntentsRequest.newBuilder()
974+
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
975+
* .addAllIntents(new ArrayList<String>())
976+
* .build();
977+
* ExportIntentsResponse response = intentsClient.exportIntentsAsync(request).get();
978+
* }
979+
* }</pre>
980+
*
981+
* @param request The request object containing all of the parameters for the API call.
982+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
983+
*/
984+
public final OperationFuture<ExportIntentsResponse, ExportIntentsMetadata> exportIntentsAsync(
985+
ExportIntentsRequest request) {
986+
return exportIntentsOperationCallable().futureCall(request);
987+
}
988+
989+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
990+
/**
991+
* Exports the selected intents.
992+
*
993+
* <p>This method is a [long-running
994+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
995+
* returned `Operation` type has the following method-specific fields:
996+
*
997+
* <p>- `metadata`:
998+
* [ExportIntentsMetadata][google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata] - `response`:
999+
* [ExportIntentsResponse][google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse]
1000+
*
1001+
* <p>Sample code:
1002+
*
1003+
* <pre>{@code
1004+
* // This snippet has been automatically generated and should be regarded as a code template only.
1005+
* // It will require modifications to work:
1006+
* // - It may require correct/in-range values for request initialization.
1007+
* // - It may require specifying regional endpoints when creating the service client as shown in
1008+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1009+
* try (IntentsClient intentsClient = IntentsClient.create()) {
1010+
* ExportIntentsRequest request =
1011+
* ExportIntentsRequest.newBuilder()
1012+
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
1013+
* .addAllIntents(new ArrayList<String>())
1014+
* .build();
1015+
* OperationFuture<ExportIntentsResponse, ExportIntentsMetadata> future =
1016+
* intentsClient.exportIntentsOperationCallable().futureCall(request);
1017+
* // Do something.
1018+
* ExportIntentsResponse response = future.get();
1019+
* }
1020+
* }</pre>
1021+
*/
1022+
public final OperationCallable<ExportIntentsRequest, ExportIntentsResponse, ExportIntentsMetadata>
1023+
exportIntentsOperationCallable() {
1024+
return stub.exportIntentsOperationCallable();
1025+
}
1026+
1027+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1028+
/**
1029+
* Exports the selected intents.
1030+
*
1031+
* <p>This method is a [long-running
1032+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
1033+
* returned `Operation` type has the following method-specific fields:
1034+
*
1035+
* <p>- `metadata`:
1036+
* [ExportIntentsMetadata][google.cloud.dialogflow.cx.v3beta1.ExportIntentsMetadata] - `response`:
1037+
* [ExportIntentsResponse][google.cloud.dialogflow.cx.v3beta1.ExportIntentsResponse]
1038+
*
1039+
* <p>Sample code:
1040+
*
1041+
* <pre>{@code
1042+
* // This snippet has been automatically generated and should be regarded as a code template only.
1043+
* // It will require modifications to work:
1044+
* // - It may require correct/in-range values for request initialization.
1045+
* // - It may require specifying regional endpoints when creating the service client as shown in
1046+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1047+
* try (IntentsClient intentsClient = IntentsClient.create()) {
1048+
* ExportIntentsRequest request =
1049+
* ExportIntentsRequest.newBuilder()
1050+
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
1051+
* .addAllIntents(new ArrayList<String>())
1052+
* .build();
1053+
* ApiFuture<Operation> future = intentsClient.exportIntentsCallable().futureCall(request);
1054+
* // Do something.
1055+
* Operation response = future.get();
1056+
* }
1057+
* }</pre>
1058+
*/
1059+
public final UnaryCallable<ExportIntentsRequest, Operation> exportIntentsCallable() {
1060+
return stub.exportIntentsCallable();
1061+
}
1062+
8131063
// AUTO-GENERATED DOCUMENTATION AND METHOD.
8141064
/**
8151065
* Lists information about the supported locations for this service.

java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsSettings.java

+48
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.api.gax.rpc.ApiClientHeaderProvider;
2929
import com.google.api.gax.rpc.ClientContext;
3030
import com.google.api.gax.rpc.ClientSettings;
31+
import com.google.api.gax.rpc.OperationCallSettings;
3132
import com.google.api.gax.rpc.PagedCallSettings;
3233
import com.google.api.gax.rpc.TransportChannelProvider;
3334
import com.google.api.gax.rpc.UnaryCallSettings;
@@ -36,6 +37,7 @@
3637
import com.google.cloud.location.ListLocationsRequest;
3738
import com.google.cloud.location.ListLocationsResponse;
3839
import com.google.cloud.location.Location;
40+
import com.google.longrunning.Operation;
3941
import com.google.protobuf.Empty;
4042
import java.io.IOException;
4143
import java.util.List;
@@ -107,6 +109,28 @@ public UnaryCallSettings<DeleteIntentRequest, Empty> deleteIntentSettings() {
107109
return ((IntentsStubSettings) getStubSettings()).deleteIntentSettings();
108110
}
109111

112+
/** Returns the object with the settings used for calls to importIntents. */
113+
public UnaryCallSettings<ImportIntentsRequest, Operation> importIntentsSettings() {
114+
return ((IntentsStubSettings) getStubSettings()).importIntentsSettings();
115+
}
116+
117+
/** Returns the object with the settings used for calls to importIntents. */
118+
public OperationCallSettings<ImportIntentsRequest, ImportIntentsResponse, ImportIntentsMetadata>
119+
importIntentsOperationSettings() {
120+
return ((IntentsStubSettings) getStubSettings()).importIntentsOperationSettings();
121+
}
122+
123+
/** Returns the object with the settings used for calls to exportIntents. */
124+
public UnaryCallSettings<ExportIntentsRequest, Operation> exportIntentsSettings() {
125+
return ((IntentsStubSettings) getStubSettings()).exportIntentsSettings();
126+
}
127+
128+
/** Returns the object with the settings used for calls to exportIntents. */
129+
public OperationCallSettings<ExportIntentsRequest, ExportIntentsResponse, ExportIntentsMetadata>
130+
exportIntentsOperationSettings() {
131+
return ((IntentsStubSettings) getStubSettings()).exportIntentsOperationSettings();
132+
}
133+
110134
/** Returns the object with the settings used for calls to listLocations. */
111135
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
112136
listLocationsSettings() {
@@ -259,6 +283,30 @@ public UnaryCallSettings.Builder<DeleteIntentRequest, Empty> deleteIntentSetting
259283
return getStubSettingsBuilder().deleteIntentSettings();
260284
}
261285

286+
/** Returns the builder for the settings used for calls to importIntents. */
287+
public UnaryCallSettings.Builder<ImportIntentsRequest, Operation> importIntentsSettings() {
288+
return getStubSettingsBuilder().importIntentsSettings();
289+
}
290+
291+
/** Returns the builder for the settings used for calls to importIntents. */
292+
public OperationCallSettings.Builder<
293+
ImportIntentsRequest, ImportIntentsResponse, ImportIntentsMetadata>
294+
importIntentsOperationSettings() {
295+
return getStubSettingsBuilder().importIntentsOperationSettings();
296+
}
297+
298+
/** Returns the builder for the settings used for calls to exportIntents. */
299+
public UnaryCallSettings.Builder<ExportIntentsRequest, Operation> exportIntentsSettings() {
300+
return getStubSettingsBuilder().exportIntentsSettings();
301+
}
302+
303+
/** Returns the builder for the settings used for calls to exportIntents. */
304+
public OperationCallSettings.Builder<
305+
ExportIntentsRequest, ExportIntentsResponse, ExportIntentsMetadata>
306+
exportIntentsOperationSettings() {
307+
return getStubSettingsBuilder().exportIntentsOperationSettings();
308+
}
309+
262310
/** Returns the builder for the settings used for calls to listLocations. */
263311
public PagedCallSettings.Builder<
264312
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

0 commit comments

Comments
 (0)