Skip to content

Commit 9b96f89

Browse files
committed
fix(generation): api def '8be1cdc78c7998b055bc8ea895dddd7c8496b2a4' gen tag 3.19.0
Update SDK to fix issue with Node Dialogs with a type response of connect to agent.
1 parent dfa04ef commit 9b96f89

17 files changed

+232
-165
lines changed

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

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2020.
2+
* (C) Copyright IBM Corp. 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.
@@ -164,6 +164,73 @@ public DetailedResponse<MessageResponse> Message(string workspaceId, MessageInpu
164164
return result;
165165
}
166166
/// <summary>
167+
/// Identify intents and entities in multiple user utterances.
168+
///
169+
/// Send multiple user inputs to a workspace in a single request and receive information about the intents and
170+
/// entities recognized in each input. This method is useful for testing and comparing the performance of
171+
/// different workspaces.
172+
///
173+
/// This method is available only with Premium plans.
174+
/// </summary>
175+
/// <param name="workspaceId">Unique identifier of the workspace.</param>
176+
/// <param name="input">An array of input utterances to classify. (optional)</param>
177+
/// <returns><see cref="BulkClassifyResponse" />BulkClassifyResponse</returns>
178+
public DetailedResponse<BulkClassifyResponse> BulkClassify(string workspaceId, List<BulkClassifyUtterance> input = null)
179+
{
180+
if (string.IsNullOrEmpty(workspaceId))
181+
{
182+
throw new ArgumentNullException("`workspaceId` is required for `BulkClassify`");
183+
}
184+
else
185+
{
186+
workspaceId = Uri.EscapeDataString(workspaceId);
187+
}
188+
if (string.IsNullOrEmpty(Version))
189+
{
190+
throw new ArgumentNullException("`Version` is required");
191+
}
192+
DetailedResponse<BulkClassifyResponse> result = null;
193+
194+
try
195+
{
196+
IClient client = this.Client;
197+
SetAuthentication();
198+
199+
var restRequest = client.PostAsync($"{this.Endpoint}/v1/workspaces/{workspaceId}/bulk_classify");
200+
201+
restRequest.WithHeader("Accept", "application/json");
202+
if (!string.IsNullOrEmpty(Version))
203+
{
204+
restRequest.WithArgument("version", Version);
205+
}
206+
restRequest.WithHeader("Content-Type", "application/json");
207+
208+
JObject bodyObject = new JObject();
209+
if (input != null && input.Count > 0)
210+
{
211+
bodyObject["input"] = JToken.FromObject(input);
212+
}
213+
var httpContent = new StringContent(JsonConvert.SerializeObject(bodyObject), Encoding.UTF8, HttpMediaType.APPLICATION_JSON);
214+
restRequest.WithBodyContent(httpContent);
215+
216+
restRequest.WithHeaders(Common.GetSdkHeaders("conversation", "v1", "BulkClassify"));
217+
restRequest.WithHeaders(customRequestHeaders);
218+
ClearCustomRequestHeaders();
219+
220+
result = restRequest.As<BulkClassifyResponse>().Result;
221+
if (result == null)
222+
{
223+
result = new DetailedResponse<BulkClassifyResponse>();
224+
}
225+
}
226+
catch (AggregateException ae)
227+
{
228+
throw ae.Flatten();
229+
}
230+
231+
return result;
232+
}
233+
/// <summary>
167234
/// List workspaces.
168235
///
169236
/// List the workspaces associated with a Watson Assistant service instance.
@@ -4346,73 +4413,6 @@ public DetailedResponse<object> DeleteUserData(string customerId)
43464413
throw ae.Flatten();
43474414
}
43484415

