Skip to content

Commit

Permalink
feat(regerate): regenerate sdk using current api defs
Browse files Browse the repository at this point in the history
  • Loading branch information
mamoonraja committed Nov 26, 2019
1 parent 41d8d8b commit 4e8d68b
Show file tree
Hide file tree
Showing 24 changed files with 288 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "8.3"
- "8"
os:
- osx
osx_image: xcode61
Expand Down
27 changes: 21 additions & 6 deletions Scripts/Services/Assistant/V1/AssistantService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,9 @@ private void OnListWorkspacesResponse(RESTConnector.Request req, RESTConnector.R
/// (optional)</param>
/// <param name="counterexamples">An array of objects defining input examples that have been marked as
/// irrelevant input. (optional)</param>
/// <param name="webhooks"> (optional)</param>
/// <returns><see cref="Workspace" />Workspace</returns>
public bool CreateWorkspace(Callback<Workspace> callback, string name = null, string description = null, string language = null, Dictionary<string, object> metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List<CreateIntent> intents = null, List<CreateEntity> entities = null, List<DialogNode> dialogNodes = null, List<Counterexample> counterexamples = null)
public bool CreateWorkspace(Callback<Workspace> callback, string name = null, string description = null, string language = null, Dictionary<string, object> metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List<CreateIntent> intents = null, List<CreateEntity> entities = null, List<DialogNode> dialogNodes = null, List<Counterexample> counterexamples = null, List<Webhook> webhooks = null)
{
if (callback == null)
throw new ArgumentNullException("`callback` is required for `CreateWorkspace`");
Expand Down Expand Up @@ -363,6 +364,8 @@ public bool CreateWorkspace(Callback<Workspace> callback, string name = null, st
bodyObject["dialog_nodes"] = JToken.FromObject(dialogNodes);
if (counterexamples != null && counterexamples.Count > 0)
bodyObject["counterexamples"] = JToken.FromObject(counterexamples);
if (webhooks != null && webhooks.Count > 0)
bodyObject["webhooks"] = JToken.FromObject(webhooks);
req.Send = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bodyObject));

req.OnResponse = OnCreateWorkspaceResponse;
Expand Down Expand Up @@ -514,6 +517,7 @@ private void OnGetWorkspaceResponse(RESTConnector.Request req, RESTConnector.Res
/// (optional)</param>
/// <param name="counterexamples">An array of objects defining input examples that have been marked as
/// irrelevant input. (optional)</param>
/// <param name="webhooks"> (optional)</param>
/// <param name="append">Whether the new data is to be appended to the existing data in the workspace. If
/// **append**=`false`, elements included in the new data completely replace the corresponding existing
/// elements, including all subelements. For example, if the new data includes **entities** and
Expand All @@ -522,7 +526,7 @@ private void OnGetWorkspaceResponse(RESTConnector.Request req, RESTConnector.Res
/// If **append**=`true`, existing elements are preserved, and the new elements are added. If any elements in
/// the new data collide with existing elements, the update request fails. (optional, default to false)</param>
/// <returns><see cref="Workspace" />Workspace</returns>
public bool UpdateWorkspace(Callback<Workspace> callback, string workspaceId, string name = null, string description = null, string language = null, Dictionary<string, object> metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List<CreateIntent> intents = null, List<CreateEntity> entities = null, List<DialogNode> dialogNodes = null, List<Counterexample> counterexamples = null, bool? append = null)
public bool UpdateWorkspace(Callback<Workspace> callback, string workspaceId, string name = null, string description = null, string language = null, Dictionary<string, object> metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List<CreateIntent> intents = null, List<CreateEntity> entities = null, List<DialogNode> dialogNodes = null, List<Counterexample> counterexamples = null, List<Webhook> webhooks = null, bool? append = null)
{
if (callback == null)
throw new ArgumentNullException("`callback` is required for `UpdateWorkspace`");
Expand Down Expand Up @@ -577,6 +581,8 @@ public bool UpdateWorkspace(Callback<Workspace> callback, string workspaceId, st
bodyObject["dialog_nodes"] = JToken.FromObject(dialogNodes);
if (counterexamples != null && counterexamples.Count > 0)
bodyObject["counterexamples"] = JToken.FromObject(counterexamples);
if (webhooks != null && webhooks.Count > 0)
bodyObject["webhooks"] = JToken.FromObject(webhooks);
req.Send = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bodyObject));

req.OnResponse = OnUpdateWorkspaceResponse;
Expand Down Expand Up @@ -3595,8 +3601,10 @@ private void OnListDialogNodesResponse(RESTConnector.Request req, RESTConnector.
/// (optional)</param>
/// <param name="userLabel">A label that can be displayed externally to describe the purpose of the node to
/// users. (optional)</param>
/// <param name="disambiguationOptOut">Whether the dialog node should be excluded from disambiguation
/// suggestions. (optional, default to false)</param>
/// <returns><see cref="DialogNode" />DialogNode</returns>
public bool CreateDialogNode(Callback<DialogNode> callback, string workspaceId, string dialogNode, string description = null, string conditions = null, string parent = null, string previousSibling = null, DialogNodeOutput output = null, Dictionary<string, object> context = null, Dictionary<string, object> metadata = null, DialogNodeNextStep nextStep = null, string title = null, string type = null, string eventName = null, string variable = null, List<DialogNodeAction> actions = null, string digressIn = null, string digressOut = null, string digressOutSlots = null, string userLabel = null)
public bool CreateDialogNode(Callback<DialogNode> callback, string workspaceId, string dialogNode, string description = null, string conditions = null, string parent = null, string previousSibling = null, DialogNodeOutput output = null, Dictionary<string, object> context = null, Dictionary<string, object> metadata = null, DialogNodeNextStep nextStep = null, string title = null, string type = null, string eventName = null, string variable = null, List<DialogNodeAction> actions = null, string digressIn = null, string digressOut = null, string digressOutSlots = null, string userLabel = null, bool? disambiguationOptOut = null)
{
if (callback == null)
throw new ArgumentNullException("`callback` is required for `CreateDialogNode`");
Expand Down Expand Up @@ -3665,6 +3673,8 @@ public bool CreateDialogNode(Callback<DialogNode> callback, string workspaceId,
bodyObject["digress_out_slots"] = digressOutSlots;
if (!string.IsNullOrEmpty(userLabel))
bodyObject["user_label"] = userLabel;
if (disambiguationOptOut != null)
bodyObject["disambiguation_opt_out"] = JToken.FromObject(disambiguationOptOut);
req.Send = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bodyObject));

req.OnResponse = OnCreateDialogNodeResponse;
Expand Down Expand Up @@ -3825,8 +3835,10 @@ private void OnGetDialogNodeResponse(RESTConnector.Request req, RESTConnector.Re
/// (optional)</param>
/// <param name="newUserLabel">A label that can be displayed externally to describe the purpose of the node to
/// users. (optional)</param>
/// <param name="newDisambiguationOptOut">Whether the dialog node should be excluded from disambiguation
/// suggestions. (optional, default to false)</param>
/// <returns><see cref="DialogNode" />DialogNode</returns>
public bool UpdateDialogNode(Callback<DialogNode> callback, string workspaceId, string dialogNode, string newDialogNode = null, string newDescription = null, string newConditions = null, string newParent = null, string newPreviousSibling = null, DialogNodeOutput newOutput = null, Dictionary<string, object> newContext = null, Dictionary<string, object> newMetadata = null, DialogNodeNextStep newNextStep = null, string newTitle = null, string newType = null, string newEventName = null, string newVariable = null, List<DialogNodeAction> newActions = null, string newDigressIn = null, string newDigressOut = null, string newDigressOutSlots = null, string newUserLabel = null)
public bool UpdateDialogNode(Callback<DialogNode> callback, string workspaceId, string dialogNode, string newDialogNode = null, string newDescription = null, string newConditions = null, string newParent = null, string newPreviousSibling = null, DialogNodeOutput newOutput = null, Dictionary<string, object> newContext = null, Dictionary<string, object> newMetadata = null, DialogNodeNextStep newNextStep = null, string newTitle = null, string newType = null, string newEventName = null, string newVariable = null, List<DialogNodeAction> newActions = null, string newDigressIn = null, string newDigressOut = null, string newDigressOutSlots = null, string newUserLabel = null, bool? newDisambiguationOptOut = null)
{
if (callback == null)
throw new ArgumentNullException("`callback` is required for `UpdateDialogNode`");
Expand Down Expand Up @@ -3895,6 +3907,8 @@ public bool UpdateDialogNode(Callback<DialogNode> callback, string workspaceId,
bodyObject["digress_out_slots"] = newDigressOutSlots;
if (!string.IsNullOrEmpty(newUserLabel))
bodyObject["user_label"] = newUserLabel;
if (newDisambiguationOptOut != null)
bodyObject["disambiguation_opt_out"] = JToken.FromObject(newDisambiguationOptOut);
req.Send = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bodyObject));

req.OnResponse = OnUpdateDialogNodeResponse;
Expand Down Expand Up @@ -4107,8 +4121,9 @@ private void OnListLogsResponse(RESTConnector.Request req, RESTConnector.Respons
/// </summary>
/// <param name="callback">The callback function that is invoked when the operation completes.</param>
/// <param name="filter">A cacheable parameter that limits the results to those matching the specified filter.
/// You must specify a filter query that includes a value for `language`, as well as a value for `workspace_id`
/// or `request.context.metadata.deployment`. For more information, see the
/// You must specify a filter query that includes a value for `language`, as well as a value for
/// `request.context.system.assistant_id`, `workspace_id`, or `request.context.metadata.deployment`. For more
/// information, see the
/// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-filter-reference#filter-reference).</param>
/// <param name="sort">How to sort the returned log events. You can sort by **request_timestamp**. To reverse
/// the sort order, prefix the parameter value with a minus sign (`-`). (optional)</param>
Expand Down
5 changes: 5 additions & 0 deletions Scripts/Services/Assistant/V1/Model/DialogNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ public class DigressOutSlotsValue
[JsonProperty("user_label", NullValueHandling = NullValueHandling.Ignore)]
public string UserLabel { get; set; }
/// <summary>
/// Whether the dialog node should be excluded from disambiguation suggestions.
/// </summary>
[JsonProperty("disambiguation_opt_out", NullValueHandling = NullValueHandling.Ignore)]
public bool? DisambiguationOptOut { get; set; }
/// <summary>
/// For internal use only.
/// </summary>
[JsonProperty("disabled", NullValueHandling = NullValueHandling.Ignore)]
Expand Down
4 changes: 4 additions & 0 deletions Scripts/Services/Assistant/V1/Model/DialogNodeAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public class TypeValue
/// Constant WEB_ACTION for web_action
/// </summary>
public const string WEB_ACTION = "web_action";
/// <summary>
/// Constant WEBHOOK for webhook
/// </summary>
public const string WEBHOOK = "webhook";

}

Expand Down
4 changes: 2 additions & 2 deletions Scripts/Services/Assistant/V1/Model/DialogSuggestion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace IBM.Watson.Assistant.V1.Model
public class DialogSuggestion
{
/// <summary>
/// The user-facing label for the disambiguation option. This label is taken from the **user_label** property of
/// the corresponding dialog node.
/// The user-facing label for the disambiguation option. This label is taken from the **title** or
/// **user_label** property of the corresponding dialog node, depending on the disambiguation options.
/// </summary>
[JsonProperty("label", NullValueHandling = NullValueHandling.Ignore)]
public string Label { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public class PreferenceValue
/// An array of objects describing the possible matching dialog nodes from which the user can choose.
///
/// **Note:** The **suggestions** property is part of the disambiguation feature, which is only available for
/// Premium users.
/// Plus and Premium users.
/// </summary>
[JsonProperty("suggestions", NullValueHandling = NullValueHandling.Ignore)]
public List<DialogSuggestion> Suggestions { get; set; }
Expand Down
46 changes: 46 additions & 0 deletions Scripts/Services/Assistant/V1/Model/Webhook.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
*
* 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.
*
*/

using System.Collections.Generic;
using Newtonsoft.Json;

namespace IBM.Watson.Assistant.V1.Model
{
/// <summary>
/// A webhook that can be used by dialog nodes to make programmatic calls to an external function.
///
/// **Note:** Currently, only a single webhook named `main_webhook` is supported.
/// </summary>
public class Webhook
{
/// <summary>
/// The URL for the external service or application to which you want to send HTTP POST requests.
/// </summary>
[JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)]
public string Url { get; set; }
/// <summary>
/// The name of the webhook. Currently, `main_webhook` is the only supported value.
/// </summary>
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
/// <summary>
/// An optional array of HTTP headers to pass with the HTTP request.
/// </summary>
[JsonProperty("headers", NullValueHandling = NullValueHandling.Ignore)]
public List<WebhookHeader> Headers { get; set; }
}
}
11 changes: 11 additions & 0 deletions Scripts/Services/Assistant/V1/Model/Webhook.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions Scripts/Services/Assistant/V1/Model/WebhookHeader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
*
* 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.
*
*/

using Newtonsoft.Json;

namespace IBM.Watson.Assistant.V1.Model
{
/// <summary>
/// A key/value pair defining an HTTP header and a value.
/// </summary>
public class WebhookHeader
{
/// <summary>
/// The name of an HTTP header (for example, `Authorization`).
/// </summary>
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
/// <summary>
/// The value of an HTTP header.
/// </summary>
[JsonProperty("value", NullValueHandling = NullValueHandling.Ignore)]
public string Value { get; set; }
}
}
11 changes: 11 additions & 0 deletions Scripts/Services/Assistant/V1/Model/WebhookHeader.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Scripts/Services/Assistant/V1/Model/Workspace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,10 @@ public class StatusValue
/// </summary>
[JsonProperty("counterexamples", NullValueHandling = NullValueHandling.Ignore)]
public List<Counterexample> Counterexamples { get; set; }
/// <summary>
/// Gets or Sets Webhooks
/// </summary>
[JsonProperty("webhooks", NullValueHandling = NullValueHandling.Ignore)]
public List<Webhook> Webhooks { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class WorkspaceSystemSettings
/// <summary>
/// Workspace settings related to the disambiguation feature.
///
/// **Note:** This feature is available only to Premium users.
/// **Note:** This feature is available only to Plus and Premium users.
/// </summary>
[JsonProperty("disambiguation", NullValueHandling = NullValueHandling.Ignore)]
public WorkspaceSystemSettingsDisambiguation Disambiguation { get; set; }
Expand All @@ -42,5 +42,10 @@ public class WorkspaceSystemSettings
/// </summary>
[JsonProperty("human_agent_assist", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, object> HumanAgentAssist { get; set; }
/// <summary>
/// Workspace settings related to detection of irrelevant input.
/// </summary>
[JsonProperty("off_topic", NullValueHandling = NullValueHandling.Ignore)]
public WorkspaceSystemSettingsOffTopic OffTopic { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace IBM.Watson.Assistant.V1.Model
/// <summary>
/// Workspace settings related to the disambiguation feature.
///
/// **Note:** This feature is available only to Premium users.
/// **Note:** This feature is available only to Plus and Premium users.
/// </summary>
public class WorkspaceSystemSettingsDisambiguation
{
Expand Down Expand Up @@ -66,5 +66,21 @@ public class SensitivityValue
/// </summary>
[JsonProperty("enabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? Enabled { get; set; }
/// <summary>
/// Whether the order in which disambiguation suggestions are presented should be randomized (but still
/// influenced by relative confidence).
/// </summary>
[JsonProperty("randomize", NullValueHandling = NullValueHandling.Ignore)]
public bool? Randomize { get; set; }
/// <summary>
/// The maximum number of disambigation suggestions that can be included in a `suggestion` response.
/// </summary>
[JsonProperty("max_suggestions", NullValueHandling = NullValueHandling.Ignore)]
public long? MaxSuggestions { get; set; }
/// <summary>
/// For internal use only.
/// </summary>
[JsonProperty("suggestion_text_policy", NullValueHandling = NullValueHandling.Ignore)]
public string SuggestionTextPolicy { get; set; }
}
}
Loading

0 comments on commit 4e8d68b

Please sign in to comment.