Skip to content

Commit

Permalink
Merge pull request #239 from watson-developer-cloud/rc-2.3.0
Browse files Browse the repository at this point in the history
.NET Standard SDK v2.3.0
  • Loading branch information
mediumTaj authored May 30, 2018
2 parents 4be6013 + 490d654 commit 781401e
Show file tree
Hide file tree
Showing 117 changed files with 3,216 additions and 860 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,7 @@ _Pvt_Extensions
.fake/
/src/IBM.WatsonDeveloperCloud.LanguageTranslator.Test/appsettings.json
/test/IBM.WatsonDeveloperCloud.LanguageTranslator.v2.IntegrationTests/appsettings.json

**/.swagger-codegen-ignore
**/.swagger-codegen
src/tests/
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Change Log
==========
## Version 2.3.0
_2018-05-29_
* Regenerated SDK based on the latest API definition. All services except for Natural Language Classifier support IAM authentication.
* Service endpoint is set to the `gateway-a` endpoint if the user authenticates using apikey rather than TokenOptions.
* Where a file is required we now use `FileStream` rather than `Stream` to preserve the filename.
* 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.
* Fixed: Disambiguate `IamUrl` and `ServiceUrl`. The `IamUrl` is now user configurable.

## Version 2.2.2
_2018-05-18_
* Regenerated SDK based on latest API definition.
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Watson Developer Cloud .NET Standard SDK"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 2.2.2
PROJECT_NUMBER = 2.3.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,16 @@ void Example()
```

## IAM Authentication
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.
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.
```cs
void Example()
{
// Provide either an iamApiKey or iamAccessToken to authenticate the service.
TokenOptions iamAssistantTokenOptions = new TokenOptions()
{
IamApiKey = "<iam-apikey>",
IamAccessToken = "<iam-access-token>"
IamAccessToken = "<iam-access-token>",
IamUrl = "<service-endpoint>"
};

_assistant = new AssistantService(iamAssistantTokenOptions, "<version-date>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ConversationContextExample
public ConversationContextExample(string url, string username, string password, string workspaceId)
{
_conversation = new ConversationService(username, password, "2018-02-16");
_conversation.Endpoint = url;
_conversation.SetEndpoint(url);

_workspaceID = workspaceId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class ConversationServiceExample
public ConversationServiceExample(string url, string username, string password, string workspaceID)
{
_conversation = new ConversationService(username, password, "2018-02-16");
_conversation.Endpoint = url;
_conversation.SetEndpoint(url);

_workspaceID = workspaceID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.2.2</VersionPrefix>
<VersionPrefix>2.3.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.Conversation.v1.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.2.2</Version>
<Version>2.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class DiscoveryServiceExample
public DiscoveryServiceExample(string url, string username, string password)
{
_discovery = new DiscoveryService(username, password, "2017-11-07");
_discovery.Endpoint = url;
_discovery.SetEndpoint(url);

GetEnvironments();
//CreateEnvironment();
Expand Down Expand Up @@ -116,13 +116,13 @@ public void GetEnvironments()
{
Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));

foreach (Model.Environment environment in result.Environments)
{
if (!(bool)environment._ReadOnly)
{
_existingEnvironmentId = environment.EnvironmentId;
Console.WriteLine(string.Format("\nEnvironment found, Setting environment to {0}", environment.Name));
}
foreach (Model.Environment environment in result.Environments)
{
if (!(bool)environment._ReadOnly)
{
_existingEnvironmentId = environment.EnvironmentId;
Console.WriteLine(string.Format("\nEnvironment found, Setting environment to {0}", environment.Name));
}
}
}
else
Expand Down Expand Up @@ -244,7 +244,7 @@ private void PreviewEnvironment()

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

if (result != null)
{
Expand Down Expand Up @@ -478,7 +478,7 @@ private void AddDocument()
Console.WriteLine(string.Format("\nCalling AddDocument()..."));
using (FileStream fs = File.OpenRead(_filepathToIngest))
{
var result = _discovery.AddDocument(_existingEnvironmentId, _createdCollectionId, fs as Stream, _metadata);
var result = _discovery.AddDocument(_existingEnvironmentId, _createdCollectionId, fs, _metadata);

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

if (result != null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.2.2</VersionPrefix>
<VersionPrefix>2.3.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.Discovery.v1.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.2.2</Version>
<Version>2.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.2.2</VersionPrefix>
<VersionPrefix>2.3.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.LanguageTranslator.v2.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.2.2</Version>
<Version>2.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class LanguageTranslatorServiceExample
public LanguageTranslatorServiceExample(string url, string username, string password)
{
_languageTranslator = new LanguageTranslatorService(username, password);
_languageTranslator.Endpoint = url;
_languageTranslator.SetEndpoint(url);

ListModels();
CreateModel();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.2.2</VersionPrefix>
<VersionPrefix>2.3.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1.Ex</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.2.2</Version>
<Version>2.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class NaturalLanguageUnderstandingExample
public NaturalLanguageUnderstandingExample(string url, string username, string password)
{
_naturalLanguageUnderstandingService = new NaturalLanguageUnderstandingService(username, password, "2017-02-27");
_naturalLanguageUnderstandingService.Endpoint = url;
_naturalLanguageUnderstandingService.SetEndpoint(url);

Analyze();
ListModels();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void Main(string[] args)
#endregion

PersonalityInsightsService _service = new PersonalityInsightsService(_username, _password, "2016-10-20");
_service.Endpoint = _endpoint;
_service.SetEndpoint(_endpoint);
string contentToProfile = "The IBM Watson™ Personality Insights service provides a Representational State Transfer (REST) Application Programming Interface (API) that enables applications to derive insights from social media, enterprise data, or other digital communications. The service uses linguistic analytics to infer individuals' intrinsic personality characteristics, including Big Five, Needs, and Values, from digital communications such as email, text messages, tweets, and forum posts. The service can automatically infer, from potentially noisy social media, portraits of individuals that reflect their personality characteristics. The service can report consumption preferences based on the results of its analysis, and for JSON content that is timestamped, it can report temporal behavior.";

// Test Profile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.2.2</VersionPrefix>
<VersionPrefix>2.3.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.PersonalityInsights.v3.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.2.2</Version>
<Version>2.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.2.2</VersionPrefix>
<VersionPrefix>2.3.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.SpeechToText.v1.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.2.2</Version>
<Version>2.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class SpeechToTextServiceExample
public SpeechToTextServiceExample(string url, string username, string password)
{
service = new SpeechToTextService(username, password);
service.Endpoint = url;
service.SetEndpoint(url);

//var listModelsResult = ListModels();

Expand Down Expand Up @@ -407,7 +407,7 @@ private object UpgradeLanguageModel(string customizationId)
#endregion

#region AddCorpus
private object AddCorpus(string customizationId, string corpusName, System.IO.Stream corpusFile, bool? allowOverwrite = null, string corpusFileContentType = null)
private object AddCorpus(string customizationId, string corpusName, System.IO.FileStream corpusFile, bool? allowOverwrite = null, string corpusFileContentType = null)
{
Console.WriteLine("\nAttempting to AddCorpus()");
var result = service.AddCorpus(customizationId: customizationId, corpusName: corpusName, corpusFile: corpusFile, allowOverwrite: allowOverwrite, corpusFileContentType: corpusFileContentType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static void Main(string[] args)
};

var _service = new TextToSpeechService(_username, _password);
_service.Endpoint = _endpoint;
_service.SetEndpoint(_endpoint);

// MemoryStream Result with .wav data
var synthesizeResult = _service.Synthesize(synthesizeText, "audio/wav");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static void Main(string[] args)

var versionDate = "2016-05-19";
ToneAnalyzerService _toneAnalyzer = new ToneAnalyzerService(_username, _password, versionDate);
_toneAnalyzer.Endpoint = _endpoint;
_toneAnalyzer.SetEndpoint(_endpoint);

// Test PostTone
ToneInput toneInput = new ToneInput()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.2.2</VersionPrefix>
<VersionPrefix>2.3.0</VersionPrefix>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>IBM.WatsonDeveloperCloud.ToneAnalyzer.v3.Example</AssemblyName>
<OutputType>Exe</OutputType>
Expand All @@ -10,7 +10,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>2.2.2</Version>
<Version>2.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 781401e

Please sign in to comment.