Skip to content

Commit 9a8ab4b

Browse files
authored
Merge pull request #395 from watson-developer-cloud/major-pre-release
Major pre release
2 parents 5036719 + f6dbc8b commit 9a8ab4b

File tree

121 files changed

+1808
-1881
lines changed

Some content is hidden

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

121 files changed

+1808
-1881
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 = 3.4.1
3+
current_version = 4.0.0-rc1
44
message = docs: Update version numbers from {current_version} -> {new_version}
55

66
[bumpversion:file:Doxyfile]

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 = 3.4.1
41+
PROJECT_NUMBER = 4.0.0-rc1
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: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ You supply either an IAM service **API key** or an **access token**:
7070
```cs
7171
void Example()
7272
{
73-
IamConfig iamConfig = new IamConfig(
74-
apikey: "{iam-apikey}"
75-
);
76-
service = new AssistantService("{versionDate}", iamConfig);
73+
IamAuthenticator authenticator = new IamAuthenticator(
74+
apikey: "{apikey}");
75+
var service = new AssistantService("{versionDate}", authenticator);
7776
service.SetEndpoint("{service-endpoint}");
7877
}
7978
```
@@ -82,10 +81,9 @@ void Example()
8281
```cs
8382
void Example()
8483
{
85-
IamConfig iamConfig = new IamConfig(
86-
userManagedAccessToken: "{iam-access-token}"
87-
);
88-
service = new AssistantService("{versionDate}", iamConfig);
84+
BearerTokenAuthenticator authenticator = new BearerTokenAuthenticator(
85+
bearerToken: "{bearerToken}");
86+
var service = new AssistantService("{versionDate}", authenticator);
8987
service.SetEndpoint("{service-endpoint}");
9088
}
9189
```
@@ -94,11 +92,10 @@ void Example()
9492
```cs
9593
void Example()
9694
{
97-
BasicAuthConfig basicAuthConfig = new BasicAuthConfig(
95+
BasicAuthenticator authenticator = new BasicAuthenticator(
9896
username: "{username}",
99-
password: "{password}"
100-
);
101-
service = new AssistantService("{versionDate}", basicAuthConfig);
97+
password: "{password}");
98+
var service = new AssistantService("{versionDate}", authenticator);
10299
service.SetEndpoint("{service-endpoint}");
103100
}
104101
```
@@ -110,28 +107,25 @@ Like IAM, you can pass in credentials to let the SDK manage an access token for
110107
```cs
111108
void Example()
112109
{
113-
Icp4dConfig icp4dConfig = new Icp4dConfig(
110+
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator(
111+
url: "https://{cp4d_cluster_host}{:port}",
114112
username: "{username}",
115-
password: "{password}",
116-
url: "https://{icp4d_cluster_host}{:port}"
117-
);
118-
AssistantService assistant = new AssistantService("{version-date}", icp4dConfig);
113+
password: "{password}");
114+
var service = new AssistantService("{version-date}", authenticator);
119115
service.SetEndpoint("{service-endpoint}");
120-
var results = assistant.Message("{workspace-id}", "{message-request}");
116+
var results = service.Message("{workspace-id}", "{message-request}");
121117
}
122118
```
123119

