Skip to content

Commit 903c16d

Browse files
authored
Merge pull request #257 from watson-developer-cloud/rc-2.4.2
.NET SDK 2.4.2
2 parents 3ab01ec + d76dc1d commit 903c16d

File tree

62 files changed

+204
-403
lines changed

Some content is hidden

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

62 files changed

+204
-403
lines changed

CHANGELOG.md

Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1 @@
1-
Change Log
2-
==========
3-
## Version 2.4.1
4-
_2018-06-20_
5-
* Regenerated SDK based on the latest API definition.
6-
* Added IAM authentication support for Natural Language Classifier.
7-
8-
## Version 2.4.0
9-
_2018-06-12_
10-
* Regenerated SDK based on the latest API definition.
11-
* New: Support for Language Translator v3.
12-
* Fixed: Added a null header check in ErrorFilter.cs.
13-
*
14-
## Version 2.3.0
15-
_2018-05-29_
16-
* Regenerated SDK based on the latest API definition. All services except for Natural Language Classifier support IAM authentication.
17-
* Service endpoint is set to the `gateway-a` endpoint if the user authenticates using apikey rather than TokenOptions.
18-
* Where a file is required we now use `FileStream` rather than `Stream` to preserve the filename.
19-
* 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.
20-
* Fixed: Disambiguate `IamUrl` and `ServiceUrl`. The `IamUrl` is now user configurable.
21-
22-
## Version 2.2.2
23-
_2018-05-18_
24-
* Regenerated SDK based on latest API definition.
25-
* Fixed: Added in hand written sessions methods for Speech to Text ([#204](https://github.com/watson-developer-cloud/dotnet-standard-sdk/issues/204), [#205](https://github.com/watson-developer-cloud/dotnet-standard-sdk/pull/205)).
26-
* Fixed: Revised type of `Timestamps` and `WordConfidence` in `SpeechRecognitionAlternative.cs` from `List<string>` to `string[][]` ([#198](https://github.com/watson-developer-cloud/dotnet-standard-sdk/issues/198), [#205](https://github.com/watson-developer-cloud/dotnet-standard-sdk/pull/205)).
27-
* New: Revised tests to get credentials from our internal credential github repo([#4456](https://github.ibm.com/Watson/developer-experience/issues/4456), [#215](https://github.com/watson-developer-cloud/dotnet-standard-sdk/pull/215)).
28-
* New: Support for IAM authentication ([#4288](https://zenhub.innovate.ibm.com/app/workspace/o/watson/developer-experience/issues/4288), [#210](https://github.com/watson-developer-cloud/dotnet-standard-sdk/pull/210)).
29-
30-
## Version 2.2.1
31-
_2018-04-21_
32-
* New: Support for custom request and response headers ([#4311](https://github.ibm.com/Watson/developer-experience/issues/4311), [#206](https://github.com/watson-developer-cloud/dotnet-standard-sdk/pull/206)).
33-
34-
## Version 2.2.0
35-
_2018-04-09_
36-
* New: Updated Visual Recognition with Core ML support ([4181](https://zenhub.innovate.ibm.com/app/workspace/o/watson/developer-experience/issues/4181), [201](https://github.com/watson-developer-cloud/dotnet-standard-sdk/pull/201)).
37-
* New: Added Classify Collection to the Natural Language Classifier ([4224](https://zenhub.innovate.ibm.com/app/workspace/o/watson/developer-experience/issues/4224), [199](https://github.com/watson-developer-cloud/dotnet-standard-sdk/pull/199)).
38-
* Fixed: Added Readme for Assistant, revised service readme files to add VersionDate when instantiating and revise service readme to use .csproj instead of project.json. ([194](https://github.com/watson-developer-cloud/dotnet-standard-sdk/issues/194), [195](https://github.com/watson-developer-cloud/dotnet-standard-sdk/pull/195)).
39-
40-
## Version 2.1.0
41-
_2018-03-16_
42-
* New: Generate Watson Assistant.
43-
* Fixed: Text to Speech Synthesize method sends accept via query parameter instead of header.
44-
45-
## Version 2.0.0
46-
_2018-03-09_
47-
* Breaking Change: Migrate to Visual Studio 2017.
48-
* Breaking Change: Regenerate all services using latest code generator & templates.
49-
* New: Revised integration tests.
50-
* New: Added documentation about publishing a release.
51-
* New: Generate Speech to Text service.
52-
* New: Generate Text to Speech service.
53-
* New: Generate Natural Language Classifier service.
54-
* New: Generate Visual Recognition service.
55-
56-
## Version 1.3.1
57-
_2018-01-09_
58-
* Fix: Change `Context` in `MessageRequest` to `dynamic`.
59-
60-
## Version 1.3.0
61-
_2018-01-07_
62-
* New: Generate Language Translator service.
63-
* Fix: Update Visual Recognition service to reflect API changes.
64-
* New: Use credential service for testing credentials.
65-
66-
## Version 1.2.0
67-
_2017-07-18_
68-
* Fix: Update input and context in MessageRequest and MessageResponse for `Conversation` to be dynamic.
69-
* Fix: Changes in error handling to check if return error is a string or json object.
70-
* New: Conversation example showing messaging with conversation context.
71-
72-
## Version 1.1.0
73-
_2017-06-30_
74-
* Fix: Include support for Xamarin Android, Xamarin iOS and .NET Core App (4.6>).
75-
76-
## Version 1.0.0
77-
_2017-06_19_
78-
* Breaking Change: Refactor SDK to integrate generated services including adding service version to the package namespace.
79-
* New: Generate services for `Personality Insights`, `Tone Analyzer`, `Conversation`, `Natural Language Understanding` and `Discovery` via Swagger Codegen.
80-
* Integration and unit test for all generated services.
81-
82-
## Version 0.2.0
83-
_2017-04-25_
84-
85-
* New: Abstracted `Visual Recognition` service.
86-
* New: Completed `Speech to Text` abstraction.
87-
* New: Completed `Conversation` abstraction.
88-
* New: Integration and Unit tests.
89-
* New: Example service calls.
90-
* Fix: Enabled fail build on failed test in AppVeyor.
91-
* Fix: Fixed all integration and unit tests.
92-
93-
## Version 0.1.0-alpha
94-
_2017-02-12_
95-
96-
Initial alpha release of .NET Standard SDK. Service supported include:
97-
* Conversation
98-
* Speech to Text
99-
* Text to Speech
100-
* Language Translator
101-
* Personality Insights
102-
* Tone Analyzer
1+
Moved to [https://github.com/watson-developer-cloud/dotnet-standard-sdk/wiki/Change-Log](https://github.com/watson-developer-cloud/dotnet-standard-sdk/wiki/Change-Log)

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.4.1
41+
PROJECT_NUMBER = 2.4.2
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: 73 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The .Net SDK uses the [Watson Developer Cloud][wdc] services, a collection of RE
1717
## Before you begin
1818
Ensure you have the following prerequisites:
1919

20-
* An IBM Cloud account. If you don't have one, [sign up][bluemix_registration].
20+
* You need an [IBM Cloud][ibm-cloud-onboarding] account.
2121
* Install [Visual Studio][visual-studio-download] for Windows or [Visual Studio Code][visual-studio-code-download] for OSX or Linux.
2222
* Install [.NET Core][dotnet-core-download].
2323

@@ -27,7 +27,7 @@ You can get the latest SDK packages through NuGet. Installation instructions can
2727
* [Assistant](/src/IBM.WatsonDeveloperCloud.Assistant.v1)
2828
* [Conversation](/src/IBM.WatsonDeveloperCloud.Conversation.v1)
2929
* [Discovery](/src/IBM.WatsonDeveloperCloud.Discovery.v1)
30-
* [Language Translator V2](/src/IBM.WatsonDeveloperCloud.LanguageTranslator.v2)
30+
* [Language Translator V2](/src/IBM.WatsonDeveloperCloud.LanguageTranslator.v2) (deprecated)
3131
* [Language Translator V3](/src/IBM.WatsonDeveloperCloud.LanguageTranslator.v3)
3232
* [Natural Language Understanding](/src/IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1)
3333
* [Natural Language Classifier](/src/IBM.WatsonDeveloperCloud.NaturalLanguageClassifier.v1)
@@ -39,6 +39,76 @@ You can get the latest SDK packages through NuGet. Installation instructions can
3939

4040
Or manually [here][latest_release].
4141

42+
## Authentication
43+
Watson services are migrating to token-based Identity and Access Management (IAM) authentication.
44+
45+
- With some service instances, you authenticate to the API by using **[IAM](#iam)**.
46+
- In other instances, you authenticate by providing the **[username and password](#username-and-password)** for the service instance.
47+
- Visual Recognition uses a form of [API key](#api-key) only with instances created before May 23, 2018. Newer instances of Visual Recognition use [IAM](#iam).
48+
49+
### Getting credentials
50+
To find out which authentication to use, view the service credentials. You find the service credentials for authentication the same way for all Watson services:
51+
52+
1. Go to the IBM Cloud **[Dashboard][watson-dashboard]** page.
53+
1. Either click an existing Watson service instance or click **Create**.
54+
1. Click **Show** to view your service credentials.
55+
1. Copy the `url` and either `apikey` or `username` and `password`.
56+
57+
In your code, you can use these values in the service constructor or with a method call after instantiating your service.
58+
59+
### IAM
60+
61+
Some services use token-based Identity and Access Management (IAM) authentication. IAM authentication uses a service API key to get an access token that is passed with the call. Access tokens are valid for approximately one hour and must be regenerated.
62+
63+
You supply either an IAM service **API key** or an **access token**:
64+
65+
- Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
66+
- Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://console.bluemix.net/docs/services/watson/getting-started-iam.html). If you want to switch to API key override your stored IAM credentials with an IAM API key.
67+
68+
#### Supplying the IAM API key
69+
```cs
70+
void Example()
71+
{
72+
TokenOptions iamAssistantTokenOptions = new TokenOptions()
73+
{
74+
IamApiKey = "<iam-apikey>",
75+
IamUrl = "<service-endpoint>"
76+
};
77+
78+
_assistant = new AssistantService(iamAssistantTokenOptions, "<version-date>");
79+
}
80+
```
81+
82+
#### Supplying the access token
83+
```cs
84+
void Example()
85+
{
86+
TokenOptions iamAssistantTokenOptions = new TokenOptions()
87+
{
88+
IamAccessToken = "<iam-access-token>"
89+
};
90+
91+
_assistant = new AssistantService(iamAssistantTokenOptions, "<version-date>");
92+
}
93+
```
94+
95+
### Username and password
96+
```cs
97+
void Example()
98+
{
99+
_assistant = new AssistantService("<username>", "<password>", "<version-date>");
100+
}
101+
```
102+
103+
### API key
104+
**Important**: This type of authentication works only with Visual Recognition instances created before May 23, 2018. Newer instances of Visual Recognition use [IAM](#iam).
105+
```cs
106+
void Example()
107+
{
108+
_visualRecognition = new VisualRecognitionService("<apikey>", "<version-date>");
109+
}
110+
```
111+
42112
## Custom Request Headers
43113
You can send custom request headers by adding them to the `customData` object.
44114
```cs
@@ -72,24 +142,6 @@ void Example()
72142
}
73143
```
74144

75-
## IAM Authentication
76-
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.
77-
```cs
78-
void Example()
79-
{
80-
// Provide either an iamApiKey or iamAccessToken to authenticate the service.
81-
TokenOptions iamAssistantTokenOptions = new TokenOptions()
82-
{
83-
IamApiKey = "<iam-apikey>",
84-
IamAccessToken = "<iam-access-token>",
85-
IamUrl = "<service-endpoint>"
86-
};
87-
88-
_assistant = new AssistantService(iamAssistantTokenOptions, "<version-date>");
89-
var results = assistant.Message("<workspace-id>", "<message-request>");
90-
}
91-
```
92-
93145
## Documentation
94146
Click [here][dotnet-standard-sdk-documentation] for documentation by release and branch.
95147

@@ -135,3 +187,4 @@ See [CONTRIBUTING.md](.github/CONTRIBUTING.md).<TODO revise coding standard>
135187
[visual-studio-download]: https://www.visualstudio.com/vs/community/
136188
[visual-studio-code-download]: https://code.visualstudio.com/
137189
[dotnet-standard-sdk-documentation]: https://watson-developer-cloud.github.io/dotnet-standard-sdk/
190+
[ibm-cloud-onboarding]: http://console.bluemix.net/registration?target=/developer/watson&cm_sp=WatsonPlatform-WatsonServices-_-OnPageNavLink-IBMWatson_SDKs-_-DotNet

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.4.1</VersionPrefix>
4+
<VersionPrefix>2.4.2</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.4.1</Version>
13+
<Version>2.4.2</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

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.4.1</VersionPrefix>
4+
<VersionPrefix>2.4.2</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.4.1</Version>
13+
<Version>2.4.2</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.4.1</VersionPrefix>
4+
<VersionPrefix>2.4.2</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.4.1</Version>
13+
<Version>2.4.2</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

examples/IBM.WatsonDeveloperCloud.LanguageTranslator.v3.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.4.1</VersionPrefix>
4+
<VersionPrefix>2.4.2</VersionPrefix>
55
<TargetFramework>netcoreapp1.0</TargetFramework>
66
<AssemblyName>IBM.WatsonDeveloperCloud.LanguageTranslator.v3.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.4.1</Version>
13+
<Version>2.4.2</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

examples/IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1.Ex/IBM.WatsonDeveloperCloud.NLU.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.4.1</VersionPrefix>
4+
<VersionPrefix>2.4.2</VersionPrefix>
55
<TargetFramework>netcoreapp1.0</TargetFramework>
66
<AssemblyName>IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1.Ex</AssemblyName>
77
<OutputType>Exe</OutputType>
@@ -10,7 +10,7 @@
1010
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1111
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1212
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
13-
<Version>2.4.1</Version>
13+
<Version>2.4.2</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

examples/IBM.WatsonDeveloperCloud.PersonalityInsights.v3.Example/IBM.WatsonDeveloperCloud.PersonalityInsights.v3.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.4.1</VersionPrefix>
4+
<VersionPrefix>2.4.2</VersionPrefix>
55
<TargetFramework>netcoreapp1.0</TargetFramework>
66
<AssemblyName>IBM.WatsonDeveloperCloud.PersonalityInsights.v3.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.4.1</Version>
13+
<Version>2.4.2</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

examples/IBM.WatsonDeveloperCloud.SpeechToText.v1.Example/IBM.WatsonDeveloperCloud.SpeechToText.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.4.1</VersionPrefix>
4+
<VersionPrefix>2.4.2</VersionPrefix>
55
<TargetFramework>netcoreapp1.0</TargetFramework>
66
<AssemblyName>IBM.WatsonDeveloperCloud.SpeechToText.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.4.1</Version>
13+
<Version>2.4.2</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

0 commit comments

Comments
 (0)