From 515fb605e110e3171fcecb1323ae7ccb2ac9a07e Mon Sep 17 00:00:00 2001 From: German Attanasio Date: Mon, 20 Apr 2020 12:21:10 -0400 Subject: [PATCH] feat(assistant): auto-generate code squash me --- .../ibm/watson/assistant/v1/Assistant.java | 2 +- .../v1/model/CreateDialogNodeOptions.java | 3 +- .../watson/assistant/v1/model/DialogNode.java | 3 +- .../DialogSuggestionResponseGeneric.java | 6 +- .../assistant/v1/model/RuntimeEntity.java | 45 ++++++++ .../v1/model/RuntimeEntityAlternative.java | 103 ++++++++++++++++++ .../v1/model/UpdateDialogNodeOptions.java | 3 +- .../v2/model/MessageContextSkill.java | 2 +- .../v2/model/MessageInputOptions.java | 38 ++++++- .../assistant/v2/model/MessageResponse.java | 4 +- 10 files changed, 197 insertions(+), 12 deletions(-) create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityAlternative.java diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java index 9eda55f5a39..1c637845af6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java @@ -829,7 +829,7 @@ public ServiceCall listExamples(ListExamplesOptions listExamp * *

Add a new user input example to an intent. * - *

If you want to add multiple exaples with a single API call, consider using the **[Update + *

If you want to add multiple examples with a single API call, consider using the **[Update * intent](#update-intent)** method instead. * *

This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateDialogNodeOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateDialogNodeOptions.java index 031f6fa06a2..c15c96b61ef 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateDialogNodeOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateDialogNodeOptions.java @@ -713,7 +713,8 @@ public String userLabel() { /** * Gets the disambiguationOptOut. * - *

Whether the dialog node should be excluded from disambiguation suggestions. + *

Whether the dialog node should be excluded from disambiguation suggestions. Valid only when + * **type**=`standard` or `frame`. * * @return the disambiguationOptOut */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNode.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNode.java index 9e8f87d536f..7f0d86c5bb1 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNode.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNode.java @@ -708,7 +708,8 @@ public String userLabel() { /** * Gets the disambiguationOptOut. * - *

Whether the dialog node should be excluded from disambiguation suggestions. + *

Whether the dialog node should be excluded from disambiguation suggestions. Valid only when + * **type**=`standard` or `frame`. * * @return the disambiguationOptOut */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestionResponseGeneric.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestionResponseGeneric.java index 90d875b6f86..68ef115b187 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestionResponseGeneric.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestionResponseGeneric.java @@ -414,8 +414,8 @@ public String messageToHumanAgent() { /** * Gets the topic. * - *

A label identifying the topic of the conversation, derived from the **user_label** property - * of the relevant node. + *

A label identifying the topic of the conversation, derived from the **title** property of + * the relevant node. * * @return the topic */ @@ -427,7 +427,7 @@ public String topic() { * Gets the dialogNode. * *

The ID of the dialog node that the **topic** property is taken from. The **topic** property - * is populated using the value of the dialog node's **user_label** property. + * is populated using the value of the dialog node's **title** property. * * @return the dialogNode */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java index fd847bbc3b3..a5e79f22a74 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java @@ -27,6 +27,7 @@ public class RuntimeEntity extends GenericModel { protected Map metadata; protected List groups; protected RuntimeEntityInterpretation interpretation; + protected List alternatives; protected RuntimeEntityRole role; /** Builder. */ @@ -38,6 +39,7 @@ public static class Builder { private Map metadata; private List groups; private RuntimeEntityInterpretation interpretation; + private List alternatives; private RuntimeEntityRole role; private Builder(RuntimeEntity runtimeEntity) { @@ -48,6 +50,7 @@ private Builder(RuntimeEntity runtimeEntity) { this.metadata = runtimeEntity.metadata; this.groups = runtimeEntity.groups; this.interpretation = runtimeEntity.interpretation; + this.alternatives = runtimeEntity.alternatives; this.role = runtimeEntity.role; } @@ -106,6 +109,21 @@ public Builder addGroups(CaptureGroup groups) { return this; } + /** + * Adds an alternatives to alternatives. + * + * @param alternatives the new alternatives + * @return the RuntimeEntity builder + */ + public Builder addAlternatives(RuntimeEntityAlternative alternatives) { + com.ibm.cloud.sdk.core.util.Validator.notNull(alternatives, "alternatives cannot be null"); + if (this.alternatives == null) { + this.alternatives = new ArrayList(); + } + this.alternatives.add(alternatives); + return this; + } + /** * Set the entity. * @@ -183,6 +201,17 @@ public Builder interpretation(RuntimeEntityInterpretation interpretation) { return this; } + /** + * Set the alternatives. Existing alternatives will be replaced. + * + * @param alternatives the alternatives + * @return the RuntimeEntity builder + */ + public Builder alternatives(List alternatives) { + this.alternatives = alternatives; + return this; + } + /** * Set the role. * @@ -206,6 +235,7 @@ protected RuntimeEntity(Builder builder) { metadata = builder.metadata; groups = builder.groups; interpretation = builder.interpretation; + alternatives = builder.alternatives; role = builder.role; } @@ -300,6 +330,21 @@ public RuntimeEntityInterpretation interpretation() { return interpretation; } + /** + * Gets the alternatives. + * + *

An array of possible alternative values that the user might have intended instead of the + * value returned in the **value** property. This property is returned only for `@sys-time` and + * `@sys-date` entities when the user's input is ambiguous. + * + *

This property is included only if the new system entities are enabled for the workspace. + * + * @return the alternatives + */ + public List alternatives() { + return alternatives; + } + /** * Gets the role. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityAlternative.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityAlternative.java new file mode 100644 index 00000000000..0df8a932c90 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityAlternative.java @@ -0,0 +1,103 @@ +/* + * (C) Copyright IBM Corp. 2020. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** An alternative value for the recognized entity. */ +public class RuntimeEntityAlternative extends GenericModel { + + protected String value; + protected Double confidence; + + /** Builder. */ + public static class Builder { + private String value; + private Double confidence; + + private Builder(RuntimeEntityAlternative runtimeEntityAlternative) { + this.value = runtimeEntityAlternative.value; + this.confidence = runtimeEntityAlternative.confidence; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a RuntimeEntityAlternative. + * + * @return the runtimeEntityAlternative + */ + public RuntimeEntityAlternative build() { + return new RuntimeEntityAlternative(this); + } + + /** + * Set the value. + * + * @param value the value + * @return the RuntimeEntityAlternative builder + */ + public Builder value(String value) { + this.value = value; + return this; + } + + /** + * Set the confidence. + * + * @param confidence the confidence + * @return the RuntimeEntityAlternative builder + */ + public Builder confidence(Double confidence) { + this.confidence = confidence; + return this; + } + } + + protected RuntimeEntityAlternative(Builder builder) { + value = builder.value; + confidence = builder.confidence; + } + + /** + * New builder. + * + * @return a RuntimeEntityAlternative builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the value. + * + *

The entity value that was recognized in the user input. + * + * @return the value + */ + public String value() { + return value; + } + + /** + * Gets the confidence. + * + *

A decimal percentage that represents Watson's confidence in the recognized entity. + * + * @return the confidence + */ + public Double confidence() { + return confidence; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateDialogNodeOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateDialogNodeOptions.java index 79f40d41266..7bd98f86a2c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateDialogNodeOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateDialogNodeOptions.java @@ -711,7 +711,8 @@ public String newUserLabel() { /** * Gets the newDisambiguationOptOut. * - *

Whether the dialog node should be excluded from disambiguation suggestions. + *

Whether the dialog node should be excluded from disambiguation suggestions. Valid only when + * **type**=`standard` or `frame`. * * @return the newDisambiguationOptOut */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkill.java index d855fdd7a53..ba1928f6fd7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkill.java @@ -97,7 +97,7 @@ public Map userDefined() { /** * Gets the system. * - *

For internal use only. + *

System context data used by the skill. * * @return the system */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java index cbed953a6e3..e0d63786f89 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java @@ -27,18 +27,22 @@ public class MessageInputOptions extends GenericModel { @SerializedName("return_context") protected Boolean returnContext; + protected Boolean export; + /** Builder. */ public static class Builder { private Boolean debug; private Boolean restart; private Boolean alternateIntents; private Boolean returnContext; + private Boolean export; private Builder(MessageInputOptions messageInputOptions) { this.debug = messageInputOptions.debug; this.restart = messageInputOptions.restart; this.alternateIntents = messageInputOptions.alternateIntents; this.returnContext = messageInputOptions.returnContext; + this.export = messageInputOptions.export; } /** Instantiates a new builder. */ @@ -96,6 +100,17 @@ public Builder returnContext(Boolean returnContext) { this.returnContext = returnContext; return this; } + + /** + * Set the export. + * + * @param export the export + * @return the MessageInputOptions builder + */ + public Builder export(Boolean export) { + this.export = export; + return this; + } } protected MessageInputOptions(Builder builder) { @@ -103,6 +118,7 @@ protected MessageInputOptions(Builder builder) { restart = builder.restart; alternateIntents = builder.alternateIntents; returnContext = builder.returnContext; + export = builder.export; } /** @@ -118,7 +134,8 @@ public Builder newBuilder() { * Gets the debug. * *

Whether to return additional diagnostic information. Set to `true` to return additional - * information under the `output.debug` key. + * information in the `output.debug` property. If you also specify **return_context**=`true`, the + * returned skill context includes the `system.state` property. * * @return the debug */ @@ -153,11 +170,28 @@ public Boolean alternateIntents() { * Gets the returnContext. * *

Whether to return session context with the response. If you specify `true`, the response - * will include the `context` property. + * includes the `context` property. If you also specify **debug**=`true`, the returned skill + * context includes the `system.state` property. * * @return the returnContext */ public Boolean returnContext() { return returnContext; } + + /** + * Gets the export. + * + *

Whether to return session context, including full conversation state. If you specify `true`, + * the response includes the `context` property, and the skill context includes the `system.state` + * property. + * + *

**Note:** If **export**=`true`, the context is returned regardless of the value of + * **return_context**. + * + * @return the export + */ + public Boolean export() { + return export; + } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponse.java index 395aac8fc43..5637a552531 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponse.java @@ -34,8 +34,8 @@ public MessageOutput getOutput() { /** * Gets the context. * - *

State information for the conversation. The context is stored by the assistant on a - * per-session basis. You can use this property to access context variables. + *

Context data for the conversation. The context is stored by the assistant on a per-session + * basis. You can use this property to access context variables. * *

**Note:** The context is included in message responses only if **return_context**=`true` in * the message request.