Skip to content

Commit 3c95b34

Browse files
authored
Merge pull request #649 from watson-developer-cloud/feat/august-release
feat: August Release
2 parents f6c0ed0 + 284c04f commit 3c95b34

File tree

84 files changed

+3501
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+3501
-290
lines changed

Scripts/Services/Assistant/V1/AssistantService.cs

Lines changed: 1 addition & 101 deletions
Large diffs are not rendered by default.

Scripts/Services/Assistant/V1/Model/DialogNodeOutputGeneric.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public class DialogNodeOutputGeneric
2929
/// The type of response returned by the dialog node. The specified response type must be supported by the
3030
/// client application or channel.
3131
///
32-
/// **Note:** The **search_skill** response type is available only for Plus and Premium users, and is used only
33-
/// by the v2 runtime API.
32+
/// **Note:** The **search_skill** response type is used only by the v2 runtime API.
3433
/// </summary>
3534
public class ResponseTypeValue
3635
{
@@ -119,8 +118,7 @@ public class QueryTypeValue
119118
/// The type of response returned by the dialog node. The specified response type must be supported by the
120119
/// client application or channel.
121120
///
122-
/// **Note:** The **search_skill** response type is available only for Plus and Premium users, and is used only
123-
/// by the v2 runtime API.
121+
/// **Note:** The **search_skill** response type is used only by the v2 runtime API.
124122
/// Constants for possible values can be found using DialogNodeOutputGeneric.ResponseTypeValue
125123
/// </summary>
126124
[JsonProperty("response_type", NullValueHandling = NullValueHandling.Ignore)]

Scripts/Services/Assistant/V1/Model/DialogSuggestionResponseGeneric.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ public class DialogSuggestionResponseGeneric
2929
/// The type of response returned by the dialog node. The specified response type must be supported by the
3030
/// client application or channel.
3131
///
32-
/// **Note:** The **suggestion** response type is part of the disambiguation feature, which is only available
33-
/// for Plus and Premium users. The **search_skill** response type is available only for Plus and Premium users,
34-
/// and is used only by the v2 runtime API.
32+
/// **Note:** The **search_skill** response type is is used only by the v2 runtime API.
3533
/// </summary>
3634
public class ResponseTypeValue
3735
{
@@ -82,9 +80,7 @@ public class PreferenceValue
8280
/// The type of response returned by the dialog node. The specified response type must be supported by the
8381
/// client application or channel.
8482
///
85-
/// **Note:** The **suggestion** response type is part of the disambiguation feature, which is only available
86-
/// for Plus and Premium users. The **search_skill** response type is available only for Plus and Premium users,
87-
/// and is used only by the v2 runtime API.
83+
/// **Note:** The **search_skill** response type is is used only by the v2 runtime API.
8884
/// Constants for possible values can be found using DialogSuggestionResponseGeneric.ResponseTypeValue
8985
/// </summary>
9086
[JsonProperty("response_type", NullValueHandling = NullValueHandling.Ignore)]

Scripts/Services/Assistant/V1/Model/RuntimeResponseGeneric.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ public class RuntimeResponseGeneric
2828
/// <summary>
2929
/// The type of response returned by the dialog node. The specified response type must be supported by the
3030
/// client application or channel.
31-
///
32-
/// **Note:** The **suggestion** response type is part of the disambiguation feature, which is only available
33-
/// for Plus and Premium users.
3431
/// </summary>
3532
public class ResponseTypeValue
3633
{
@@ -80,9 +77,6 @@ public class PreferenceValue
8077
/// <summary>
8178
/// The type of response returned by the dialog node. The specified response type must be supported by the
8279
/// client application or channel.
83-
///
84-
/// **Note:** The **suggestion** response type is part of the disambiguation feature, which is only available
85-
/// for Plus and Premium users.
8680
/// Constants for possible values can be found using RuntimeResponseGeneric.ResponseTypeValue
8781
/// </summary>
8882
[JsonProperty("response_type", NullValueHandling = NullValueHandling.Ignore)]
@@ -146,9 +140,6 @@ public class PreferenceValue
146140
public string DialogNode { get; set; }
147141
/// <summary>
148142
/// An array of objects describing the possible matching dialog nodes from which the user can choose.
149-
///
150-
/// **Note:** The **suggestions** property is part of the disambiguation feature, which is only available for
151-
/// Plus and Premium users.
152143
/// </summary>
153144
[JsonProperty("suggestions", NullValueHandling = NullValueHandling.Ignore)]
154145
public List<DialogSuggestion> Suggestions { get; set; }

Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ public class WorkspaceSystemSettings
3232
public WorkspaceSystemSettingsTooling Tooling { get; set; }
3333
/// <summary>
3434
/// Workspace settings related to the disambiguation feature.
35-
///
36-
/// **Note:** This feature is available only to Plus and Premium users.
3735
/// </summary>
3836
[JsonProperty("disambiguation", NullValueHandling = NullValueHandling.Ignore)]
3937
public WorkspaceSystemSettingsDisambiguation Disambiguation { get; set; }

Scripts/Services/Assistant/V1/Model/WorkspaceSystemSettingsDisambiguation.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2018, 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,8 +21,6 @@ namespace IBM.Watson.Assistant.V1.Model
2121
{
2222
/// <summary>
2323
/// Workspace settings related to the disambiguation feature.
24-
///
25-
/// **Note:** This feature is available only to Plus and Premium users.
2624
/// </summary>
2725
public class WorkspaceSystemSettingsDisambiguation
2826
{

Scripts/Services/Assistant/V2/AssistantService.cs

Lines changed: 179 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace IBM.Watson.Assistant.V2
3232
public partial class AssistantService : BaseService
3333
{
3434
private const string serviceId = "assistant";
35-
private const string defaultServiceUrl = "https://gateway.watsonplatform.net/assistant/api";
35+
private const string defaultServiceUrl = "https://api.us-south.assistant.watson.cloud.ibm.com";
3636

3737
#region VersionDate
3838
private string versionDate;
@@ -246,8 +246,6 @@ private void OnDeleteSessionResponse(RESTConnector.Request req, RESTConnector.Re
246246
///
247247
/// Send user input to an assistant and receive a response, with conversation state (including context data)
248248
/// stored by Watson Assistant for the duration of the session.
249-
///
250-
/// There is no rate limit for this operation.
251249
/// </summary>
252250
/// <param name="callback">The callback function that is invoked when the operation completes.</param>
253251
/// <param name="assistantId">Unique identifier of the assistant. To find the assistant ID in the Watson
@@ -341,8 +339,6 @@ private void OnMessageResponse(RESTConnector.Request req, RESTConnector.Response
341339
///
342340
/// Send user input to an assistant and receive a response, with conversation state (including context data)
343341
/// managed by your application.
344-
///
345-
/// There is no rate limit for this operation.
346342
/// </summary>
347343
/// <param name="callback">The callback function that is invoked when the operation completes.</param>
348344
/// <param name="assistantId">Unique identifier of the assistant. To find the assistant ID in the Watson
@@ -427,5 +423,183 @@ private void OnMessageStatelessResponse(RESTConnector.Request req, RESTConnector
427423
if (((RequestObject<MessageResponseStateless>)req).Callback != null)
428424
((RequestObject<MessageResponseStateless>)req).Callback(response, resp.Error);
429425
}
426+
/// <summary>
427+
/// List log events for an assistant.
428+
///
429+
/// List the events from the log of an assistant.
430+
///
431+
/// This method is available only with Premium plans.
432+
/// </summary>
433+
/// <param name="callback">The callback function that is invoked when the operation completes.</param>
434+
/// <param name="assistantId">Unique identifier of the assistant. To find the assistant ID in the Watson
435+
/// Assistant user interface, open the assistant settings and click **API Details**. For information about
436+
/// creating assistants, see the
437+
/// [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
438+
///
439+
/// **Note:** Currently, the v2 API does not support creating assistants.</param>
440+
/// <param name="sort">How to sort the returned log events. You can sort by **request_timestamp**. To reverse
441+
/// the sort order, prefix the parameter value with a minus sign (`-`). (optional)</param>
442+
/// <param name="filter">A cacheable parameter that limits the results to those matching the specified filter.
443+
/// For more information, see the
444+
/// [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
445+
/// (optional)</param>
446+
/// <param name="pageLimit">The number of records to return in each page of results. (optional)</param>
447+
/// <param name="cursor">A token identifying the page of results to retrieve. (optional)</param>
448+
/// <returns><see cref="LogCollection" />LogCollection</returns>
449+
public bool ListLogs(Callback<LogCollection> callback, string assistantId, string sort = null, string filter = null, long? pageLimit = null, string cursor = null)
450+
{
451+
if (callback == null)
452+
throw new ArgumentNullException("`callback` is required for `ListLogs`");
453+
if (string.IsNullOrEmpty(assistantId))
454+
throw new ArgumentNullException("`assistantId` is required for `ListLogs`");
455+
456+
RequestObject<LogCollection> req = new RequestObject<LogCollection>
457+
{
458+
Callback = callback,
459+
HttpMethod = UnityWebRequest.kHttpVerbGET,
460+
DisableSslVerification = DisableSslVerification
461+
};
462+
463+
foreach (KeyValuePair<string, string> kvp in customRequestHeaders)
464+
{
465+
req.Headers.Add(kvp.Key, kvp.Value);
466+
}
467+
468+
ClearCustomRequestHeaders();
469+
470+
foreach (KeyValuePair<string, string> kvp in Common.GetSdkHeaders("conversation", "V2", "ListLogs"))
471+
{
472+
req.Headers.Add(kvp.Key, kvp.Value);
473+
}
474+
475+
req.Parameters["version"] = VersionDate;
476+
if (!string.IsNullOrEmpty(sort))
477+
{
478+
req.Parameters["sort"] = sort;
479+
}
480+
if (!string.IsNullOrEmpty(filter))
481+
{
482+
req.Parameters["filter"] = filter;
483+
}
484+
if (pageLimit != null)
485+
{
486+
req.Parameters["page_limit"] = pageLimit;
487+
}
488+
if (!string.IsNullOrEmpty(cursor))
489+
{
490+
req.Parameters["cursor"] = cursor;
491+
}
492+
493+
req.OnResponse = OnListLogsResponse;
494+
495+
Connector.URL = GetServiceUrl() + string.Format("/v2/assistants/{0}/logs", assistantId);
496+
Authenticator.Authenticate(Connector);
497+
498+
return Connector.Send(req);
499+
}
500+
501+
private void OnListLogsResponse(RESTConnector.Request req, RESTConnector.Response resp)
502+
{
503+
DetailedResponse<LogCollection> response = new DetailedResponse<LogCollection>();
504+
foreach (KeyValuePair<string, string> kvp in resp.Headers)
505+
{
506+
response.Headers.Add(kvp.Key, kvp.Value);
507+
}
508+
response.StatusCode = resp.HttpResponseCode;
509+
510+
try
511+
{
512+
string json = Encoding.UTF8.GetString(resp.Data);
513+
response.Result = JsonConvert.DeserializeObject<LogCollection>(json);
514+
response.Response = json;
515+
}
516+
catch (Exception e)
517+
{
518+
Log.Error("AssistantService.OnListLogsResponse()", "Exception: {0}", e.ToString());
519+
resp.Success = false;
520+
}
521+
522+
if (((RequestObject<LogCollection>)req).Callback != null)
523+
((RequestObject<LogCollection>)req).Callback(response, resp.Error);
524+
}
525+
/// <summary>
526+
/// Delete labeled data.
527+
///
528+
/// Deletes all data associated with a specified customer ID. The method has no effect if no data is associated
529+
/// with the customer ID.
530+
///
531+
/// You associate a customer ID with data by passing the `X-Watson-Metadata` header with a request that passes
532+
/// data. For more information about personal data and customer IDs, see [Information
533+
/// security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
534+
///
535+
/// This operation is limited to 4 requests per minute. For more information, see **Rate limiting**.
536+
/// </summary>
537+
/// <param name="callback">The callback function that is invoked when the operation completes.</param>
538+
/// <param name="customerId">The customer ID for which all data is to be deleted.</param>
539+
/// <returns><see cref="object" />object</returns>
540+
public bool DeleteUserData(Callback<object> callback, string customerId)
541+
{
542+
if (callback == null)
543+
throw new ArgumentNullException("`callback` is required for `DeleteUserData`");
544+
if (string.IsNullOrEmpty(customerId))
545+
throw new ArgumentNullException("`customerId` is required for `DeleteUserData`");
546+
547+
RequestObject<object> req = new RequestObject<object>
548+
{
549+
Callback = callback,
550+
HttpMethod = UnityWebRequest.kHttpVerbDELETE,
551+
DisableSslVerification = DisableSslVerification
552+
};
553+
554+
foreach (KeyValuePair<string, string> kvp in customRequestHeaders)
555+
{
556+
req.Headers.Add(kvp.Key, kvp.Value);
557+
}
558+
559+
ClearCustomRequestHeaders();
560+
561+
foreach (KeyValuePair<string, string> kvp in Common.GetSdkHeaders("conversation", "V2", "DeleteUserData"))
562+
{
563+
req.Headers.Add(kvp.Key, kvp.Value);
564+
}
565+
566+
req.Parameters["version"] = VersionDate;
567+
if (!string.IsNullOrEmpty(customerId))
568+
{
569+
req.Parameters["customer_id"] = customerId;
570+
}
571+
572+
req.OnResponse = OnDeleteUserDataResponse;
573+
574+
Connector.URL = GetServiceUrl() + "/v2/user_data";
575+
Authenticator.Authenticate(Connector);
576+
577+
return Connector.Send(req);
578+
}
579+
580+
private void OnDeleteUserDataResponse(RESTConnector.Request req, RESTConnector.Response resp)
581+
{
582+
DetailedResponse<object> response = new DetailedResponse<object>();
583+
foreach (KeyValuePair<string, string> kvp in resp.Headers)
584+
{
585+
response.Headers.Add(kvp.Key, kvp.Value);
586+
}
587+
response.StatusCode = resp.HttpResponseCode;
588+
589+
try
590+
{
591+
string json = Encoding.UTF8.GetString(resp.Data);
592+
response.Result = JsonConvert.DeserializeObject<object>(json);
593+
response.Response = json;
594+
}
595+
catch (Exception e)
596+
{
597+
Log.Error("AssistantService.OnDeleteUserDataResponse()", "Exception: {0}", e.ToString());
598+
resp.Success = false;
599+
}
600+
601+
if (((RequestObject<object>)req).Callback != null)
602+
((RequestObject<object>)req).Callback(response, resp.Error);
603+
}
430604
}
431605
}

Scripts/Services/Assistant/V2/Model/DialogSuggestion.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018, 2019 IBM Corp. All Rights Reserved.
2+
* (C) Copyright IBM Corp. 2018, 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,8 +26,8 @@ namespace IBM.Watson.Assistant.V2.Model
2626
public class DialogSuggestion
2727
{
2828
/// <summary>
29-
/// The user-facing label for the disambiguation option. This label is taken from the **title** or
30-
/// **user_label** property of the corresponding dialog node, depending on the disambiguation options.
29+
/// The user-facing label for the suggestion. This label is taken from the **title** or **user_label** property
30+
/// of the corresponding dialog node, depending on the disambiguation options.
3131
/// </summary>
3232
[JsonProperty("label", NullValueHandling = NullValueHandling.Ignore)]
3333
public string Label { get; set; }
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2020.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using System.Collections.Generic;
19+
using Newtonsoft.Json;
20+
21+
namespace IBM.Watson.Assistant.V2.Model
22+
{
23+
/// <summary>
24+
/// LogCollection.
25+
/// </summary>
26+
public class LogCollection
27+
{
28+
/// <summary>
29+
/// An array of objects describing log events.
30+
/// </summary>
31+
[JsonProperty("logs", NullValueHandling = NullValueHandling.Ignore)]
32+
public List<ModelLog> Logs { get; set; }
33+
/// <summary>
34+
/// The pagination data for the returned objects.
35+
/// </summary>
36+
[JsonProperty("pagination", NullValueHandling = NullValueHandling.Ignore)]
37+
public LogPagination Pagination { get; set; }
38+
}
39+
}

Scripts/Services/Assistant/V2/Model/LogCollection.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)