Skip to content

Commit d62224e

Browse files
authored
Merge pull request #434 from watson-developer-cloud/august-2020-release
August 2020 release
2 parents a3b6389 + d2eb263 commit d62224e

File tree

98 files changed

+3222
-305
lines changed

Some content is hidden

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

98 files changed

+3222
-305
lines changed

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ environment:
1717
secure: Zkh0ZB9E5PB/Kq5maKln+aKSH0xqDjR2LTDaJRmMaUYVOV7nzYsON4KlkqCKCgGs #pragma: whitelist secret
1818
GITHUB_TOKEN:
1919
secure: +B2bs86RVtJtlbkB+cTf9bkqnNlFJi/PbBBPzR5jlUlLLZoOc+ZgqgQLwee4tCT+ #pragma: whitelist secret
20-
IBM_CREDENTIALS_FILE: C:\projects\sdk-credentials\ibm-credentials.env
20+
IBM_CREDENTIALS_FILE: C:/projects/sdk-credentials/ibm-credentials.env
2121
install:
2222
# Get the latest stable version of Node.js or io.js
2323
- ps: Install-Product node 12.13.0
@@ -59,7 +59,7 @@ before_build:
5959
- ps: >-
6060
if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
6161
{
62-
git clone https://$env:[email protected]/germanatt/sdk-credentials.git C:\projects\sdk-credentials -q
62+
git clone https://$env:[email protected]/germanatt/sdk-credentials.git C:/projects/sdk-credentials -q
6363
}
6464
6565
dotnet restore

src/IBM.Watson.Assistant.v1/AssistantService.cs

Lines changed: 3 additions & 106 deletions
Large diffs are not rendered by default.

src/IBM.Watson.Assistant.v1/IBM.Watson.Assistant.v1.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<ItemGroup>
2828
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.1.0" />
2929
<PackageReference Include="IBM.Watson.Common" Version="4.5.0" />
30-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
3130
<PackageReference Include="JsonSubTypes" Version="1.6.0" />
31+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
3232
</ItemGroup>
3333

3434
</Project>

