Skip to content

Commit 695d1d1

Browse files
authored
Merge pull request #303 from watson-developer-cloud/5601-regenerate-sdk
5601 regenerate sdk
2 parents 5479470 + 8cfd2f5 commit 695d1d1

File tree

44 files changed

+1029
-312
lines changed

Some content is hidden

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

44 files changed

+1029
-312
lines changed

src/IBM.WatsonDeveloperCloud.Assistant.v1/Model/DialogNodeAction.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,19 @@ public enum ActionTypeEnum
4646
/// Enum SERVER for server
4747
/// </summary>
4848
[EnumMember(Value = "server")]
49-
SERVER
49+
SERVER,
50+
51+
/// <summary>
52+
/// Enum CLOUD_FUNCTION for cloud_function
53+
/// </summary>
54+
[EnumMember(Value = "cloud_function")]
55+
CLOUD_FUNCTION,
56+
57+
/// <summary>
58+
/// Enum WEB_ACTION for web_action
59+
/// </summary>
60+
[EnumMember(Value = "web_action")]
61+
WEB_ACTION
5062
}
5163

5264
/// <summary>

src/IBM.WatsonDeveloperCloud.Assistant.v2/IBM.WatsonDeveloperCloud.Assistant.v2.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Description>IBM.WatsonDeveloperCloud.Assistant.v2 wraps the Watson Developer Cloud Assistant service (http://www.ibm.com/watson/developercloud/assistant.html)</Description>
55
<AssemblyTitle>IBM.WatsonDeveloperCloud.Assistant.v2</AssemblyTitle>
6-
<VersionPrefix>2.9.0</VersionPrefix>
6+
<VersionPrefix>2.10.0</VersionPrefix>
77
<Authors>Watson Developer Cloud</Authors>
88
<TargetFramework>netstandard1.3</TargetFramework>
99
<AssemblyName>IBM.WatsonDeveloperCloud.Assistant.v2</AssemblyName>
@@ -12,7 +12,7 @@
1212
<PackageIconUrl>https://watson-developer-cloud.github.io/dotnet-standard-sdk/img/Watson_Avatar_Pos_RGB.png</PackageIconUrl>
1313
<PackageProjectUrl>https://github.com/watson-developer-cloud/dotnet-standard-sdk</PackageProjectUrl>
1414
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
15-
<Version>2.9.0</Version>
15+
<Version>2.10.0</Version>
1616
</PropertyGroup>
1717

1818
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

src/IBM.WatsonDeveloperCloud.Assistant.v2/Model/DialogNodeAction.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,19 @@ public enum ActionTypeEnum
4646
/// Enum SERVER for server
4747
/// </summary>
4848
[EnumMember(Value = "server")]
49-
SERVER
49+
SERVER,
50+
51+
/// <summary>
52+
/// Enum WEB_ACTION for web-action
53+
/// </summary>
54+
[EnumMember(Value = "web-action")]
55+
WEB_ACTION,
56+
57+
/// <summary>
58+
/// Enum CLOUD_FUNCTION for cloud-function
59+
/// </summary>
60+
[EnumMember(Value = "cloud-function")]
61+
CLOUD_FUNCTION
5062
}
5163

5264
/// <summary>

src/IBM.WatsonDeveloperCloud.Conversation.v1/ConversationService.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
*/
1717

1818
using System.Collections.Generic;
19-
using System.Text;
2019
using IBM.WatsonDeveloperCloud.Conversation.v1.Model;
2120
using IBM.WatsonDeveloperCloud.Http;
2221
using IBM.WatsonDeveloperCloud.Service;
2322
using IBM.WatsonDeveloperCloud.Util;
24-
using Newtonsoft.Json;
2523
using System;
2624

2725
namespace IBM.WatsonDeveloperCloud.Conversation.v1

src/IBM.WatsonDeveloperCloud.Discovery.v1/DiscoveryService.cs

Lines changed: 156 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,59 @@ public Expansions CreateExpansions(string environmentId, string collectionId, Ex
11301130
return result;
11311131
}
11321132

