Skip to content

Commit ce1c0a6

Browse files
authored
Merge pull request #292 from watson-developer-cloud/rc-2.9.0
v2.9.0
2 parents 65cbc48 + 25b3e8f commit ce1c0a6

File tree

109 files changed

+2682
-323
lines changed

Some content is hidden

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

109 files changed

+2682
-323
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[bumpversion]
22
commit = True
3-
current_version = 2.8.0
3+
current_version = 2.9.0
44

55
[bumpversion:file:Doxyfile]
66

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Watson Developer Cloud .NET Standard SDK"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 2.8.0
41+
PROJECT_NUMBER = 2.9.0
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

IBM.WatsonDeveloperCloud.sln

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.La
119119
EndProject
120120
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.LanguageTranslator.v3.UnitTests", "test\IBM.WatsonDeveloperCloud.LanguageTranslator.v3.UnitTests\IBM.WatsonDeveloperCloud.LanguageTranslator.v3.UnitTests.csproj", "{F1D7E642-0F19-497F-89E6-8D0FD747C595}"
121121
EndProject
122-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.WatsonDeveloperCloud.VisRec.v3.Example", "examples\IBM.WatsonDeveloperCloud.VisRec.v3.Example\IBM.WatsonDeveloperCloud.VisRec.v3.Example.csproj", "{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}"
122+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.VisRec.v3.Example", "examples\IBM.WatsonDeveloperCloud.VisRec.v3.Example\IBM.WatsonDeveloperCloud.VisRec.v3.Example.csproj", "{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}"
123+
EndProject
124+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AssistantV2", "AssistantV2", "{90E09BF8-A647-43B8-B721-05CAECFADD72}"
125+
EndProject
126+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Assistant.v2", "src\IBM.WatsonDeveloperCloud.Assistant.v2\IBM.WatsonDeveloperCloud.Assistant.v2.csproj", "{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}"
127+
EndProject
128+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Assistant.v2.UnitTests", "test\IBM.WatsonDeveloperCloud.Assistant.v2.UnitTests\IBM.WatsonDeveloperCloud.Assistant.v2.UnitTests.csproj", "{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}"
129+
EndProject
130+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Assistant.v2.IntTests", "test\IBM.WatsonDeveloperCloud.Assistant.v2.IntTests\IBM.WatsonDeveloperCloud.Assistant.v2.IntTests.csproj", "{200FC8C7-ED91-4F66-8674-D678588FC450}"
131+
EndProject
132+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.WatsonDeveloperCloud.Assistant.v2.Example", "examples\IBM.WatsonDeveloperCloud.Assistant.v2.Example\IBM.WatsonDeveloperCloud.Assistant.v2.Example.csproj", "{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}"
123133
EndProject
124134
Global
125135
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -299,6 +309,22 @@ Global
299309
{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
300310
{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
301311
{019DEDBF-2929-4AB3-AA58-A6C9D42604FC}.Release|Any CPU.Build.0 = Release|Any CPU
312+
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
313+
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}.Debug|Any CPU.Build.0 = Debug|Any CPU
314+
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}.Release|Any CPU.ActiveCfg = Release|Any CPU
315+
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200}.Release|Any CPU.Build.0 = Release|Any CPU
316+
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
317+
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}.Debug|Any CPU.Build.0 = Debug|Any CPU
318+
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}.Release|Any CPU.ActiveCfg = Release|Any CPU
319+
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47}.Release|Any CPU.Build.0 = Release|Any CPU
320+
{200FC8C7-ED91-4F66-8674-D678588FC450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
321+
{200FC8C7-ED91-4F66-8674-D678588FC450}.Debug|Any CPU.Build.0 = Debug|Any CPU
322+
{200FC8C7-ED91-4F66-8674-D678588FC450}.Release|Any CPU.ActiveCfg = Release|Any CPU
323+
{200FC8C7-ED91-4F66-8674-D678588FC450}.Release|Any CPU.Build.0 = Release|Any CPU
324+
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
325+
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Debug|Any CPU.Build.0 = Debug|Any CPU
326+
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Release|Any CPU.ActiveCfg = Release|Any CPU
327+
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33}.Release|Any CPU.Build.0 = Release|Any CPU
302328
EndGlobalSection
303329
GlobalSection(SolutionProperties) = preSolution
304330
HideSolutionNode = FALSE
@@ -361,6 +387,11 @@ Global
361387
{5DAAA089-EDCA-448F-835E-1EB1CAEB0226} = {65D78D49-E54F-4952-A1D4-7C8D0EDAA1B3}
362388
{F1D7E642-0F19-497F-89E6-8D0FD747C595} = {65D78D49-E54F-4952-A1D4-7C8D0EDAA1B3}
363389
{019DEDBF-2929-4AB3-AA58-A6C9D42604FC} = {A1BC3262-1837-40D9-A530-DCFE679927C2}
390+
{90E09BF8-A647-43B8-B721-05CAECFADD72} = {28E61676-E9FF-4DA9-99CC-5E0D16F02380}
391+
{817CCCEB-FBAF-4BEB-A99B-3EE4F09F9200} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
392+
{5FBF32E9-0352-4D8B-BED2-D6EE04363A47} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
393+
{200FC8C7-ED91-4F66-8674-D678588FC450} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
394+
{125A4EB4-D769-4EA7-A18D-8D7D568B5B33} = {90E09BF8-A647-43B8-B721-05CAECFADD72}
364395
EndGlobalSection
365396
GlobalSection(ExtensibilityGlobals) = postSolution
366397
SolutionGuid = {B9D9D17B-1C17-402F-B701-DC671528690A}

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Ensure you have the following prerequisites:
2626
## Installing the Watson .NET Standard SDK
2727
You can get the latest SDK packages through NuGet. Installation instructions can be found in the ReadMe of each package.
2828

