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

Commit

Permalink
feat: expose matched event in Sessions API. (#83)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yoshi-automation committed Nov 13, 2020
1 parent 1dfecac commit 22344ef
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 86 deletions.
Expand Up @@ -38,6 +38,7 @@ private Match(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
}

private Match() {
event_ = "";
resolvedInput_ = "";
matchType_ = 0;
}
Expand Down Expand Up @@ -121,6 +122,13 @@ private Match(
confidence_ = input.readFloat();
break;
}
case 50:
{
java.lang.String s = input.readStringRequireUtf8();

event_ = s;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
Expand Down Expand Up @@ -225,6 +233,16 @@ public enum MatchType implements com.google.protobuf.ProtocolMessageEnum {
* <code>NO_INPUT = 5;</code>
*/
NO_INPUT(5),
/**
*
*
* <pre>
* The query directly triggered an event.
* </pre>
*
* <code>EVENT = 6;</code>
*/
EVENT(6),
UNRECOGNIZED(-1),
;

Expand Down Expand Up @@ -288,6 +306,16 @@ public enum MatchType implements com.google.protobuf.ProtocolMessageEnum {
* <code>NO_INPUT = 5;</code>
*/
public static final int NO_INPUT_VALUE = 5;
/**
*
*
* <pre>
* The query directly triggered an event.
* </pre>
*
* <code>EVENT = 6;</code>
*/
public static final int EVENT_VALUE = 6;

public final int getNumber() {
if (this == UNRECOGNIZED) {
Expand Down Expand Up @@ -325,6 +353,8 @@ public static MatchType forNumber(int value) {
return NO_MATCH;
case 5:
return NO_INPUT;
case 6:
return EVENT;
default:
return null;
}
Expand Down Expand Up @@ -432,6 +462,57 @@ public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder
return getIntent();
}

public static final int EVENT_FIELD_NUMBER = 6;
private volatile java.lang.Object event_;
/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @return The event.
*/
@java.lang.Override
public java.lang.String getEvent() {
java.lang.Object ref = event_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
event_ = s;
return s;
}
}
/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @return The bytes for event.
*/
@java.lang.Override
public com.google.protobuf.ByteString getEventBytes() {
java.lang.Object ref = event_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
event_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}

public static final int PARAMETERS_FIELD_NUMBER = 2;
private com.google.protobuf.Struct parameters_;
/**
Expand Down Expand Up @@ -659,6 +740,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (confidence_ != 0F) {
output.writeFloat(5, confidence_);
}
if (!getEventBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, event_);
}
unknownFields.writeTo(output);
}

Expand All @@ -685,6 +769,9 @@ public int getSerializedSize() {
if (confidence_ != 0F) {
size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, confidence_);
}
if (!getEventBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, event_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -705,6 +792,7 @@ public boolean equals(final java.lang.Object obj) {
if (hasIntent()) {
if (!getIntent().equals(other.getIntent())) return false;
}
if (!getEvent().equals(other.getEvent())) return false;
if (hasParameters() != other.hasParameters()) return false;
if (hasParameters()) {
if (!getParameters().equals(other.getParameters())) return false;
Expand All @@ -728,6 +816,8 @@ public int hashCode() {
hash = (37 * hash) + INTENT_FIELD_NUMBER;
hash = (53 * hash) + getIntent().hashCode();
}
hash = (37 * hash) + EVENT_FIELD_NUMBER;
hash = (53 * hash) + getEvent().hashCode();
if (hasParameters()) {
hash = (37 * hash) + PARAMETERS_FIELD_NUMBER;
hash = (53 * hash) + getParameters().hashCode();
Expand Down Expand Up @@ -889,6 +979,8 @@ public Builder clear() {
intent_ = null;
intentBuilder_ = null;
}
event_ = "";

if (parametersBuilder_ == null) {
parameters_ = null;
} else {
Expand Down Expand Up @@ -933,6 +1025,7 @@ public com.google.cloud.dialogflow.cx.v3beta1.Match buildPartial() {
} else {
result.intent_ = intentBuilder_.build();
}
result.event_ = event_;
if (parametersBuilder_ == null) {
result.parameters_ = parameters_;
} else {
Expand Down Expand Up @@ -993,6 +1086,10 @@ public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Match other) {
if (other.hasIntent()) {
mergeIntent(other.getIntent());
}
if (!other.getEvent().isEmpty()) {
event_ = other.event_;
onChanged();
}
if (other.hasParameters()) {
mergeParameters(other.getParameters());
}
Expand Down Expand Up @@ -1239,6 +1336,117 @@ public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder
return intentBuilder_;
}

private java.lang.Object event_ = "";
/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @return The event.
*/
public java.lang.String getEvent() {
java.lang.Object ref = event_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
event_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @return The bytes for event.
*/
public com.google.protobuf.ByteString getEventBytes() {
java.lang.Object ref = event_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
event_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @param value The event to set.
* @return This builder for chaining.
*/
public Builder setEvent(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}

event_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @return This builder for chaining.
*/
public Builder clearEvent() {

event_ = getDefaultInstance().getEvent();
onChanged();
return this;
}
/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @param value The bytes for event to set.
* @return This builder for chaining.
*/
public Builder setEventBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);

event_ = value;
onChanged();
return this;
}

private com.google.protobuf.Struct parameters_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct,
Expand Down
Expand Up @@ -64,6 +64,33 @@ public interface MatchOrBuilder
*/
com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder();

/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @return The event.
*/
java.lang.String getEvent();
/**
*
*
* <pre>
* The event that matched the query. Only filled for
* [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
* </pre>
*
* <code>string event = 6;</code>
*
* @return The bytes for event.
*/
com.google.protobuf.ByteString getEventBytes();

/**
*
*
Expand Down

0 comments on commit 22344ef

Please sign in to comment.