4349-
return result;
4350-
}
4351-
/// <summary>
4352-
/// Identify intents and entities in multiple user utterances.
4353-
///
4354-
/// Send multiple user inputs to a workspace in a single request and receive information about the intents and
4355-
/// entities recognized in each input. This method is useful for testing and comparing the performance of
4356-
/// different workspaces.
4357-
///
4358-
/// This method is available only with Premium plans.
4359-
/// </summary>
4360-
/// <param name="workspaceId">Unique identifier of the workspace.</param>
4361-
/// <param name="input">An array of input utterances to classify. (optional)</param>
4362-
/// <returns><see cref="BulkClassifyResponse" />BulkClassifyResponse</returns>
4363-
public DetailedResponse<BulkClassifyResponse> BulkClassify(string workspaceId, List<BulkClassifyUtterance> input = null)
4364-
{
4365-
if (string.IsNullOrEmpty(workspaceId))
4366-
{
4367-
throw new ArgumentNullException("`workspaceId` is required for `BulkClassify`");
4368-
}
4369-
else
4370-
{
4371-
workspaceId = Uri.EscapeDataString(workspaceId);
4372-
}
4373-
if (string.IsNullOrEmpty(Version))
4374-
{
4375-
throw new ArgumentNullException("`Version` is required");
4376-
}
4377-
DetailedResponse<BulkClassifyResponse> result = null;
4378-
4379-
try
4380-
{
4381-
IClient client = this.Client;
4382-
SetAuthentication();
4383-
4384-
var restRequest = client.PostAsync($"{this.Endpoint}/v1/workspaces/{workspaceId}/bulk_classify");
4385-
4386-
restRequest.WithHeader("Accept", "application/json");
4387-
if (!string.IsNullOrEmpty(Version))
4388-
{
4389-
restRequest.WithArgument("version", Version);
4390-
}
4391-
restRequest.WithHeader("Content-Type", "application/json");
4392-
4393-
JObject bodyObject = new JObject();
4394-
if (input != null && input.Count > 0)
4395-
{
4396-
bodyObject["input"] = JToken.FromObject(input);
4397-
}
4398-
var httpContent = new StringContent(JsonConvert.SerializeObject(bodyObject), Encoding.UTF8, HttpMediaType.APPLICATION_JSON);
4399-
restRequest.WithBodyContent(httpContent);
4400-
4401-
restRequest.WithHeaders(Common.GetSdkHeaders("conversation", "v1", "BulkClassify"));
4402-
restRequest.WithHeaders(customRequestHeaders);
4403-
ClearCustomRequestHeaders();
4404-
4405-
result = restRequest.As<BulkClassifyResponse>().Result;
4406-
if (result == null)
4407-
{
4408-
result = new DetailedResponse<BulkClassifyResponse>();
4409-
}
4410-
}
4411-
catch (AggregateException ae)
4412-
{
4413-
throw ae.Flatten();
4414-
}
4415-
44164416
return result;
44174417
}
44184418
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2020.
2+
* (C) Copyright IBM Corp. 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.
@@ -24,6 +24,7 @@ namespace IBM.Watson.Assistant.v1
2424
public partial interface IAssistantService
2525
{
2626
DetailedResponse<MessageResponse> Message(string workspaceId, MessageInput input = null, List<RuntimeIntent> intents = null, List<RuntimeEntity> entities = null, bool? alternateIntents = null, Context context = null, OutputData output = null, bool? nodesVisitedDetails = null);
27+
DetailedResponse<BulkClassifyResponse> BulkClassify(string workspaceId, List<BulkClassifyUtterance> input = null);
2728
DetailedResponse<WorkspaceCollection> ListWorkspaces(long? pageLimit = null, bool? includeCount = null, string sort = null, string cursor = null, bool? includeAudit = null);
2829
DetailedResponse<Workspace> CreateWorkspace(string name = null, string description = null, string language = null, List<DialogNode> dialogNodes = null, List<Counterexample> counterexamples = null, Dictionary<string, object> metadata = null, bool? learningOptOut = null, WorkspaceSystemSettings systemSettings = null, List<Webhook> webhooks = null, List<CreateIntent> intents = null, List<CreateEntity> entities = null, bool? includeAudit = null);
2930
DetailedResponse<Workspace> GetWorkspace(string workspaceId, bool? export = null, bool? includeAudit = null, string sort = null);
@@ -68,6 +69,5 @@ public partial interface IAssistantService
6869
DetailedResponse<LogCollection> ListLogs(string workspaceId, string sort = null, string filter = null, long? pageLimit = null, string cursor = null);
6970
DetailedResponse<LogCollection> ListAllLogs(string filter, string sort = null, long? pageLimit = null, string cursor = null);
7071
DetailedResponse<object> DeleteUserData(string customerId);
71-
DetailedResponse<BulkClassifyResponse> BulkClassify(string workspaceId, List<BulkClassifyUtterance> input = null);
7272
}
7373
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 Newtonsoft.Json;
19+
20+
namespace IBM.Watson.Assistant.v1.Model
21+
{
22+
/// <summary>
23+
/// AgentAvailabilityMessage.
24+
/// </summary>
25+
public class AgentAvailabilityMessage
26+
{
27+
/// <summary>
28+
/// The text of the message.
29+
/// </summary>
30+
[JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)]
31+
public string Message { get; set; }
32+
}
33+
34+
}

