Skip to content

Commit c6d7b9a

Browse files
feat: [dialogflow-cx] Added persist_parameter_changes field from query_params to MatchIntentRequest (#9168)
* feat: Added persist_parameter_changes field from `query_params` to MatchIntentRequest PiperOrigin-RevId: 513016804 Source-Link: googleapis/googleapis@388f408 Source-Link: https://github.com/googleapis/googleapis-gen/commit/99ede80d3d167cc396a6ba85e0ba9495abb6097f Copy-Tag: eyJwIjoiamF2YS1kaWFsb2dmbG93LWN4Ly5Pd2xCb3QueWFtbCIsImgiOiI5OWVkZTgwZDNkMTY3Y2MzOTZhNmJhODVlMGJhOTQ5NWFiYjYwOTdmIn0= * 🦉 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 e20803d commit c6d7b9a

File tree

10 files changed

+188
-68
lines changed

10 files changed

+188
-68
lines changed

java-dialogflow-cx/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Java idiomatic client for [Dialogflow CX][product-docs].
1717

1818
If you are using Maven, add this to your pom.xml file:
1919

20-
<!--- {x-version-update-start:google-cloud-dialogflow-cx:released} -->
2120

2221
```xml
2322
<dependency>
@@ -38,7 +37,6 @@ If you are using SBT, add this to your dependencies:
3837
```Scala
3938
libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow-cx" % "0.22.0"
4039
```
41-
<!--- {x-version-update-end} -->
4240

4341
## Authentication
4442

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

+2
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ public final UnaryCallable<DetectIntentRequest, DetectIntentResponse> detectInte
328328
* .toString())
329329
* .setQueryParams(QueryParameters.newBuilder().build())
330330
* .setQueryInput(QueryInput.newBuilder().build())
331+
* .setPersistParameterChanges(true)
331332
* .build();
332333
* MatchIntentResponse response = sessionsClient.matchIntent(request);
333334
* }
@@ -361,6 +362,7 @@ public final MatchIntentResponse matchIntent(MatchIntentRequest request) {
361362
* .toString())
362363
* .setQueryParams(QueryParameters.newBuilder().build())
363364
* .setQueryInput(QueryInput.newBuilder().build())
365+
* .setPersistParameterChanges(true)
364366
* .build();
365367
* ApiFuture<MatchIntentResponse> future =
366368
* sessionsClient.matchIntentCallable().futureCall(request);

java-dialogflow-cx/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientHttpJsonTest.java

+4
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public void matchIntentTest() throws Exception {
171171
.toString())
172172
.setQueryParams(QueryParameters.newBuilder().build())
173173
.setQueryInput(QueryInput.newBuilder().build())
174+
.setPersistParameterChanges(true)
174175
.build();
175176

176177
MatchIntentResponse actualResponse = client.matchIntent(request);
@@ -207,6 +208,7 @@ public void matchIntentExceptionTest() throws Exception {
207208
.toString())
208209
.setQueryParams(QueryParameters.newBuilder().build())
209210
.setQueryInput(QueryInput.newBuilder().build())
211+
.setPersistParameterChanges(true)
210212
.build();
211213
client.matchIntent(request);
212214
Assert.fail("No exception raised");
@@ -236,6 +238,7 @@ public void fulfillIntentTest() throws Exception {
236238
.toString())
237239
.setQueryParams(QueryParameters.newBuilder().build())
238240
.setQueryInput(QueryInput.newBuilder().build())
241+
.setPersistParameterChanges(true)
239242
.build())
240243
.setMatch(Match.newBuilder().build())
241244
.setOutputAudioConfig(OutputAudioConfig.newBuilder().build())
@@ -277,6 +280,7 @@ public void fulfillIntentExceptionTest() throws Exception {
277280
.toString())
278281
.setQueryParams(QueryParameters.newBuilder().build())
279282
.setQueryInput(QueryInput.newBuilder().build())
283+
.setPersistParameterChanges(true)
280284
.build())
281285
.setMatch(Match.newBuilder().build())
282286
.setOutputAudioConfig(OutputAudioConfig.newBuilder().build())

java-dialogflow-cx/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java

+4
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ public void matchIntentTest() throws Exception {
241241
.toString())
242242
.setQueryParams(QueryParameters.newBuilder().build())
243243
.setQueryInput(QueryInput.newBuilder().build())
244+
.setPersistParameterChanges(true)
244245
.build();
245246

246247
MatchIntentResponse actualResponse = client.matchIntent(request);
@@ -253,6 +254,8 @@ public void matchIntentTest() throws Exception {
253254
Assert.assertEquals(request.getSession(), actualRequest.getSession());
254255
Assert.assertEquals(request.getQueryParams(), actualRequest.getQueryParams());
255256
Assert.assertEquals(request.getQueryInput(), actualRequest.getQueryInput());
257+
Assert.assertEquals(
258+
request.getPersistParameterChanges(), actualRequest.getPersistParameterChanges());
256259
Assert.assertTrue(
257260
channelProvider.isHeaderSent(
258261
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -273,6 +276,7 @@ public void matchIntentExceptionTest() throws Exception {
273276
.toString())
274277
.setQueryParams(QueryParameters.newBuilder().build())
275278
.setQueryInput(QueryInput.newBuilder().build())
279+
.setPersistParameterChanges(true)
276280
.build();
277281
client.matchIntent(request);
278282
Assert.fail("No exception raised");

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

+93
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,24 @@ public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputO
248248
: queryInput_;
249249
}
250250

251+
public static final int PERSIST_PARAMETER_CHANGES_FIELD_NUMBER = 5;
252+
private boolean persistParameterChanges_ = false;
253+
/**
254+
*
255+
*
256+
* <pre>
257+
* Persist session parameter changes from `query_params`.
258+
* </pre>
259+
*
260+
* <code>bool persist_parameter_changes = 5;</code>
261+
*
262+
* @return The persistParameterChanges.
263+
*/
264+
@java.lang.Override
265+
public boolean getPersistParameterChanges() {
266+
return persistParameterChanges_;
267+
}
268+
251269
private byte memoizedIsInitialized = -1;
252270

253271
@java.lang.Override
@@ -271,6 +289,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
271289
if (queryInput_ != null) {
272290
output.writeMessage(3, getQueryInput());
273291
}
292+
if (persistParameterChanges_ != false) {
293+
output.writeBool(5, persistParameterChanges_);
294+
}
274295
getUnknownFields().writeTo(output);
275296
}
276297

@@ -289,6 +310,9 @@ public int getSerializedSize() {
289310
if (queryInput_ != null) {
290311
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQueryInput());
291312
}
313+
if (persistParameterChanges_ != false) {
314+
size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, persistParameterChanges_);
315+
}
292316
size += getUnknownFields().getSerializedSize();
293317
memoizedSize = size;
294318
return size;
@@ -314,6 +338,7 @@ public boolean equals(final java.lang.Object obj) {
314338
if (hasQueryInput()) {
315339
if (!getQueryInput().equals(other.getQueryInput())) return false;
316340
}
341+
if (getPersistParameterChanges() != other.getPersistParameterChanges()) return false;
317342
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
318343
return true;
319344
}
@@ -335,6 +360,8 @@ public int hashCode() {
335360
hash = (37 * hash) + QUERY_INPUT_FIELD_NUMBER;
336361
hash = (53 * hash) + getQueryInput().hashCode();
337362
}
363+
hash = (37 * hash) + PERSIST_PARAMETER_CHANGES_FIELD_NUMBER;
364+
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPersistParameterChanges());
338365
hash = (29 * hash) + getUnknownFields().hashCode();
339366
memoizedHashCode = hash;
340367
return hash;
@@ -486,6 +513,7 @@ public Builder clear() {
486513
queryInputBuilder_.dispose();
487514
queryInputBuilder_ = null;
488515
}
516+
persistParameterChanges_ = false;
489517
return this;
490518
}
491519

@@ -532,6 +560,9 @@ private void buildPartial0(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentReq
532560
if (((from_bitField0_ & 0x00000004) != 0)) {
533561
result.queryInput_ = queryInputBuilder_ == null ? queryInput_ : queryInputBuilder_.build();
534562
}
563+
if (((from_bitField0_ & 0x00000008) != 0)) {
564+
result.persistParameterChanges_ = persistParameterChanges_;
565+
}
535566
}
536567

537568
@java.lang.Override
@@ -591,6 +622,9 @@ public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentReque
591622
if (other.hasQueryInput()) {
592623
mergeQueryInput(other.getQueryInput());
593624
}
625+
if (other.getPersistParameterChanges() != false) {
626+
setPersistParameterChanges(other.getPersistParameterChanges());
627+
}
594628
this.mergeUnknownFields(other.getUnknownFields());
595629
onChanged();
596630
return this;
@@ -635,6 +669,12 @@ public Builder mergeFrom(
635669
bitField0_ |= 0x00000004;
636670
break;
637671
} // case 26
672+
case 40:
673+
{
674+
persistParameterChanges_ = input.readBool();
675+
bitField0_ |= 0x00000008;
676+
break;
677+
} // case 40
638678
default:
639679
{
640680
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -1209,6 +1249,59 @@ public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputO
12091249
return queryInputBuilder_;
12101250
}
12111251

1252+
private boolean persistParameterChanges_;
1253+
/**
1254+
*
1255+
*
1256+
* <pre>
1257+
* Persist session parameter changes from `query_params`.
1258+
* </pre>
1259+
*
1260+
* <code>bool persist_parameter_changes = 5;</code>
1261+
*
1262+
* @return The persistParameterChanges.
1263+
*/
1264+
@java.lang.Override
1265+
public boolean getPersistParameterChanges() {
1266+
return persistParameterChanges_;
1267+
}
1268+
/**
1269+
*
1270+
*
1271+
* <pre>
1272+
* Persist session parameter changes from `query_params`.
1273+
* </pre>
1274+
*
1275+
* <code>bool persist_parameter_changes = 5;</code>
1276+
*
1277+
* @param value The persistParameterChanges to set.
1278+
* @return This builder for chaining.
1279+
*/
1280+
public Builder setPersistParameterChanges(boolean value) {
1281+
1282+
persistParameterChanges_ = value;
1283+
bitField0_ |= 0x00000008;
1284+
onChanged();
1285+
return this;
1286+
}
1287+
/**
1288+
*
1289+
*
1290+
* <pre>
1291+
* Persist session parameter changes from `query_params`.
1292+
* </pre>
1293+
*
1294+
* <code>bool persist_parameter_changes = 5;</code>
1295+
*
1296+
* @return This builder for chaining.
1297+
*/
1298+
public Builder clearPersistParameterChanges() {
1299+
bitField0_ = (bitField0_ & ~0x00000008);
1300+
persistParameterChanges_ = false;
1301+
onChanged();
1302+
return this;
1303+
}
1304+
12121305
@java.lang.Override
12131306
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
12141307
return super.setUnknownFields(unknownFields);

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

+13
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,17 @@ public interface MatchIntentRequestOrBuilder
147147
* </code>
148148
*/
149149
com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder();
150+
151+
/**
152+
*
153+
*
154+
* <pre>
155+
* Persist session parameter changes from `query_params`.
156+
* </pre>
157+
*
158+
* <code>bool persist_parameter_changes = 5;</code>
159+
*
160+
* @return The persistParameterChanges.
161+
*/
162+
boolean getPersistParameterChanges();
150163
}

0 commit comments

Comments
 (0)