Skip to content

Commit 781401e

Browse files
authored
Merge pull request #239 from watson-developer-cloud/rc-2.3.0
.NET Standard SDK v2.3.0
2 parents 4be6013 + 490d654 commit 781401e

File tree

117 files changed

+3216
-860
lines changed

Some content is hidden

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

117 files changed

+3216
-860
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,7 @@ _Pvt_Extensions
239239
.fake/
240240
/src/IBM.WatsonDeveloperCloud.LanguageTranslator.Test/appsettings.json
241241
/test/IBM.WatsonDeveloperCloud.LanguageTranslator.v2.IntegrationTests/appsettings.json
242+
243+
**/.swagger-codegen-ignore
244+
**/.swagger-codegen
245+
src/tests/

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
Change Log
22
==========
3+
## Version 2.3.0
4+
_2018-05-29_
5+
* Regenerated SDK based on the latest API definition. All services except for Natural Language Classifier support IAM authentication.
6+
* Service endpoint is set to the `gateway-a` endpoint if the user authenticates using apikey rather than TokenOptions.
7+
* Where a file is required we now use `FileStream` rather than `Stream` to preserve the filename.
8+
* New: Add `SetEndpoint()` method to the service base class. This sets a flag so we can keep track if the user manually changed the service endpoint and if so will not automatically change the endpoint.
9+
* Fixed: Disambiguate `IamUrl` and `ServiceUrl`. The `IamUrl` is now user configurable.
10+
311
## Version 2.2.2
412
_2018-05-18_
513
* Regenerated SDK based on latest API definition.

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.2.2
41+
PROJECT_NUMBER = 2.3.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

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ void Example()
7272
```
7373

7474
## IAM Authentication
75-
You can authenticate using IAM rather than username and password. You can either allow the SDK to manage the token by providing your IAM apikey or manage the token yourself by providing an access token.
75+
You can authenticate using IAM rather than username and password or apikey. You can either allow the SDK to manage the token by providing your IAM apikey or manage the token yourself by providing an access token.
7676
```cs
7777
void Example()
7878
{
7979
// Provide either an iamApiKey or iamAccessToken to authenticate the service.
8080
TokenOptions iamAssistantTokenOptions = new TokenOptions()
8181
{
8282
IamApiKey = "<iam-apikey>",
83-
IamAccessToken = "<iam-access-token>"
83+
IamAccessToken = "<iam-access-token>",
84+
IamUrl = "<service-endpoint>"
8485
};
8586

8687
_assistant = new AssistantService(iamAssistantTokenOptions, "<version-date>");

examples/IBM.WatsonDeveloperCloud.Conversation.v1.Example/ConversationContextExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ConversationContextExample
3232
public ConversationContextExample(string url, string username, string password, string workspaceId)
3333
{
3434
_conversation = new ConversationService(username, password, "2018-02-16");
35-
_conversation.Endpoint = url;
35+
_conversation.SetEndpoint(url);
3636

3737
_workspaceID = workspaceId;
3838

examples/IBM.WatsonDeveloperCloud.Conversation.v1.Example/ConversationServiceExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class ConversationServiceExample
4646
public ConversationServiceExample(string url, string username, string password, string workspaceID)
4747
{
4848
_conversation = new ConversationService(username, password, "2018-02-16");
49-
_conversation.Endpoint = url;
49+
_conversation.SetEndpoint(url);
5050

5151
_workspaceID = workspaceID;
5252

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.2.2</VersionPrefix>
4+
<VersionPrefix>2.3.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.2.2</Version>
13+
<Version>2.3.0</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

examples/IBM.WatsonDeveloperCloud.Discovery.v1.Example/DiscoveryServiceExample.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class DiscoveryServiceExample
6161
public DiscoveryServiceExample(string url, string username, string password)
6262
{
6363
_discovery = new DiscoveryService(username, password, "2017-11-07");
64-
_discovery.Endpoint = url;
64+
_discovery.SetEndpoint(url);
6565

6666
GetEnvironments();
6767
//CreateEnvironment();
@@ -116,13 +116,13 @@ public void GetEnvironments()
116116
{
117117
Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
118118

119-
foreach (Model.Environment environment in result.Environments)
120-
{
121-
if (!(bool)environment._ReadOnly)
122-
{
123-
_existingEnvironmentId = environment.EnvironmentId;
124-
Console.WriteLine(string.Format("\nEnvironment found, Setting environment to {0}", environment.Name));
125-
}
119+
foreach (Model.Environment environment in result.Environments)
120+
{
121+
if (!(bool)environment._ReadOnly)
122+
{
123+
_existingEnvironmentId = environment.EnvironmentId;
124+
Console.WriteLine(string.Format("\nEnvironment found, Setting environment to {0}", environment.Name));
125+
}
126126
}
127127
}
128128
else
@@ -244,7 +244,7 @@ private void PreviewEnvironment()
244244

245245
using (FileStream fs = File.OpenRead(_filepathToIngest))
246246
{
247-
var result = _discovery.TestConfigurationInEnvironment(_existingEnvironmentId, null, "enrich", _createdConfigurationId, fs as Stream, _metadata);
247+
var result = _discovery.TestConfigurationInEnvironment(_existingEnvironmentId, null, "enrich", _createdConfigurationId, fs, _metadata);
248248

249249
if (result != null)
250250
{
@@ -478,7 +478,7 @@ private void AddDocument()
478478
Console.WriteLine(string.Format("\nCalling AddDocument()..."));
479479
using (FileStream fs = File.OpenRead(_filepathToIngest))
480480
{
481-
var result = _discovery.AddDocument(_existingEnvironmentId, _createdCollectionId, fs as Stream, _metadata);
481+
var result = _discovery.AddDocument(_existingEnvironmentId, _createdCollectionId, fs, _metadata);
482482

483483
if (result != null)
484484
{
@@ -513,7 +513,7 @@ private void UpdateDocument()
513513
Console.WriteLine(string.Format("\nCalling UpdateDocument()..."));
514514
using (FileStream fs = File.OpenRead(_filepathToIngest))
515515
{
516-
var result = _discovery.UpdateDocument(_existingEnvironmentId, _createdCollectionId, _createdDocumentId, fs as Stream, _metadata);
516+
var result = _discovery.UpdateDocument(_existingEnvironmentId, _createdCollectionId, _createdDocumentId, fs, _metadata);
517517

518518
if (result != null)
519519
{

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.2.2</VersionPrefix>
4+
<VersionPrefix>2.3.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.2.2</Version>
13+
<Version>2.3.0</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

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.2.2</VersionPrefix>
4+
<VersionPrefix>2.3.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.2.2</Version>
13+
<Version>2.3.0</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

0 commit comments

Comments
 (0)