1133+
/// <summary>
1134+
/// Create tokenization dictionary.
1135+
///
1136+
/// Upload a custom tokenization dictionary to use with the specified collection.
1137+
/// </summary>
1138+
/// <param name="environmentId">The ID of the environment.</param>
1139+
/// <param name="collectionId">The ID of the collection.</param>
1140+
/// <param name="tokenizationDictionary">An object that represents the tokenization dictionary to be uploaded.
1141+
/// (optional)</param>
1142+
/// <param name="customData">Custom data object to pass data including custom request headers.</param>
1143+
/// <returns><see cref="TokenDictStatusResponse" />TokenDictStatusResponse</returns>
1144+
public TokenDictStatusResponse CreateTokenizationDictionary(string environmentId, string collectionId, TokenDict tokenizationDictionary = null, Dictionary<string, object> customData = null)
1145+
{
1146+
if (string.IsNullOrEmpty(environmentId))
1147+
throw new ArgumentNullException(nameof(environmentId));
1148+
if (string.IsNullOrEmpty(collectionId))
1149+
throw new ArgumentNullException(nameof(collectionId));
1150+
1151+
if(string.IsNullOrEmpty(VersionDate))
1152+
throw new ArgumentNullException("versionDate cannot be null.");
1153+
1154+
TokenDictStatusResponse result = null;
1155+
1156+
try
1157+
{
1158+
IClient client;
1159+
if(_tokenManager == null)
1160+
{
1161+
client = this.Client.WithAuthentication(this.UserName, this.Password);
1162+
}
1163+
else
1164+
{
1165+
client = this.Client.WithAuthentication(_tokenManager.GetToken());
1166+
}
1167+
var restRequest = client.PostAsync($"{this.Endpoint}/v1/environments/{environmentId}/collections/{collectionId}/word_lists/tokenization_dictionary");
1168+
1169+
restRequest.WithArgument("version", VersionDate);
1170+
restRequest.WithBody<TokenDict>(tokenizationDictionary);
1171+
if (customData != null)
1172+
restRequest.WithCustomData(customData);
1173+
result = restRequest.As<TokenDictStatusResponse>().Result;
1174+
if(result == null)
1175+
result = new TokenDictStatusResponse();
1176+
result.CustomData = restRequest.CustomData;
1177+
}
1178+
catch(AggregateException ae)
1179+
{
1180+
throw ae.Flatten();
1181+
}
1182+
1183+
return result;
1184+
}
1185+
11331186
/// <summary>
11341187
/// Delete the expansion list.
11351188
///
@@ -1181,6 +1234,106 @@ public BaseModel DeleteExpansions(string environmentId, string collectionId, Dic
11811234
return result;
11821235
}
11831236