29-
* [Assistant](/src/IBM.WatsonDeveloperCloud.Assistant.v1)
29+
* [Assistant V1](/src/IBM.WatsonDeveloperCloud.Assistant.v1)
30+
* [Assistant V2](/src/IBM.WatsonDeveloperCloud.Assistant.v2)
3031
* [Conversation](/src/IBM.WatsonDeveloperCloud.Conversation.v1)
3132
* [Discovery](/src/IBM.WatsonDeveloperCloud.Discovery.v1)
3233
* [Language Translator V2](/src/IBM.WatsonDeveloperCloud.LanguageTranslator.v2) (deprecated)
@@ -143,6 +144,17 @@ void Example()
143144
}
144145
```
145146

147+
## Self signed certificates
148+
You can disable SSL verification on calls to Watson (only do this if you really mean to!).
149+
```cs
150+
void Example()
151+
{
152+
AssistantService assistant = new AssistantService("<username>", "<password>", "<version-date>");
153+
assistant.SendAsInsecure(true);
154+
var results = assistant.Message("<workspace-id>", "<message-request>");
155+
}
156+
```
157+
146158
## Documentation
147159
Click [here][dotnet-standard-sdk-documentation] for documentation by release and branch.
148160

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+

2+
3+
using IBM.WatsonDeveloperCloud.Assistant.v2.Model;
4+
using Newtonsoft.Json;
5+
using System;
6+
/**
7+
* Copyright 2018 IBM Corp. All Rights Reserved.
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License");
10+
* you may not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS,
17+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*
21+
*/
22+
namespace IBM.WatsonDeveloperCloud.Assistant.v2.Example
23+
{
24+
internal class AssistantServiceExample
25+
{
26+
private AssistantService _assistant;
27+
private string _assistantId;
28+
private string[] _questionArray = { "", "good", "i want a pizza", "large", "three" };
29+
private int _questionIndex = 0;
30+
private string _sessionId;
31+
32+
public AssistantServiceExample(string url, string username, string password, string assistantId)
33+
{
34+
_assistant = new AssistantService(username, password, "2018-09-20");
35+
_assistant.SetEndpoint(url);
36+
37+
_assistantId = assistantId;
38+
39+
var session = _assistant.CreateSession(_assistantId);
40+
_sessionId = session.SessionId;
41+
42+
CallAssistant(_questionIndex);
43+
}
44+
45+
public void CallAssistant(int questionIndex)
46+
{
47+
MessageRequest messageRequest = new MessageRequest()
48+
{
49+
Input = new MessageInput()
50+
{
51+
Text = _questionArray[questionIndex]
52+
}
53+
};
54+
55+
Console.WriteLine(_questionArray[questionIndex]);
56+
var result = _assistant.Message(_assistantId, _sessionId, messageRequest);
57+
Console.WriteLine(result.Output.Generic[0].Text);
58+
_questionIndex++;
59+
60+
if (questionIndex < _questionArray.Length - 1)
61+
{
62+
CallAssistant(_questionIndex);
63+
}
64+
else
65+
{
66+
_assistant.DeleteSession(_assistantId, _sessionId);
67+
Console.WriteLine("Session deleted!");
68+
}
69+
}
70+
}
71+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 IBM.WatsonDeveloperCloud.Util;
19+
using Newtonsoft.Json;
20+
using Newtonsoft.Json.Linq;
21+
using System;
22+
using System.IO;
23+
24+
namespace IBM.WatsonDeveloperCloud.Assistant.v2.Example
25+
{
26+
class Example
27+
{
28+
static void Main(string[] args)
29+
{
30+
string credentials = string.Empty;
31+
32+
#region Get Credentials
33+
string _endpoint = string.Empty;
34+
string _username = string.Empty;
35+
string _password = string.Empty;
36+
string _assistantId = string.Empty;
37+
38+
if (string.IsNullOrEmpty(credentials))
39+
{
40+
var parentDirectory = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.Parent.Parent.FullName;
41+
string credentialsFilepath = parentDirectory + Path.DirectorySeparatorChar + "sdk-credentials" + Path.DirectorySeparatorChar + "credentials.json";
42+
if (File.Exists(credentialsFilepath))
43+
{
44+
try
45+
{
46+
credentials = File.ReadAllText(credentialsFilepath);
47+
credentials = Utility.AddTopLevelObjectToJson(credentials, "VCAP_SERVICES");
48+
}
49+
catch (Exception e)
50+
{
51+
throw new Exception(string.Format("Failed to load credentials: {0}", e.Message));
52+
}
53+
54+
VcapCredentials vcapCredentials = JsonConvert.DeserializeObject<VcapCredentials>(credentials);
55+
var vcapServices = JObject.Parse(credentials);
56+
57+
Credential credential = vcapCredentials.GetCredentialByname("assistantV2-sdk-staging")[0].Credentials;
58+
_endpoint = credential.Url;
59+
_username = credential.Username;
60+
_password = credential.Password;
61+
_assistantId = credential.AssistantId;
62+
}
63+
else
64+
{
65+
Console.WriteLine("Credentials file does not exist. Please define credentials.");
66+
_username = "";
67+
_password = "";
68+
_endpoint = "";
69+
_assistantId = "";
70+
}
71+
}
72+
#endregion
73+
74+
AssistantServiceExample _AssistantServiceExample = new AssistantServiceExample(_endpoint, _username, _password, _assistantId);
75+
76+
Console.ReadKey();
77+
}
78+
}
79+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<VersionPrefix>2.8.0</VersionPrefix>
4+
<TargetFramework>netcoreapp1.0</TargetFramework>
5+
<AssemblyName>IBM.WatsonDeveloperCloud.Conversation.v1.Example</AssemblyName>
6+
<OutputType>Exe</OutputType>
7+
<PackageId>IBM.WatsonDeveloperCloud.Conversation.v1.Example</PackageId>
8+
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
9+
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
10+
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
11+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
12+
<Version>2.8.0</Version>
13+
</PropertyGroup>
14+
15+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
16+
<DebugType>full</DebugType>
17+
<DebugSymbols>true</DebugSymbols>
18+
</PropertyGroup>
19+
20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
21+
<DebugType>full</DebugType>
22+
<DebugSymbols>true</DebugSymbols>
23+
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<ProjectReference Include="..\..\src\IBM.WatsonDeveloperCloud.Assistant.v2\IBM.WatsonDeveloperCloud.Assistant.v2.csproj" />
27+
<ProjectReference Include="..\..\src\IBM.WatsonDeveloperCloud\IBM.WatsonDeveloperCloud.csproj" />
28+
</ItemGroup>
29+
30+
<ItemGroup>
31+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
32+
</ItemGroup>
33+
34+
</Project>

examples/IBM.WatsonDeveloperCloud.Conversation.v1.Example/IBM.WatsonDeveloperCloud.Conversation.v1.Example.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<VersionPrefix>2.8.0</VersionPrefix>
4+
<VersionPrefix>2.9.0</VersionPrefix>
55
<TargetFramework>netcoreapp1.0</TargetFramework>
66
<AssemblyName>IBM.WatsonDeveloperCloud.Conversation.v1.Example</AssemblyName>
77
<OutputType>Exe</OutputType>
@@ -10,7 +10,7 @@
1010
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1111
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1212
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
13-
<Version>2.8.0</Version>
13+
<Version>2.9.0</Version>
1414
</PropertyGroup>
1515

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

examples/IBM.WatsonDeveloperCloud.Discovery.v1.Example/IBM.WatsonDeveloperCloud.Discovery.v1.Example.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<VersionPrefix>2.8.0</VersionPrefix>
4+
<VersionPrefix>2.9.0</VersionPrefix>
55
<TargetFramework>netcoreapp1.0</TargetFramework>
66
<AssemblyName>IBM.WatsonDeveloperCloud.Discovery.v1.Example</AssemblyName>
77
<OutputType>Exe</OutputType>
@@ -10,7 +10,7 @@
1010
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1111
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1212
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
13-
<Version>2.8.0</Version>
13+
<Version>2.9.0</Version>
1414
</PropertyGroup>
1515

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

examples/IBM.WatsonDeveloperCloud.LanguageTranslator.v2.Example/IBM.WatsonDeveloperCloud.LanguageTranslator.v2.Example.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<VersionPrefix>2.8.0</VersionPrefix>
4+
<VersionPrefix>2.9.0</VersionPrefix>
55
<TargetFramework>netcoreapp1.0</TargetFramework>
66
<AssemblyName>IBM.WatsonDeveloperCloud.LanguageTranslator.v2.Example</AssemblyName>
77
<OutputType>Exe</OutputType>
@@ -10,7 +10,7 @@
1010
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1111
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1212
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
13-
<Version>2.8.0</Version>
13+
<Version>2.9.0</Version>
1414
</PropertyGroup>
1515

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

0 commit comments

Comments
 (0)