Skip to content

Commit 760a016

Browse files
authored
Merge pull request #238 from watson-developer-cloud/4532-regenerate-with-iam-support
Regenerate with iam support
2 parents 164c773 + 81aed69 commit 760a016

File tree

54 files changed

+2229
-634
lines changed

Some content is hidden

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

54 files changed

+2229
-634
lines changed

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.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.LanguageTranslator.v2.Example/LanguageTranslatorServiceExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class LanguageTranslatorServiceExample
3535
public LanguageTranslatorServiceExample(string url, string username, string password)
3636
{
3737
_languageTranslator = new LanguageTranslatorService(username, password);
38-
_languageTranslator.Endpoint = url;
38+
_languageTranslator.SetEndpoint(url);
3939

4040
ListModels();
4141
CreateModel();

examples/IBM.WatsonDeveloperCloud.NaturalLanguageUnderstanding.v1.Ex/NaturalLanguageUnderstandingExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class NaturalLanguageUnderstandingExample
2828
public NaturalLanguageUnderstandingExample(string url, string username, string password)
2929
{
3030
_naturalLanguageUnderstandingService = new NaturalLanguageUnderstandingService(username, password, "2017-02-27");
31-
_naturalLanguageUnderstandingService.Endpoint = url;
31+
_naturalLanguageUnderstandingService.SetEndpoint(url);
3232

3333
Analyze();
3434
ListModels();

examples/IBM.WatsonDeveloperCloud.PersonalityInsights.v3.Example/Example.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static void Main(string[] args)
7070
#endregion
7171

7272
PersonalityInsightsService _service = new PersonalityInsightsService(_username, _password, "2016-10-20");
73-
_service.Endpoint = _endpoint;
73+
_service.SetEndpoint(_endpoint);
7474
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.";
7575

7676
// Test Profile

examples/IBM.WatsonDeveloperCloud.SpeechToText.v1.Example/SpeechToTextServiceExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class SpeechToTextServiceExample
4848
public SpeechToTextServiceExample(string url, string username, string password)
4949
{
5050
service = new SpeechToTextService(username, password);
51-
service.Endpoint = url;
51+
service.SetEndpoint(url);
5252

5353
//var listModelsResult = ListModels();
5454

@@ -407,7 +407,7 @@ private object UpgradeLanguageModel(string customizationId)
407407
#endregion
408408

409409
#region AddCorpus
410-
private object AddCorpus(string customizationId, string corpusName, System.IO.Stream corpusFile, bool? allowOverwrite = null, string corpusFileContentType = null)
410+
private object AddCorpus(string customizationId, string corpusName, System.IO.FileStream corpusFile, bool? allowOverwrite = null, string corpusFileContentType = null)
411411
{
412412
Console.WriteLine("\nAttempting to AddCorpus()");
413413
var result = service.AddCorpus(customizationId: customizationId, corpusName: corpusName, corpusFile: corpusFile, allowOverwrite: allowOverwrite, corpusFileContentType: corpusFileContentType);

examples/IBM.WatsonDeveloperCloud.TextToSpeech.v1.Example/Example.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private static void Main(string[] args)
7777
};
7878

7979
var _service = new TextToSpeechService(_username, _password);
80-
_service.Endpoint = _endpoint;
80+
_service.SetEndpoint(_endpoint);
8181

8282
// MemoryStream Result with .wav data
8383
var synthesizeResult = _service.Synthesize(synthesizeText, "audio/wav");

examples/IBM.WatsonDeveloperCloud.ToneAnalyzer.v3.Example/Example.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static void Main(string[] args)
7272

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

7777
// Test PostTone
7878
ToneInput toneInput = new ToneInput()

0 commit comments

Comments
 (0)