124120
##### Managing the token yourself
125121
```cs
126122
void Example()
127123
{
128-
Icp4dConfig icp4dConfig = new Icp4dConfig(
129-
userManagedAccessToken: "{access-token}",
130-
url: "https://{icp4d_cluster_host}{:port}"
131-
);
132-
AssistantService assistant = new AssistantService("{version-date}", icp4dConfig);
124+
BearerTokenAuthenticator authenticator = new BearerTokenAuthenticator(
125+
bearerToken: "{bearerToken}");
126+
var service = new AssistantService("{version-date}", authenticator);
133127
service.SetEndpoint("{service-endpoint}");
134-
var results = assistant.Message("{workspace-id}", "{message-request}");
128+
var results = service.Message("{workspace-id}", "{message-request}");
135129
}
136130
```
137131
Be sure to both [disable SSL verification](#self-signed-certificates) when authenticating and set the endpoint explicitly to the URL given in ICP.
@@ -152,8 +146,8 @@ The file downloaded will be called `ibm-credentials.env`. This is the name the S
152146
As long as you set that up correctly, you don't have to worry about setting any authentication options in your code. So, for example, if you created and downloaded the credential file for your Discovery instance, you just need to do the following:
153147

154148
```cs
155-
AssistantService assistantService = new AssistantService();
156-
var listWorkspacesResult = assistantService.ListWorkspaces();
149+
AssistantService service = new AssistantService();
150+
var listWorkspacesResult = service.ListWorkspaces();
157151
```
158152

159153
And that's it!
@@ -177,13 +171,12 @@ You can send custom request headers by adding them to the service using `.WithHe
177171
```cs
178172
void Example()
179173
{
180-
IamConfig iamConfig = new IamConfig(
181-
apikey: "{iam-apikey}"
182-
);
183-
AssistantService assistant = new AssistantService("{version-date}", iamConfig);
174+
IamAuthenticator authenticator = new IamAuthenticator(
175+
apikey: "{apikey}");
176+
var service = new AssistantService("{version-date}", authenticator);
184177
service.SetEndpoint("{service-endpoint}");
185-
assistant.WithHeader("X-Watson-Metadata", "customer_id=some-assistant-customer-id");
186-
var results = assistant.Message("{workspace-id}", "{message-request}");
178+
service.WithHeader("X-Watson-Metadata", "customer_id=some-assistant-customer-id");
179+
var results = service.Message("{workspace-id}", "{message-request}");
187180
}
188181
```
189182

@@ -192,12 +185,11 @@ You can get the response headers, status code and the raw json response in the r
192185
```cs
193186
void Example()
194187
{
195-
IamConfig iamConfig = new IamConfig(
196-
apikey: "{iam-apikey}"
197-
);
198-
AssistantService assistant = new AssistantService("{version-date}", iamConfig);
188+
IamAuthenticator authenticator = new IamAuthenticator(
189+
apikey: "{apikey}");
190+
var service = new AssistantService("{version-date}", authenticator);
199191
service.SetEndpoint("{service-endpoint}");
200-
var results = assistant.Message("{workspace-id}", "{message-request}");
192+
var results = service.Message("{workspace-id}", "{message-request}");
201193

202194
var responseHeaders = results.Headers; // The response headers
203195
var responseJson = results.Response; // The raw response json
@@ -210,15 +202,14 @@ You can disable SSL verification on calls to Watson (only do this if you really
210202
```cs
211203
void Example()
212204
{
213-
Icp4dConfig icp4dConfig = new Icp4dConfig(
205+
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator(
206+
url: "https://{cp4d_cluster_host}{:port}",
214207
username: "{username}",
215208
password: "{password}",
216-
url: "https://{icp4d_cluster_host}{:port}",
217-
disableSslVerification: true
218-
);
219-
AssistantService assistant = new AssistantService("{version-date}", icp4dConfig);
209+
disableSslVerification: true);
210+
var service = new AssistantService("{version-date}", authenticator);
220211
service.SetEndpoint("{service-endpoint}");
221-
var results = assistant.Message("{workspace-id}", "{message-request}");
212+
var results = service.Message("{workspace-id}", "{message-request}");
222213
}
223214
```
224215

examples/IBM.Watson.Assistant.v2.Examples/IBM.Watson.Assistant.v2.Examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc4" />
9+
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc5" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

examples/IBM.Watson.CompareComply.v1.Examples/IBM.Watson.CompareComply.v1.Examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc4" />
9+
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc5" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

examples/IBM.Watson.CompareComply.v1.Examples/ServiceExample.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public void ConvertToHtml()
8080
fs.CopyTo(ms);
8181
var result = service.ConvertToHtml(
8282
file: ms,
83-
filename: Path.GetFileName("{path-to-file}"),
8483
fileContentType: "{file-content-type}"
8584
);
8685

examples/IBM.Watson.Discovery.v1.Examples/IBM.Watson.Discovery.v1.Examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc4" />
9+
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc5" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

examples/IBM.Watson.Discovery.v1.Examples/ServiceExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ public void Query()
754754
filter: "{filter}",
755755
query: "{query}",
756756
aggregation: "{aggregation}",
757-
returnFields: "{return_fields}"
757+
_return: "{return_fields}"
758758
);
759759

760760
Console.WriteLine(result.Response);
@@ -790,7 +790,7 @@ public void FederatedQuery()
790790
var result = service.FederatedQuery(
791791
environmentId: "{environmentId}",
792792
naturalLanguageQuery: "{naturalLanguageQuery}",
793-
returnFields: "{returnFields}"
793+
_return: "{returnFields}"
794794
);
795795

796796
Console.WriteLine(result.Response);

examples/IBM.Watson.LanguageTranslator.v3.Examples/IBM.Watson.LanguageTranslator.v3.Examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc4" />
9+
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc5" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

examples/IBM.Watson.NaturalLangaugeClassifier.v1.Examples/IBM.Watson.NaturalLangaugeClassifier.v1.Examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc4" />
9+
<PackageReference Include="IBM.Cloud.SDK.Core" Version="1.0.0-rc5" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

0 commit comments

Comments
 (0)