1237+
/// <summary>
1238+
/// Delete tokenization dictionary.
1239+
///
1240+
/// Delete the tokenization dictionary from the collection.
1241+
/// </summary>
1242+
/// <param name="environmentId">The ID of the environment.</param>
1243+
/// <param name="collectionId">The ID of the collection.</param>
1244+
/// <param name="customData">Custom data object to pass data including custom request headers.</param>
1245+
/// <returns><see cref="BaseModel" />BaseModel</returns>
1246+
public BaseModel DeleteTokenizationDictionary(string environmentId, string collectionId, Dictionary<string, object> customData = null)
1247+
{
1248+
if (string.IsNullOrEmpty(environmentId))
1249+
throw new ArgumentNullException(nameof(environmentId));
1250+
if (string.IsNullOrEmpty(collectionId))
1251+
throw new ArgumentNullException(nameof(collectionId));
1252+
1253+
if(string.IsNullOrEmpty(VersionDate))
1254+
throw new ArgumentNullException("versionDate cannot be null.");
1255+
1256+
BaseModel result = null;
1257+
1258+
try
1259+
{
1260+
IClient client;
1261+
if(_tokenManager == null)
1262+
{
1263+
client = this.Client.WithAuthentication(this.UserName, this.Password);
1264+
}
1265+
else
1266+
{
1267+
client = this.Client.WithAuthentication(_tokenManager.GetToken());
1268+
}
1269+
var restRequest = client.DeleteAsync($"{this.Endpoint}/v1/environments/{environmentId}/collections/{collectionId}/word_lists/tokenization_dictionary");
1270+
1271+
restRequest.WithArgument("version", VersionDate);
1272+
if (customData != null)
1273+
restRequest.WithCustomData(customData);
1274+
result = restRequest.As<BaseModel>().Result;
1275+
if(result == null)
1276+
result = new BaseModel();
1277+
result.CustomData = restRequest.CustomData;
1278+
}
1279+
catch(AggregateException ae)
1280+
{
1281+
throw ae.Flatten();
1282+
}
1283+
1284+
return result;
1285+
}
1286+
1287+
/// <summary>
1288+
/// Get tokenization dictionary status.
1289+
///
1290+
/// Returns the current status of the tokenization dictionary for the specified collection.
1291+
/// </summary>
1292+
/// <param name="environmentId">The ID of the environment.</param>
1293+
/// <param name="collectionId">The ID of the collection.</param>
1294+
/// <param name="customData">Custom data object to pass data including custom request headers.</param>
1295+
/// <returns><see cref="TokenDictStatusResponse" />TokenDictStatusResponse</returns>
1296+
public TokenDictStatusResponse GetTokenizationDictionaryStatus(string environmentId, string collectionId, Dictionary<string, object> customData = null)
1297+
{
1298+
if (string.IsNullOrEmpty(environmentId))
1299+
throw new ArgumentNullException(nameof(environmentId));
1300+
if (string.IsNullOrEmpty(collectionId))
1301+
throw new ArgumentNullException(nameof(collectionId));
1302+
1303+
if(string.IsNullOrEmpty(VersionDate))
1304+
throw new ArgumentNullException("versionDate cannot be null.");
1305+
1306+
TokenDictStatusResponse result = null;
1307+
1308+
try
1309+
{
1310+
IClient client;
1311+
if(_tokenManager == null)
1312+
{
1313+
client = this.Client.WithAuthentication(this.UserName, this.Password);
1314+
}
1315+
else
1316+
{
1317+
client = this.Client.WithAuthentication(_tokenManager.GetToken());
1318+
}
1319+
var restRequest = client.GetAsync($"{this.Endpoint}/v1/environments/{environmentId}/collections/{collectionId}/word_lists/tokenization_dictionary");
1320+
1321+
restRequest.WithArgument("version", VersionDate);
1322+
if (customData != null)
1323+
restRequest.WithCustomData(customData);
1324+
result = restRequest.As<TokenDictStatusResponse>().Result;
1325+
if(result == null)
1326+
result = new TokenDictStatusResponse();
1327+
result.CustomData = restRequest.CustomData;
1328+
}
1329+
catch(AggregateException ae)
1330+
{
1331+
throw ae.Flatten();
1332+
}
1333+
1334+
return result;
1335+
}
1336+
11841337
/// <summary>
11851338
/// Get the expansion list.
11861339
///
@@ -1584,6 +1737,7 @@ public DocumentAccepted UpdateDocument(string environmentId, string collectionId
15841737
/// field values closer to the current date. When a **number** type field is specified, returned results are
15851738
/// biased towards higher field values. This parameter cannot be used in the same query as the **sort** parameter.
15861739
/// (optional)</param>
1740+
15871741
/// <param name="loggingOptOut">If `true`, queries are not stored in the Discovery **Logs** endpoint. (optional,
15881742
/// default to false)</param>
15891743
/// <param name="customData">Custom data object to pass data including custom request headers.</param>
@@ -1592,10 +1746,8 @@ public QueryResponse FederatedQuery(string environmentId, List<string> collectio
15921746
{
15931747
if (string.IsNullOrEmpty(environmentId))
15941748
throw new ArgumentNullException(nameof(environmentId));
1595-
if (collectionIds == null)
1596-
throw new ArgumentNullException(nameof(collectionIds));
15971749

1598-
if (string.IsNullOrEmpty(VersionDate))
1750+
if(string.IsNullOrEmpty(VersionDate))
15991751
throw new ArgumentNullException("versionDate cannot be null.");
16001752

16011753
QueryResponse result = null;
@@ -1642,6 +1794,7 @@ public QueryResponse FederatedQuery(string environmentId, List<string> collectio
16421794
};
16431795

16441796
restRequest.WithBody<QueryLarge>(queryLarge);
1797+
16451798
if (customData != null)
16461799
restRequest.WithCustomData(customData);
16471800
result = restRequest.As<QueryResponse>().Result;

src/IBM.WatsonDeveloperCloud.Discovery.v1/IDiscoveryService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
using System;
1919
using System.Collections.Generic;
20-
using System.Runtime.Serialization;
2120
using IBM.WatsonDeveloperCloud.Discovery.v1.Model;
2221
using Environment = IBM.WatsonDeveloperCloud.Discovery.v1.Model.Environment;
2322

@@ -44,7 +43,10 @@ public partial interface IDiscoveryService
4443
ListCollectionsResponse ListCollections(string environmentId, string name = null, Dictionary<string, object> customData = null);
4544
Collection UpdateCollection(string environmentId, string collectionId, UpdateCollectionRequest body = null, Dictionary<string, object> customData = null);
4645
Expansions CreateExpansions(string environmentId, string collectionId, Expansions body, Dictionary<string, object> customData = null);
46+
TokenDictStatusResponse CreateTokenizationDictionary(string environmentId, string collectionId, TokenDict tokenizationDictionary = null, Dictionary<string, object> customData = null);
4747
BaseModel DeleteExpansions(string environmentId, string collectionId, Dictionary<string, object> customData = null);
48+
BaseModel DeleteTokenizationDictionary(string environmentId, string collectionId, Dictionary<string, object> customData = null);
49+
TokenDictStatusResponse GetTokenizationDictionaryStatus(string environmentId, string collectionId, Dictionary<string, object> customData = null);
4850
Expansions ListExpansions(string environmentId, string collectionId, Dictionary<string, object> customData = null);
4951
DocumentAccepted AddDocument(string environmentId, string collectionId, System.IO.FileStream file = null, string metadata = null, string fileContentType = null, Dictionary<string, object> customData = null);
5052
DeleteDocumentResponse DeleteDocument(string environmentId, string collectionId, string documentId, Dictionary<string, object> customData = null);

src/IBM.WatsonDeveloperCloud.Discovery.v1/Model/CreateEnvironmentRequest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ public SizeEnum? StringSize
134134
[JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)]
135135
private string _convertedSize;
136136

137-
138137
/// <summary>
139138
/// Name that identifies the environment.
140139
/// </summary>

src/IBM.WatsonDeveloperCloud.Discovery.v1/Model/Environment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ public SizeEnum? StringSize
171171
/// <summary>
172172
/// Size of the environment
173173
/// </summary>
174+
174175
[JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)]
175176
private string _convertedSize;
176177

177-
178178
/// <summary>
179179
/// Unique identifier for the environment.
180180
/// </summary>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
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.WatsonDeveloperCloud.Discovery.v1.Model
22+
{
23+
/// <summary>
24+
/// Tokenization dictionary describing how words are tokenized during ingestion and at query time.
25+
/// </summary>
26+
public class TokenDict : BaseModel
27+
{
28+
/// <summary>
29+
/// An array of tokenization rules. Each rule contains, the original `text` string, component `tokens`, any
30+
/// alternate character set `readings`, and which `part_of_speech` the text is from.
31+
/// </summary>
32+
[JsonProperty("tokenization_rules", NullValueHandling = NullValueHandling.Ignore)]
33+
public List<TokenDictRule> TokenizationRules { get; set; }
34+
}
35+
36+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
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.WatsonDeveloperCloud.Discovery.v1.Model
22+
{
23+
/// <summary>
24+
/// An object defining a single tokenizaion rule.
25+
/// </summary>
26+
public class TokenDictRule : BaseModel
27+
{
28+
/// <summary>
29+
/// The string to tokenize.
30+
/// </summary>
31+
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)]
32+
public string Text { get; set; }
33+
/// <summary>
34+
/// Array of tokens that the `text` field is split into when found.
35+
/// </summary>
36+
[JsonProperty("tokens", NullValueHandling = NullValueHandling.Ignore)]
37+
public List<string> Tokens { get; set; }
38+
/// <summary>
39+
/// Array of tokens that represent the content of the `text` field in an alternate character set.
40+
/// </summary>
41+
[JsonProperty("readings", NullValueHandling = NullValueHandling.Ignore)]
42+
public List<string> Readings { get; set; }
43+
/// <summary>
44+
/// The part of speech that the `text` string belongs to. For example `noun`. Custom parts of speech can be
45+
/// specified.
46+
/// </summary>
47+
[JsonProperty("part_of_speech", NullValueHandling = NullValueHandling.Ignore)]
48+
public string PartOfSpeech { get; set; }
49+
}
50+
51+
}

0 commit comments

Comments
 (0)