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

feat: expose dtmf input info in the query result #329

Merged
merged 2 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,23 @@ private QueryResult(
sentimentAnalysisResult_ = subBuilder.buildPartial();
}

break;
}
case 186:
{
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.Builder subBuilder = null;
if (queryCase_ == 23) {
subBuilder =
((com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_).toBuilder();
}
query_ =
input.readMessage(
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_);
query_ = subBuilder.buildPartial();
}
queryCase_ = 23;
break;
}
default:
Expand Down Expand Up @@ -298,6 +315,7 @@ public enum QueryCase
TRIGGER_INTENT(11),
TRANSCRIPT(12),
TRIGGER_EVENT(14),
DTMF(23),
QUERY_NOT_SET(0);
private final int value;

Expand All @@ -324,6 +342,8 @@ public static QueryCase forNumber(int value) {
return TRANSCRIPT;
case 14:
return TRIGGER_EVENT;
case 23:
return DTMF;
case 0:
return QUERY_NOT_SET;
default:
Expand Down Expand Up @@ -638,6 +658,60 @@ public com.google.protobuf.ByteString getTriggerEventBytes() {
}
}

public static final int DTMF_FIELD_NUMBER = 23;
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*
* @return Whether the dtmf field is set.
*/
@java.lang.Override
public boolean hasDtmf() {
return queryCase_ == 23;
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*
* @return The dtmf.
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.DtmfInput getDtmf() {
if (queryCase_ == 23) {
return (com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_;
}
return com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.getDefaultInstance();
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.DtmfInputOrBuilder getDtmfOrBuilder() {
if (queryCase_ == 23) {
return (com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_;
}
return com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.getDefaultInstance();
}

public static final int LANGUAGE_CODE_FIELD_NUMBER = 2;
private volatile java.lang.Object languageCode_;
/**
Expand Down Expand Up @@ -1371,6 +1445,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (sentimentAnalysisResult_ != null) {
output.writeMessage(17, getSentimentAnalysisResult());
}
if (queryCase_ == 23) {
output.writeMessage(23, (com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_);
}
unknownFields.writeTo(output);
}

Expand Down Expand Up @@ -1427,6 +1504,11 @@ public int getSerializedSize() {
com.google.protobuf.CodedOutputStream.computeMessageSize(
17, getSentimentAnalysisResult());
}
if (queryCase_ == 23) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
23, (com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
Expand Down Expand Up @@ -1487,6 +1569,9 @@ public boolean equals(final java.lang.Object obj) {
case 14:
if (!getTriggerEvent().equals(other.getTriggerEvent())) return false;
break;
case 23:
if (!getDtmf().equals(other.getDtmf())) return false;
break;
case 0:
default:
}
Expand Down Expand Up @@ -1558,6 +1643,10 @@ public int hashCode() {
hash = (37 * hash) + TRIGGER_EVENT_FIELD_NUMBER;
hash = (53 * hash) + getTriggerEvent().hashCode();
break;
case 23:
hash = (37 * hash) + DTMF_FIELD_NUMBER;
hash = (53 * hash) + getDtmf().hashCode();
break;
case 0:
default:
}
Expand Down Expand Up @@ -1810,6 +1899,13 @@ public com.google.cloud.dialogflow.cx.v3beta1.QueryResult buildPartial() {
if (queryCase_ == 14) {
result.query_ = query_;
}
if (queryCase_ == 23) {
if (dtmfBuilder_ == null) {
result.query_ = query_;
} else {
result.query_ = dtmfBuilder_.build();
}
}
result.languageCode_ = languageCode_;
if (parametersBuilder_ == null) {
result.parameters_ = parameters_;
Expand Down Expand Up @@ -2055,6 +2151,11 @@ public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.QueryResult othe
onChanged();
break;
}
case DTMF:
{
mergeDtmf(other.getDtmf());
break;
}
case QUERY_NOT_SET:
{
break;
Expand Down Expand Up @@ -2678,6 +2779,224 @@ public Builder setTriggerEventBytes(com.google.protobuf.ByteString value) {
return this;
}

private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput,
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.Builder,
com.google.cloud.dialogflow.cx.v3beta1.DtmfInputOrBuilder>
dtmfBuilder_;
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*
* @return Whether the dtmf field is set.
*/
@java.lang.Override
public boolean hasDtmf() {
return queryCase_ == 23;
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*
* @return The dtmf.
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.DtmfInput getDtmf() {
if (dtmfBuilder_ == null) {
if (queryCase_ == 23) {
return (com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_;
}
return com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.getDefaultInstance();
} else {
if (queryCase_ == 23) {
return dtmfBuilder_.getMessage();
}
return com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.getDefaultInstance();
}
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*/
public Builder setDtmf(com.google.cloud.dialogflow.cx.v3beta1.DtmfInput value) {
if (dtmfBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
query_ = value;
onChanged();
} else {
dtmfBuilder_.setMessage(value);
}
queryCase_ = 23;
return this;
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*/
public Builder setDtmf(
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.Builder builderForValue) {
if (dtmfBuilder_ == null) {
query_ = builderForValue.build();
onChanged();
} else {
dtmfBuilder_.setMessage(builderForValue.build());
}
queryCase_ = 23;
return this;
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*/
public Builder mergeDtmf(com.google.cloud.dialogflow.cx.v3beta1.DtmfInput value) {
if (dtmfBuilder_ == null) {
if (queryCase_ == 23
&& query_ != com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.getDefaultInstance()) {
query_ =
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.newBuilder(
(com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_)
.mergeFrom(value)
.buildPartial();
} else {
query_ = value;
}
onChanged();
} else {
if (queryCase_ == 23) {
dtmfBuilder_.mergeFrom(value);
}
dtmfBuilder_.setMessage(value);
}
queryCase_ = 23;
return this;
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*/
public Builder clearDtmf() {
if (dtmfBuilder_ == null) {
if (queryCase_ == 23) {
queryCase_ = 0;
query_ = null;
onChanged();
}
} else {
if (queryCase_ == 23) {
queryCase_ = 0;
query_ = null;
}
dtmfBuilder_.clear();
}
return this;
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.Builder getDtmfBuilder() {
return getDtmfFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.DtmfInputOrBuilder getDtmfOrBuilder() {
if ((queryCase_ == 23) && (dtmfBuilder_ != null)) {
return dtmfBuilder_.getMessageOrBuilder();
} else {
if (queryCase_ == 23) {
return (com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_;
}
return com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.getDefaultInstance();
}
}
/**
*
*
* <pre>
* If a [DTMF][DTMFInput] was provided as input, this field will contain
* a copy of the [DTMFInput][].
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.DtmfInput dtmf = 23;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput,
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.Builder,
com.google.cloud.dialogflow.cx.v3beta1.DtmfInputOrBuilder>
getDtmfFieldBuilder() {
if (dtmfBuilder_ == null) {
if (!(queryCase_ == 23)) {
query_ = com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.getDefaultInstance();
}
dtmfBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput,
com.google.cloud.dialogflow.cx.v3beta1.DtmfInput.Builder,
com.google.cloud.dialogflow.cx.v3beta1.DtmfInputOrBuilder>(
(com.google.cloud.dialogflow.cx.v3beta1.DtmfInput) query_,
getParentForChildren(),
isClean());
query_ = null;
}
queryCase_ = 23;
onChanged();
;
return dtmfBuilder_;
}

private java.lang.Object languageCode_ = "";
/**
*
Expand Down
Loading