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

Commit 22344ef

Browse files
feat: expose matched event in Sessions API. (#83)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/f3c880c7-daa4-4d19-8cea-a8cf9bd3e014/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 342188199 Source-Link: googleapis/googleapis@836f0ea
1 parent 1dfecac commit 22344ef

File tree

5 files changed

+321
-86
lines changed

5 files changed

+321
-86
lines changed

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

+208
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ private Match(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
3838
}
3939

4040
private Match() {
41+
event_ = "";
4142
resolvedInput_ = "";
4243
matchType_ = 0;
4344
}
@@ -121,6 +122,13 @@ private Match(
121122
confidence_ = input.readFloat();
122123
break;
123124
}
125+
case 50:
126+
{
127+
java.lang.String s = input.readStringRequireUtf8();
128+
129+
event_ = s;
130+
break;
131+
}
124132
default:
125133
{
126134
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -225,6 +233,16 @@ public enum MatchType implements com.google.protobuf.ProtocolMessageEnum {
225233
* <code>NO_INPUT = 5;</code>
226234
*/
227235
NO_INPUT(5),
236+
/**
237+
*
238+
*
239+
* <pre>
240+
* The query directly triggered an event.
241+
* </pre>
242+
*
243+
* <code>EVENT = 6;</code>
244+
*/
245+
EVENT(6),
228246
UNRECOGNIZED(-1),
229247
;
230248

@@ -288,6 +306,16 @@ public enum MatchType implements com.google.protobuf.ProtocolMessageEnum {
288306
* <code>NO_INPUT = 5;</code>
289307
*/
290308
public static final int NO_INPUT_VALUE = 5;
309+
/**
310+
*
311+
*
312+
* <pre>
313+
* The query directly triggered an event.
314+
* </pre>
315+
*
316+
* <code>EVENT = 6;</code>
317+
*/
318+
public static final int EVENT_VALUE = 6;
291319

292320
public final int getNumber() {
293321
if (this == UNRECOGNIZED) {
@@ -325,6 +353,8 @@ public static MatchType forNumber(int value) {
325353
return NO_MATCH;
326354
case 5:
327355
return NO_INPUT;
356+
case 6:
357+
return EVENT;
328358
default:
329359
return null;
330360
}
@@ -432,6 +462,57 @@ public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder
432462
return getIntent();
433463
}
434464

465+
public static final int EVENT_FIELD_NUMBER = 6;
466+
private volatile java.lang.Object event_;
467+
/**
468+
*
469+
*
470+
* <pre>
471+
* The event that matched the query. Only filled for
472+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
473+
* </pre>
474+
*
475+
* <code>string event = 6;</code>
476+
*
477+
* @return The event.
478+
*/
479+
@java.lang.Override
480+
public java.lang.String getEvent() {
481+
java.lang.Object ref = event_;
482+
if (ref instanceof java.lang.String) {
483+
return (java.lang.String) ref;
484+
} else {
485+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
486+
java.lang.String s = bs.toStringUtf8();
487+
event_ = s;
488+
return s;
489+
}
490+
}
491+
/**
492+
*
493+
*
494+
* <pre>
495+
* The event that matched the query. Only filled for
496+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
497+
* </pre>
498+
*
499+
* <code>string event = 6;</code>
500+
*
501+
* @return The bytes for event.
502+
*/
503+
@java.lang.Override
504+
public com.google.protobuf.ByteString getEventBytes() {
505+
java.lang.Object ref = event_;
506+
if (ref instanceof java.lang.String) {
507+
com.google.protobuf.ByteString b =
508+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
509+
event_ = b;
510+
return b;
511+
} else {
512+
return (com.google.protobuf.ByteString) ref;
513+
}
514+
}
515+
435516
public static final int PARAMETERS_FIELD_NUMBER = 2;
436517
private com.google.protobuf.Struct parameters_;
437518
/**
@@ -659,6 +740,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
659740
if (confidence_ != 0F) {
660741
output.writeFloat(5, confidence_);
661742
}
743+
if (!getEventBytes().isEmpty()) {
744+
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, event_);
745+
}
662746
unknownFields.writeTo(output);
663747
}
664748

@@ -685,6 +769,9 @@ public int getSerializedSize() {
685769
if (confidence_ != 0F) {
686770
size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, confidence_);
687771
}
772+
if (!getEventBytes().isEmpty()) {
773+
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, event_);
774+
}
688775
size += unknownFields.getSerializedSize();
689776
memoizedSize = size;
690777
return size;
@@ -705,6 +792,7 @@ public boolean equals(final java.lang.Object obj) {
705792
if (hasIntent()) {
706793
if (!getIntent().equals(other.getIntent())) return false;
707794
}
795+
if (!getEvent().equals(other.getEvent())) return false;
708796
if (hasParameters() != other.hasParameters()) return false;
709797
if (hasParameters()) {
710798
if (!getParameters().equals(other.getParameters())) return false;
@@ -728,6 +816,8 @@ public int hashCode() {
728816
hash = (37 * hash) + INTENT_FIELD_NUMBER;
729817
hash = (53 * hash) + getIntent().hashCode();
730818
}
819+
hash = (37 * hash) + EVENT_FIELD_NUMBER;
820+
hash = (53 * hash) + getEvent().hashCode();
731821
if (hasParameters()) {
732822
hash = (37 * hash) + PARAMETERS_FIELD_NUMBER;
733823
hash = (53 * hash) + getParameters().hashCode();
@@ -889,6 +979,8 @@ public Builder clear() {
889979
intent_ = null;
890980
intentBuilder_ = null;
891981
}
982+
event_ = "";
983+
892984
if (parametersBuilder_ == null) {
893985
parameters_ = null;
894986
} else {
@@ -933,6 +1025,7 @@ public com.google.cloud.dialogflow.cx.v3beta1.Match buildPartial() {
9331025
} else {
9341026
result.intent_ = intentBuilder_.build();
9351027
}
1028+
result.event_ = event_;
9361029
if (parametersBuilder_ == null) {
9371030
result.parameters_ = parameters_;
9381031
} else {
@@ -993,6 +1086,10 @@ public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Match other) {
9931086
if (other.hasIntent()) {
9941087
mergeIntent(other.getIntent());
9951088
}
1089+
if (!other.getEvent().isEmpty()) {
1090+
event_ = other.event_;
1091+
onChanged();
1092+
}
9961093
if (other.hasParameters()) {
9971094
mergeParameters(other.getParameters());
9981095
}
@@ -1239,6 +1336,117 @@ public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder
12391336
return intentBuilder_;
12401337
}
12411338

1339+
private java.lang.Object event_ = "";
1340+
/**
1341+
*
1342+
*
1343+
* <pre>
1344+
* The event that matched the query. Only filled for
1345+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
1346+
* </pre>
1347+
*
1348+
* <code>string event = 6;</code>
1349+
*
1350+
* @return The event.
1351+
*/
1352+
public java.lang.String getEvent() {
1353+
java.lang.Object ref = event_;
1354+
if (!(ref instanceof java.lang.String)) {
1355+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1356+
java.lang.String s = bs.toStringUtf8();
1357+
event_ = s;
1358+
return s;
1359+
} else {
1360+
return (java.lang.String) ref;
1361+
}
1362+
}
1363+
/**
1364+
*
1365+
*
1366+
* <pre>
1367+
* The event that matched the query. Only filled for
1368+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
1369+
* </pre>
1370+
*
1371+
* <code>string event = 6;</code>
1372+
*
1373+
* @return The bytes for event.
1374+
*/
1375+
public com.google.protobuf.ByteString getEventBytes() {
1376+
java.lang.Object ref = event_;
1377+
if (ref instanceof String) {
1378+
com.google.protobuf.ByteString b =
1379+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1380+
event_ = b;
1381+
return b;
1382+
} else {
1383+
return (com.google.protobuf.ByteString) ref;
1384+
}
1385+
}
1386+
/**
1387+
*
1388+
*
1389+
* <pre>
1390+
* The event that matched the query. Only filled for
1391+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
1392+
* </pre>
1393+
*
1394+
* <code>string event = 6;</code>
1395+
*
1396+
* @param value The event to set.
1397+
* @return This builder for chaining.
1398+
*/
1399+
public Builder setEvent(java.lang.String value) {
1400+
if (value == null) {
1401+
throw new NullPointerException();
1402+
}
1403+
1404+
event_ = value;
1405+
onChanged();
1406+
return this;
1407+
}
1408+
/**
1409+
*
1410+
*
1411+
* <pre>
1412+
* The event that matched the query. Only filled for
1413+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
1414+
* </pre>
1415+
*
1416+
* <code>string event = 6;</code>
1417+
*
1418+
* @return This builder for chaining.
1419+
*/
1420+
public Builder clearEvent() {
1421+
1422+
event_ = getDefaultInstance().getEvent();
1423+
onChanged();
1424+
return this;
1425+
}
1426+
/**
1427+
*
1428+
*
1429+
* <pre>
1430+
* The event that matched the query. Only filled for
1431+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
1432+
* </pre>
1433+
*
1434+
* <code>string event = 6;</code>
1435+
*
1436+
* @param value The bytes for event to set.
1437+
* @return This builder for chaining.
1438+
*/
1439+
public Builder setEventBytes(com.google.protobuf.ByteString value) {
1440+
if (value == null) {
1441+
throw new NullPointerException();
1442+
}
1443+
checkByteStringIsUtf8(value);
1444+
1445+
event_ = value;
1446+
onChanged();
1447+
return this;
1448+
}
1449+
12421450
private com.google.protobuf.Struct parameters_;
12431451
private com.google.protobuf.SingleFieldBuilderV3<
12441452
com.google.protobuf.Struct,

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

+27
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,33 @@ public interface MatchOrBuilder
6464
*/
6565
com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder();
6666

67+
/**
68+
*
69+
*
70+
* <pre>
71+
* The event that matched the query. Only filled for
72+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
73+
* </pre>
74+
*
75+
* <code>string event = 6;</code>
76+
*
77+
* @return The event.
78+
*/
79+
java.lang.String getEvent();
80+
/**
81+
*
82+
*
83+
* <pre>
84+
* The event that matched the query. Only filled for
85+
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
86+
* </pre>
87+
*
88+
* <code>string event = 6;</code>
89+
*
90+
* @return The bytes for event.
91+
*/
92+
com.google.protobuf.ByteString getEventBytes();
93+
6794
/**
6895
*
6996
*

0 commit comments

Comments
 (0)