src/IBM.Watson.Assistant.v1/Model/CounterexampleCollection.cs

Lines changed: 1 addition & 1 deletion
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. 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.

src/IBM.Watson.Assistant.v1/Model/CreateEntity.cs

Lines changed: 1 addition & 1 deletion
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. 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.

src/IBM.Watson.Assistant.v1/Model/CreateIntent.cs

Lines changed: 1 addition & 1 deletion
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. 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.

src/IBM.Watson.Assistant.v1/Model/DialogNodeOutputGeneric.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2020.
2+
* (C) Copyright IBM Corp. 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.
@@ -193,13 +193,13 @@ public class QueryTypeEnumValue
193193
/// next available agent.
194194
/// </summary>
195195
[JsonProperty("agent_available", NullValueHandling = NullValueHandling.Ignore)]
196-
public string AgentAvailable { get; protected set; }
196+
public AgentAvailabilityMessage AgentAvailable { get; protected set; }
197197
/// <summary>
198198
/// An optional message to be displayed to the user to indicate that no online agent is available to take over
199199
/// the conversation.
200200
/// </summary>
201201
[JsonProperty("agent_unavailable", NullValueHandling = NullValueHandling.Ignore)]
202-
public string AgentUnavailable { get; protected set; }
202+
public AgentAvailabilityMessage AgentUnavailable { get; protected set; }
203203
/// <summary>
204204
/// Routing or other contextual information to be used by target service desk systems.
205205
/// </summary>

src/IBM.Watson.Assistant.v1/Model/DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class ResponseTypeEnumValue
5151
/// next available agent.
5252
/// </summary>
5353
[JsonProperty("agent_available", NullValueHandling = NullValueHandling.Ignore)]
54-
public new string AgentAvailable
54+
public new AgentAvailabilityMessage AgentAvailable
5555
{
5656
get { return base.AgentAvailable; }
5757
set { base.AgentAvailable = value; }
@@ -61,7 +61,7 @@ public class ResponseTypeEnumValue
6161
/// the conversation.
6262
/// </summary>
6363
[JsonProperty("agent_unavailable", NullValueHandling = NullValueHandling.Ignore)]
64-
public new string AgentUnavailable
64+
public new AgentAvailabilityMessage AgentUnavailable
6565
{
6666
get { return base.AgentUnavailable; }
6767
set { base.AgentUnavailable = value; }

src/IBM.Watson.Assistant.v1/Model/MessageRequest.cs

Lines changed: 1 addition & 1 deletion
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. 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.

src/IBM.Watson.Assistant.v1/Model/RuntimeEntity.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2020.
2+
* (C) Copyright IBM Corp. 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.
@@ -57,11 +57,10 @@ public class RuntimeEntity
5757
[JsonProperty("groups", NullValueHandling = NullValueHandling.Ignore)]
5858
public List<CaptureGroup> Groups { get; set; }
5959
/// <summary>
60-
/// An object containing detailed information about the entity recognized in the user input. This property is
61-
/// included only if the new system entities are enabled for the workspace.
60+
/// An object containing detailed information about the entity recognized in the user input.
6261
///
63-
/// For more information about how the new system entities are interpreted, see the
64-
/// [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities).
62+
/// For more information about how system entities are interpreted, see the
63+
/// [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-system-entities).
6564
/// </summary>
6665
[JsonProperty("interpretation", NullValueHandling = NullValueHandling.Ignore)]
6766
public RuntimeEntityInterpretation Interpretation { get; set; }

0 commit comments

Comments
 (0)