src/IBM.Watson.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 ResponseTypeEnumValue
3635
{
@@ -119,8 +118,7 @@ public class QueryTypeEnumValue
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.ResponseTypeEnumValue
125123
/// </summary>
126124
[JsonProperty("response_type", NullValueHandling = NullValueHandling.Ignore)]

src/IBM.Watson.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 ResponseTypeEnumValue
3735
{
@@ -82,9 +80,7 @@ public class PreferenceEnumValue
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.ResponseTypeEnumValue
8985
/// </summary>
9086
[JsonProperty("response_type", NullValueHandling = NullValueHandling.Ignore)]

src/IBM.Watson.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 ResponseTypeEnumValue
3633
{
@@ -80,9 +77,6 @@ public class PreferenceEnumValue
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.ResponseTypeEnumValue
8781
/// </summary>
8882
[JsonProperty("response_type", NullValueHandling = NullValueHandling.Ignore)]
@@ -146,9 +140,6 @@ public class PreferenceEnumValue
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; }

src/IBM.Watson.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; }

src/IBM.Watson.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-
* (C) Copyright IBM Corp. 2018, 2019.
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
{

src/IBM.Watson.Assistant.v2/AssistantService.cs

Lines changed: 143 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace IBM.Watson.Assistant.v2
3131
public partial class AssistantService : IBMService, IAssistantService
3232
{
3333
const string serviceName = "assistant";
34-
private const string defaultServiceUrl = "https://gateway.watsonplatform.net/assistant/api";
34+
private const string defaultServiceUrl = "https://api.us-south.assistant.watson.cloud.ibm.com";
3535
public string VersionDate { get; set; }
3636

3737
public AssistantService(string versionDate) : this(versionDate, ConfigBasedAuthenticatorFactory.GetAuthenticator(serviceName)) { }
@@ -185,8 +185,6 @@ public DetailedResponse<object> DeleteSession(string assistantId, string session
185185
///
186186
/// Send user input to an assistant and receive a response, with conversation state (including context data)
187187
/// stored by Watson Assistant for the duration of the session.
188-
///
189-
/// There is no rate limit for this operation.
190188
/// </summary>
191189
/// <param name="assistantId">Unique identifier of the assistant. To find the assistant ID in the Watson
192190
/// Assistant user interface, open the assistant settings and click **API Details**. For information about
@@ -270,8 +268,6 @@ public DetailedResponse<MessageResponse> Message(string assistantId, string sess
270268
///
271269
/// Send user input to an assistant and receive a response, with conversation state (including context data)
272270
/// managed by your application.
273-
///
274-
/// There is no rate limit for this operation.
275271
/// </summary>
276272
/// <param name="assistantId">Unique identifier of the assistant. To find the assistant ID in the Watson
277273
/// Assistant user interface, open the assistant settings and click **API Details**. For information about
@@ -338,6 +334,148 @@ public DetailedResponse<MessageResponseStateless> MessageStateless(string assist
338334
throw ae.Flatten();
339335
}
340336

337+
return result;
338+
}
339+
/// <summary>
340+
/// List log events for an assistant.
341+
///
342+
/// List the events from the log of an assistant.
343+
///
344+
/// This method is available only with Premium plans.
345+
/// </summary>
346+
/// <param name="assistantId">Unique identifier of the assistant. To find the assistant ID in the Watson
347+
/// Assistant user interface, open the assistant settings and click **API Details**. For information about
348+
/// creating assistants, see the
349+
/// [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
350+
///
351+
/// **Note:** Currently, the v2 API does not support creating assistants.</param>
352+
/// <param name="sort">How to sort the returned log events. You can sort by **request_timestamp**. To reverse
353+
/// the sort order, prefix the parameter value with a minus sign (`-`). (optional)</param>
354+
/// <param name="filter">A cacheable parameter that limits the results to those matching the specified filter.
355+
/// For more information, see the
356+
/// [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
357+
/// (optional)</param>
358+
/// <param name="pageLimit">The number of records to return in each page of results. (optional)</param>
359+
/// <param name="cursor">A token identifying the page of results to retrieve. (optional)</param>
360+
/// <returns><see cref="LogCollection" />LogCollection</returns>
361+
public DetailedResponse<LogCollection> ListLogs(string assistantId, string sort = null, string filter = null, long? pageLimit = null, string cursor = null)
362+
{
363+
if (string.IsNullOrEmpty(assistantId))
364+
{
365+
throw new ArgumentNullException("`assistantId` is required for `ListLogs`");
366+
}
367+
else
368+
{
369+
assistantId = Uri.EscapeDataString(assistantId);
370+
}
371+
372+
if (string.IsNullOrEmpty(VersionDate))
373+
{
374+
throw new ArgumentNullException("versionDate cannot be null.");
375+
}
376+
377+
DetailedResponse<LogCollection> result = null;
378+
379+
try
380+
{
381+
IClient client = this.Client;
382+
SetAuthentication();
383+
384+
var restRequest = client.GetAsync($"{this.Endpoint}/v2/assistants/{assistantId}/logs");
385+
386+
restRequest.WithArgument("version", VersionDate);
387+
restRequest.WithHeader("Accept", "application/json");
388+
if (!string.IsNullOrEmpty(sort))
389+
{
390+
restRequest.WithArgument("sort", sort);
391+
}
392+
if (!string.IsNullOrEmpty(filter))
393+
{
394+
restRequest.WithArgument("filter", filter);
395+
}
396+
if (pageLimit != null)
397+
{
398+
restRequest.WithArgument("page_limit", pageLimit);
399+
}
400+
if (!string.IsNullOrEmpty(cursor))
401+
{
402+
restRequest.WithArgument("cursor", cursor);
403+
}
404+
405+
restRequest.WithHeaders(Common.GetSdkHeaders("conversation", "v2", "ListLogs"));
406+
restRequest.WithHeaders(customRequestHeaders);
407+
ClearCustomRequestHeaders();
408+
409+
result = restRequest.As<LogCollection>().Result;
410+
if (result == null)
411+
{
412+
result = new DetailedResponse<LogCollection>();
413+
}
414+
}
415+
catch (AggregateException ae)
416+
{
417+
throw ae.Flatten();
418+
}
419+
420+
return result;
421+
}
422+
/// <summary>
423+
/// Delete labeled data.
424+
///
425+
/// Deletes all data associated with a specified customer ID. The method has no effect if no data is associated
426+
/// with the customer ID.
427+
///
428+
/// You associate a customer ID with data by passing the `X-Watson-Metadata` header with a request that passes
429+
/// data. For more information about personal data and customer IDs, see [Information
430+
/// security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
431+
///
432+
/// This operation is limited to 4 requests per minute. For more information, see **Rate limiting**.
433+
/// </summary>
434+
/// <param name="customerId">The customer ID for which all data is to be deleted.</param>
435+
/// <returns><see cref="object" />object</returns>
436+
public DetailedResponse<object> DeleteUserData(string customerId)
437+
{
438+
if (string.IsNullOrEmpty(customerId))
439+
{
440+
throw new ArgumentNullException("`customerId` is required for `DeleteUserData`");
441+
}
442+
443+
if (string.IsNullOrEmpty(VersionDate))
444+
{
445+
throw new ArgumentNullException("versionDate cannot be null.");
446+
}
447+
448+
DetailedResponse<object> result = null;
449+
450+
try
451+
{
452+
IClient client = this.Client;
453+
SetAuthentication();
454+
455+
var restRequest = client.DeleteAsync($"{this.Endpoint}/v2/user_data");
456+
457+
restRequest.WithArgument("version", VersionDate);
458+
restRequest.WithHeader("Accept", "application/json");
459+
if (!string.IsNullOrEmpty(customerId))
460+
{
461+
restRequest.WithArgument("customer_id", customerId);
462+
}
463+
464+
restRequest.WithHeaders(Common.GetSdkHeaders("conversation", "v2", "DeleteUserData"));
465+
restRequest.WithHeaders(customRequestHeaders);
466+
ClearCustomRequestHeaders();
467+
468+
result = restRequest.As<object>().Result;
469+
if (result == null)
470+
{
471+
result = new DetailedResponse<object>();
472+
}
473+
}
474+
catch (AggregateException ae)
475+
{
476+
throw ae.Flatten();
477+
}
478+
341479
return result;
342480
}
343481
}

src/IBM.Watson.Assistant.v2/IAssistantService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ public partial interface IAssistantService
2626
DetailedResponse<object> DeleteSession(string assistantId, string sessionId);
2727
DetailedResponse<MessageResponse> Message(string assistantId, string sessionId, MessageInput input = null, MessageContext context = null);
2828
DetailedResponse<MessageResponseStateless> MessageStateless(string assistantId, MessageInputStateless input = null, MessageContextStateless context = null);
29+
DetailedResponse<LogCollection> ListLogs(string assistantId, string sort = null, string filter = null, long? pageLimit = null, string cursor = null);
30+
DetailedResponse<object> DeleteUserData(string customerId);
2931
}
3032
}

0 commit comments

Comments
 (0)