Skip to content

Commit

Permalink
feat: [dialogflow-cx] Added persist_parameter_changes field from `que…
Browse files Browse the repository at this point in the history
…ry_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: googleapis/googleapis-gen@99ede80
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Mar 1, 2023
1 parent e20803d commit c6d7b9a
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 68 deletions.
2 changes: 0 additions & 2 deletions java-dialogflow-cx/README.md
Expand Up @@ -17,7 +17,6 @@ Java idiomatic client for [Dialogflow CX][product-docs].

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

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

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

## Authentication

Expand Down
Expand Up @@ -328,6 +328,7 @@ public final UnaryCallable<DetectIntentRequest, DetectIntentResponse> detectInte
* .toString())
* .setQueryParams(QueryParameters.newBuilder().build())
* .setQueryInput(QueryInput.newBuilder().build())
* .setPersistParameterChanges(true)
* .build();
* MatchIntentResponse response = sessionsClient.matchIntent(request);
* }
Expand Down Expand Up @@ -361,6 +362,7 @@ public final MatchIntentResponse matchIntent(MatchIntentRequest request) {
* .toString())
* .setQueryParams(QueryParameters.newBuilder().build())
* .setQueryInput(QueryInput.newBuilder().build())
* .setPersistParameterChanges(true)
* .build();
* ApiFuture<MatchIntentResponse> future =
* sessionsClient.matchIntentCallable().futureCall(request);
Expand Down
Expand Up @@ -171,6 +171,7 @@ public void matchIntentTest() throws Exception {
.toString())
.setQueryParams(QueryParameters.newBuilder().build())
.setQueryInput(QueryInput.newBuilder().build())
.setPersistParameterChanges(true)
.build();

MatchIntentResponse actualResponse = client.matchIntent(request);
Expand Down Expand Up @@ -207,6 +208,7 @@ public void matchIntentExceptionTest() throws Exception {
.toString())
.setQueryParams(QueryParameters.newBuilder().build())
.setQueryInput(QueryInput.newBuilder().build())
.setPersistParameterChanges(true)
.build();
client.matchIntent(request);
Assert.fail("No exception raised");
Expand Down Expand Up @@ -236,6 +238,7 @@ public void fulfillIntentTest() throws Exception {
.toString())
.setQueryParams(QueryParameters.newBuilder().build())
.setQueryInput(QueryInput.newBuilder().build())
.setPersistParameterChanges(true)
.build())
.setMatch(Match.newBuilder().build())
.setOutputAudioConfig(OutputAudioConfig.newBuilder().build())
Expand Down Expand Up @@ -277,6 +280,7 @@ public void fulfillIntentExceptionTest() throws Exception {
.toString())
.setQueryParams(QueryParameters.newBuilder().build())
.setQueryInput(QueryInput.newBuilder().build())
.setPersistParameterChanges(true)
.build())
.setMatch(Match.newBuilder().build())
.setOutputAudioConfig(OutputAudioConfig.newBuilder().build())
Expand Down
Expand Up @@ -241,6 +241,7 @@ public void matchIntentTest() throws Exception {
.toString())
.setQueryParams(QueryParameters.newBuilder().build())
.setQueryInput(QueryInput.newBuilder().build())
.setPersistParameterChanges(true)
.build();

MatchIntentResponse actualResponse = client.matchIntent(request);
Expand All @@ -253,6 +254,8 @@ public void matchIntentTest() throws Exception {
Assert.assertEquals(request.getSession(), actualRequest.getSession());
Assert.assertEquals(request.getQueryParams(), actualRequest.getQueryParams());
Assert.assertEquals(request.getQueryInput(), actualRequest.getQueryInput());
Assert.assertEquals(
request.getPersistParameterChanges(), actualRequest.getPersistParameterChanges());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -273,6 +276,7 @@ public void matchIntentExceptionTest() throws Exception {
.toString())
.setQueryParams(QueryParameters.newBuilder().build())
.setQueryInput(QueryInput.newBuilder().build())
.setPersistParameterChanges(true)
.build();
client.matchIntent(request);
Assert.fail("No exception raised");
Expand Down
Expand Up @@ -248,6 +248,24 @@ public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputO
: queryInput_;
}

public static final int PERSIST_PARAMETER_CHANGES_FIELD_NUMBER = 5;
private boolean persistParameterChanges_ = false;
/**
*
*
* <pre>
* Persist session parameter changes from `query_params`.
* </pre>
*
* <code>bool persist_parameter_changes = 5;</code>
*
* @return The persistParameterChanges.
*/
@java.lang.Override
public boolean getPersistParameterChanges() {
return persistParameterChanges_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand All @@ -271,6 +289,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (queryInput_ != null) {
output.writeMessage(3, getQueryInput());
}
if (persistParameterChanges_ != false) {
output.writeBool(5, persistParameterChanges_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -289,6 +310,9 @@ public int getSerializedSize() {
if (queryInput_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQueryInput());
}
if (persistParameterChanges_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, persistParameterChanges_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -314,6 +338,7 @@ public boolean equals(final java.lang.Object obj) {
if (hasQueryInput()) {
if (!getQueryInput().equals(other.getQueryInput())) return false;
}
if (getPersistParameterChanges() != other.getPersistParameterChanges()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -335,6 +360,8 @@ public int hashCode() {
hash = (37 * hash) + QUERY_INPUT_FIELD_NUMBER;
hash = (53 * hash) + getQueryInput().hashCode();
}
hash = (37 * hash) + PERSIST_PARAMETER_CHANGES_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPersistParameterChanges());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -486,6 +513,7 @@ public Builder clear() {
queryInputBuilder_.dispose();
queryInputBuilder_ = null;
}
persistParameterChanges_ = false;
return this;
}

Expand Down Expand Up @@ -532,6 +560,9 @@ private void buildPartial0(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentReq
if (((from_bitField0_ & 0x00000004) != 0)) {
result.queryInput_ = queryInputBuilder_ == null ? queryInput_ : queryInputBuilder_.build();
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.persistParameterChanges_ = persistParameterChanges_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -591,6 +622,9 @@ public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentReque
if (other.hasQueryInput()) {
mergeQueryInput(other.getQueryInput());
}
if (other.getPersistParameterChanges() != false) {
setPersistParameterChanges(other.getPersistParameterChanges());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -635,6 +669,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000004;
break;
} // case 26
case 40:
{
persistParameterChanges_ = input.readBool();
bitField0_ |= 0x00000008;
break;
} // case 40
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -1209,6 +1249,59 @@ public com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputO
return queryInputBuilder_;
}

private boolean persistParameterChanges_;
/**
*
*
* <pre>
* Persist session parameter changes from `query_params`.
* </pre>
*
* <code>bool persist_parameter_changes = 5;</code>
*
* @return The persistParameterChanges.
*/
@java.lang.Override
public boolean getPersistParameterChanges() {
return persistParameterChanges_;
}
/**
*
*
* <pre>
* Persist session parameter changes from `query_params`.
* </pre>
*
* <code>bool persist_parameter_changes = 5;</code>
*
* @param value The persistParameterChanges to set.
* @return This builder for chaining.
*/
public Builder setPersistParameterChanges(boolean value) {

persistParameterChanges_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
* <pre>
* Persist session parameter changes from `query_params`.
* </pre>
*
* <code>bool persist_parameter_changes = 5;</code>
*
* @return This builder for chaining.
*/
public Builder clearPersistParameterChanges() {
bitField0_ = (bitField0_ & ~0x00000008);
persistParameterChanges_ = false;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Expand Up @@ -147,4 +147,17 @@ public interface MatchIntentRequestOrBuilder
* </code>
*/
com.google.cloud.dialogflow.cx.v3beta1.QueryInputOrBuilder getQueryInputOrBuilder();

/**
*
*
* <pre>
* Persist session parameter changes from `query_params`.
* </pre>
*
* <code>bool persist_parameter_changes = 5;</code>
*
* @return The persistParameterChanges.
*/
boolean getPersistParameterChanges();
}

0 comments on commit c6d7b9a

Please sign in to comment.