Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 1d581ad

Browse files
feat: allow setting custom CA for generic webhooks and release CompareVersions API docs: clarify DLP template reader usage (#362)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 410299375 Source-Link: googleapis/googleapis@4a4ec6d Source-Link: https://github.com/googleapis/googleapis-gen/commit/043e044ca963a15966d50f4c2b21bfbd73afaa94 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDQzZTA0NGNhOTYzYTE1OTY2ZDUwZjRjMmIyMWJmYmQ3M2FmYWE5NCJ9
1 parent dd9ce6e commit 1d581ad

File tree

55 files changed

+5033
-1153
lines changed

Some content is hidden

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

55 files changed

+5033
-1153
lines changed

google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java

Lines changed: 131 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ public final OperationsClient getOperationsClient() {
179179
* }</pre>
180180
*
181181
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions
182-
* for. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
183-
* ID&gt;/flows/&lt;Flow ID&gt;`.
182+
* for. Format:
183+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;`.
184184
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
185185
*/
186186
public final ListVersionsPagedResponse listVersions(FlowName parent) {
@@ -207,8 +207,8 @@ public final ListVersionsPagedResponse listVersions(FlowName parent) {
207207
* }</pre>
208208
*
209209
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions
210-
* for. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
211-
* ID&gt;/flows/&lt;Flow ID&gt;`.
210+
* for. Format:
211+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;`.
212212
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
213213
*/
214214
public final ListVersionsPagedResponse listVersions(String parent) {
@@ -318,8 +318,7 @@ public final UnaryCallable<ListVersionsRequest, ListVersionsResponse> listVersio
318318
* }</pre>
319319
*
320320
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. Format:
321-
* `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
322-
* ID&gt;/flows/&lt;Flow ID&gt;/versions/&lt;Version ID&gt;`.
321+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
323322
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
324323
*/
325324
public final Version getVersion(VersionName name) {
@@ -343,8 +342,7 @@ public final Version getVersion(VersionName name) {
343342
* }</pre>
344343
*
345344
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. Format:
346-
* `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
347-
* ID&gt;/flows/&lt;Flow ID&gt;/versions/&lt;Version ID&gt;`.
345+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
348346
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
349347
*/
350348
public final Version getVersion(String name) {
@@ -425,8 +423,8 @@ public final UnaryCallable<GetVersionRequest, Version> getVersionCallable() {
425423
* }</pre>
426424
*
427425
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an
428-
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: `projects/&lt;Project
429-
* ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;/flows/&lt;Flow ID&gt;`.
426+
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format:
427+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;`.
430428
* @param version Required. The version to create.
431429
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
432430
*/
@@ -464,8 +462,8 @@ public final OperationFuture<Version, CreateVersionOperationMetadata> createVers
464462
* }</pre>
465463
*
466464
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an
467-
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: `projects/&lt;Project
468-
* ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;/flows/&lt;Flow ID&gt;`.
465+
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format:
466+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;`.
469467
* @param version Required. The version to create.
470468
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
471469
*/
@@ -663,8 +661,8 @@ public final UnaryCallable<UpdateVersionRequest, Version> updateVersionCallable(
663661
* }</pre>
664662
*
665663
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to
666-
* delete. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
667-
* ID&gt;/flows/&lt;Flow ID&gt;/versions/&lt;Version ID&gt;`.
664+
* delete. Format:
665+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
668666
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
669667
*/
670668
public final void deleteVersion(VersionName name) {
@@ -688,8 +686,8 @@ public final void deleteVersion(VersionName name) {
688686
* }</pre>
689687
*
690688
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to
691-
* delete. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
692-
* ID&gt;/flows/&lt;Flow ID&gt;/versions/&lt;Version ID&gt;`.
689+
* delete. Format:
690+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
693691
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
694692
*/
695693
public final void deleteVersion(String name) {
@@ -770,8 +768,8 @@ public final UnaryCallable<DeleteVersionRequest, Empty> deleteVersionCallable()
770768
* }</pre>
771769
*
772770
* @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to
773-
* draft flow. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
774-
* ID&gt;/agents/&lt;Agent ID&gt;/flows/&lt;Flow ID&gt;/versions/&lt;Version ID&gt;`.
771+
* draft flow. Format:
772+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
775773
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
776774
*/
777775
public final OperationFuture<Empty, Struct> loadVersionAsync(VersionName name) {
@@ -804,8 +802,8 @@ public final OperationFuture<Empty, Struct> loadVersionAsync(VersionName name) {
804802
* }</pre>
805803
*
806804
* @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to
807-
* draft flow. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
808-
* ID&gt;/agents/&lt;Agent ID&gt;/flows/&lt;Flow ID&gt;/versions/&lt;Version ID&gt;`.
805+
* draft flow. Format:
806+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
809807
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
810808
*/
811809
public final OperationFuture<Empty, Struct> loadVersionAsync(String name) {
@@ -917,6 +915,119 @@ public final UnaryCallable<LoadVersionRequest, Operation> loadVersionCallable()
917915
return stub.loadVersionCallable();
918916
}
919917

918+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
919+
/**
920+
* Compares the specified base version with target version.
921+
*
922+
* <p>Sample code:
923+
*
924+
* <pre>{@code
925+
* try (VersionsClient versionsClient = VersionsClient.create()) {
926+
* VersionName baseVersion =
927+
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
928+
* CompareVersionsResponse response = versionsClient.compareVersions(baseVersion);
929+
* }
930+
* }</pre>
931+
*
932+
* @param baseVersion Required. Name of the base flow version to compare with the target version.
933+
* Use version ID `0` to indicate the draft version of the specified flow.
934+
* <p>Format:
935+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
936+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
937+
*/
938+
public final CompareVersionsResponse compareVersions(VersionName baseVersion) {
939+
CompareVersionsRequest request =
940+
CompareVersionsRequest.newBuilder()
941+
.setBaseVersion(baseVersion == null ? null : baseVersion.toString())
942+
.build();
943+
return compareVersions(request);
944+
}
945+
946+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
947+
/**
948+
* Compares the specified base version with target version.
949+
*
950+
* <p>Sample code:
951+
*
952+
* <pre>{@code
953+
* try (VersionsClient versionsClient = VersionsClient.create()) {
954+
* String baseVersion =
955+
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]").toString();
956+
* CompareVersionsResponse response = versionsClient.compareVersions(baseVersion);
957+
* }
958+
* }</pre>
959+
*
960+
* @param baseVersion Required. Name of the base flow version to compare with the target version.
961+
* Use version ID `0` to indicate the draft version of the specified flow.
962+
* <p>Format:
963+
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
964+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
965+
*/
966+
public final CompareVersionsResponse compareVersions(String baseVersion) {
967+
CompareVersionsRequest request =
968+
CompareVersionsRequest.newBuilder().setBaseVersion(baseVersion).build();
969+
return compareVersions(request);
970+
}
971+
972+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
973+
/**
974+
* Compares the specified base version with target version.
975+
*
976+
* <p>Sample code:
977+
*
978+
* <pre>{@code
979+
* try (VersionsClient versionsClient = VersionsClient.create()) {
980+
* CompareVersionsRequest request =
981+
* CompareVersionsRequest.newBuilder()
982+
* .setBaseVersion(
983+
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]")
984+
* .toString())
985+
* .setTargetVersion(
986+
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]")
987+
* .toString())
988+
* .setLanguageCode("languageCode-2092349083")
989+
* .build();
990+
* CompareVersionsResponse response = versionsClient.compareVersions(request);
991+
* }
992+
* }</pre>
993+
*
994+
* @param request The request object containing all of the parameters for the API call.
995+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
996+
*/
997+
public final CompareVersionsResponse compareVersions(CompareVersionsRequest request) {
998+
return compareVersionsCallable().call(request);
999+
}
1000+
1001+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1002+
/**
1003+
* Compares the specified base version with target version.
1004+
*
1005+
* <p>Sample code:
1006+
*
1007+
* <pre>{@code
1008+
* try (VersionsClient versionsClient = VersionsClient.create()) {
1009+
* CompareVersionsRequest request =
1010+
* CompareVersionsRequest.newBuilder()
1011+
* .setBaseVersion(
1012+
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]")
1013+
* .toString())
1014+
* .setTargetVersion(
1015+
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]")
1016+
* .toString())
1017+
* .setLanguageCode("languageCode-2092349083")
1018+
* .build();
1019+
* ApiFuture<CompareVersionsResponse> future =
1020+
* versionsClient.compareVersionsCallable().futureCall(request);
1021+
* // Do something.
1022+
* CompareVersionsResponse response = future.get();
1023+
* }
1024+
* }</pre>
1025+
*/
1026+
public final UnaryCallable<CompareVersionsRequest, CompareVersionsResponse>
1027+
compareVersionsCallable() {
1028+
return stub.compareVersionsCallable();
1029+
}
1030+
9201031
@Override
9211032
public final void close() {
9221033
stub.close();

google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ public OperationCallSettings<LoadVersionRequest, Empty, Struct> loadVersionOpera
114114
return ((VersionsStubSettings) getStubSettings()).loadVersionOperationSettings();
115115
}
116116

117+
/** Returns the object with the settings used for calls to compareVersions. */
118+
public UnaryCallSettings<CompareVersionsRequest, CompareVersionsResponse>
119+
compareVersionsSettings() {
120+
return ((VersionsStubSettings) getStubSettings()).compareVersionsSettings();
121+
}
122+
117123
public static final VersionsSettings create(VersionsStubSettings stub) throws IOException {
118124
return new VersionsSettings.Builder(stub.toBuilder()).build();
119125
}
@@ -255,6 +261,12 @@ public UnaryCallSettings.Builder<LoadVersionRequest, Operation> loadVersionSetti
255261
return getStubSettingsBuilder().loadVersionOperationSettings();
256262
}
257263

264+
/** Returns the builder for the settings used for calls to compareVersions. */
265+
public UnaryCallSettings.Builder<CompareVersionsRequest, CompareVersionsResponse>
266+
compareVersionsSettings() {
267+
return getStubSettingsBuilder().compareVersionsSettings();
268+
}
269+
258270
@Override
259271
public VersionsSettings build() throws IOException {
260272
return new VersionsSettings(this);

google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@
391391
"grpc": {
392392
"libraryClient": "VersionsClient",
393393
"rpcs": {
394+
"CompareVersions": {
395+
"methods": ["compareVersions", "compareVersions", "compareVersions", "compareVersionsCallable"]
396+
},
394397
"CreateVersion": {
395398
"methods": ["createVersionAsync", "createVersionAsync", "createVersionAsync", "createVersionOperationCallable", "createVersionCallable"]
396399
},

google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.google.api.gax.rpc.ClientContext;
2626
import com.google.api.gax.rpc.OperationCallable;
2727
import com.google.api.gax.rpc.UnaryCallable;
28+
import com.google.cloud.dialogflow.cx.v3.CompareVersionsRequest;
29+
import com.google.cloud.dialogflow.cx.v3.CompareVersionsResponse;
2830
import com.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata;
2931
import com.google.cloud.dialogflow.cx.v3.CreateVersionRequest;
3032
import com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest;
@@ -107,6 +109,17 @@ public class GrpcVersionsStub extends VersionsStub {
107109
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
108110
.build();
109111

112+
private static final MethodDescriptor<CompareVersionsRequest, CompareVersionsResponse>
113+
compareVersionsMethodDescriptor =
114+
MethodDescriptor.<CompareVersionsRequest, CompareVersionsResponse>newBuilder()
115+
.setType(MethodDescriptor.MethodType.UNARY)
116+
.setFullMethodName("google.cloud.dialogflow.cx.v3.Versions/CompareVersions")
117+
.setRequestMarshaller(
118+
ProtoUtils.marshaller(CompareVersionsRequest.getDefaultInstance()))
119+
.setResponseMarshaller(
120+
ProtoUtils.marshaller(CompareVersionsResponse.getDefaultInstance()))
121+
.build();
122+
110123
private final UnaryCallable<ListVersionsRequest, ListVersionsResponse> listVersionsCallable;
111124
private final UnaryCallable<ListVersionsRequest, ListVersionsPagedResponse>
112125
listVersionsPagedCallable;
@@ -118,6 +131,8 @@ public class GrpcVersionsStub extends VersionsStub {
118131
private final UnaryCallable<DeleteVersionRequest, Empty> deleteVersionCallable;
119132
private final UnaryCallable<LoadVersionRequest, Operation> loadVersionCallable;
120133
private final OperationCallable<LoadVersionRequest, Empty, Struct> loadVersionOperationCallable;
134+
private final UnaryCallable<CompareVersionsRequest, CompareVersionsResponse>
135+
compareVersionsCallable;
121136

122137
private final BackgroundResource backgroundResources;
123138
private final GrpcOperationsStub operationsStub;
@@ -218,6 +233,17 @@ protected GrpcVersionsStub(
218233
return params.build();
219234
})
220235
.build();
236+
GrpcCallSettings<CompareVersionsRequest, CompareVersionsResponse>
237+
compareVersionsTransportSettings =
238+
GrpcCallSettings.<CompareVersionsRequest, CompareVersionsResponse>newBuilder()
239+
.setMethodDescriptor(compareVersionsMethodDescriptor)
240+
.setParamsExtractor(
241+
request -> {
242+
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
243+
params.put("base_version", String.valueOf(request.getBaseVersion()));
244+
return params.build();
245+
})
246+
.build();
221247

222248
this.listVersionsCallable =
223249
callableFactory.createUnaryCallable(
@@ -252,6 +278,9 @@ protected GrpcVersionsStub(
252278
settings.loadVersionOperationSettings(),
253279
clientContext,
254280
operationsStub);
281+
this.compareVersionsCallable =
282+
callableFactory.createUnaryCallable(
283+
compareVersionsTransportSettings, settings.compareVersionsSettings(), clientContext);
255284

256285
this.backgroundResources =
257286
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
@@ -307,6 +336,11 @@ public OperationCallable<LoadVersionRequest, Empty, Struct> loadVersionOperation
307336
return loadVersionOperationCallable;
308337
}
309338

339+
@Override
340+
public UnaryCallable<CompareVersionsRequest, CompareVersionsResponse> compareVersionsCallable() {
341+
return compareVersionsCallable;
342+
}
343+
310344
@Override
311345
public final void close() {
312346
try {

google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStub.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import com.google.api.gax.core.BackgroundResource;
2222
import com.google.api.gax.rpc.OperationCallable;
2323
import com.google.api.gax.rpc.UnaryCallable;
24+
import com.google.cloud.dialogflow.cx.v3.CompareVersionsRequest;
25+
import com.google.cloud.dialogflow.cx.v3.CompareVersionsResponse;
2426
import com.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata;
2527
import com.google.cloud.dialogflow.cx.v3.CreateVersionRequest;
2628
import com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest;
@@ -86,6 +88,10 @@ public UnaryCallable<LoadVersionRequest, Operation> loadVersionCallable() {
8688
throw new UnsupportedOperationException("Not implemented: loadVersionCallable()");
8789
}
8890

91+
public UnaryCallable<CompareVersionsRequest, CompareVersionsResponse> compareVersionsCallable() {
92+
throw new UnsupportedOperationException("Not implemented: compareVersionsCallable()");
93+
}
94+
8995
@Override
9096
public abstract void close();
9197
}

0 commit comments

Comments
 (0)