Skip to content

Commit 1690156

Browse files
authored
Merge pull request #1089 from watson-developer-cloud/8.0.0-rc
v8.0.0 release
2 parents f5893d3 + 3899d23 commit 1690156

File tree

759 files changed

+19913
-12124
lines changed

Some content is hidden

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

759 files changed

+19913
-12124
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ compare-comply/src/test/resources/compare_comply/cloud-object-storage-credential
2626
compare-comply/src/test/resources/compare_comply/cloud-object-storage-credentials-output.json
2727
secrets.tar
2828
package-lock.json
29-
*.mlmodel
29+
model_result.mlmodel
3030
.openapi-generator-ignore
3131
.openapi-generator/
3232
package-lock.json

.utility/push-javadoc-to-gh-pages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" ]; then
1111
rm -rf docs/$TRAVIS_BRANCH
1212
mkdir -p docs/$TRAVIS_BRANCH
1313
cp -rf ../build/docs/all/* docs/$TRAVIS_BRANCH
14-
generate-index-html.sh > index.html
14+
../.utility/generate-index-html.sh > index.html
1515

1616
# update the latest/ symlink
1717
# on tagged builds, $TRAVIS_TAG is set to the tag, but it's blank on regular builds, unlike $TRAVIS_BRANCH

MIGRATION-V8.md

Lines changed: 313 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
### v8.0.0 Migration guide
2+
This document should serve as a guide to breaking changes for users moving from code using the v7.x.x version of the SDK to v8.x.x.
3+
4+
#### Authentication
5+
6+
##### v7.x.x
7+
8+
Previously, there were different builder objects for authentication. For example:
9+
10+
```java
11+
// username and password
12+
BasicAuthConfig config = new BasicAuthConfig.Builder()
13+
.username("<username>")
14+
.password("<password")
15+
.build();
16+
17+
// IAM
18+
IamOptions options = new IamOptions.Builder()
19+
.apiKey("<iam_api_key>")
20+
.url("<iam_url>")
21+
.build();
22+
```
23+
24+
This could be set multiple ways:
25+
26+
```java
27+
// in the constructor
28+
IamOptions options = new IamOptions.Builder()
29+
.apiKey("<iam_api_key>")
30+
.url("<iam_url>")
31+
.build();
32+
Assistant service = new Assistant("2019-02-28", options);
33+
34+
// after instantiation
35+
service.setAuthenticator(options);
36+
37+
// inline in the constructor (only for username and password!)
38+
Assistant service = new Assistant("2019-02-28", "<username>", "<password>");
39+
```
40+
41+
Overall, it was a little too open-ended and very confusing to follow. For this release, we've decided to standardize things, while developing a pattern that should be more scalable.
42+
43+
##### v8.x.x
44+
45+
There are 5 authentication variants supplied in the SDK (shown below), and it's possible now to create your own authentication implementation if you need something specific by implementing the `Authenticator` implementation.
46+
47+
##### Basic
48+
You can authenticate with basic auth using the `BasicAuthenticator`. This allows you to pass in a username and password.
49+
50+
```java
51+
Authenticator authenticator = new BasicAuthenticator("<username>", "<password>");
52+
```
53+
54+
##### Bearer token
55+
Use the `BearerTokenAuthenticator`. This one accepts just the bearer token.
56+
57+
```java
58+
Authenticator authenticator = new BearerTokenAuthenticator("<bearer_token>");
59+
```
60+
61+
##### Cloud Pak for Data
62+
This class helps you authenticate with your services on (Cloud Pak for Data)[https://www.ibm.com/analytics/cloud-pak-for-data).
63+
64+
```java
65+
// constructor with required parameters
66+
Authenticator authenticator = new CloudPakForDataAuthenticator(
67+
"<url>",
68+
"<test_username>",
69+
"<test_password>"
70+
);
71+
```
72+
73+
There's also another constructor to disable SSL verification or send request headers on the token exchange.
74+
75+
##### IAM
76+
Like the `CloudPakForDataAuthenticator`, there's a basic constructor
77+
78+
```java
79+
Authenticator authenticator = new IamAuthenticator("<token>");
80+
```
81+
82+
and another one to supply additional arguments like a particular token exchange URL, a client ID and secret, and the same options to disable SSL verification and send headers.
83+
84+
##### None
85+
Finally, there's the `NoAuthAuthenticator`, which is pretty self-explanatory. Pass this when you don't need any authentication to happen.
86+
87+
```java
88+
Assistant service = new Assistant("2019-02-28", new NoAuthAuthenticator());
89+
```
90+
91+
#### Supplying credentials
92+
93+
As before, you can supply credentials to your service using external `ibm-credentials.env` files.
94+
95+
```java
96+
Assistant service = new Assistant("2019-02-28");
97+
WorkspaceCollection response = service.listWorkspaces().execute().getResult();
98+
```
99+
100+
##### v7.x.x
101+
102+
Previously we would look for these files first in the system `home` directory, followed by the current project directory.
103+
104+
##### v8.x.x
105+
106+
Now in order to allow developers to have different configurations for each project we look first in the current project directory, followed by the home directory.
107+
108+
#### Setting the service url
109+
110+
##### v7.x.x
111+
112+
For a while now, we've allowed users to set the service URL with `setEndPoint()`:
113+
114+
```java
115+
IamOptions options = new IamOptions.Builder()
116+
.apiKey("<iam_api_key>")
117+
.url("<iam_url>")
118+
.build();
119+
Assistant service = new Assistant("2019-02-28", options);
120+
service.setEndPoint("<service_url>");
121+
```
122+
123+
##### v8.x.x
124+
125+
To align with our other SDKs and be a bit more clear, that method has been renamed to `setServiceUrl()`:
126+
127+
```java
128+
Authenticator authenticator = new IamAuthenticator("<token>");
129+
Assistant service = new Assistant("2019-02-28", authenticator);
130+
service.setServiceUrl("<service_url>");
131+
```
132+
133+
#### More model builders
134+
If you've used the SDK before, you're probably familiar with the use of the builder pattern across the board. With this release, we've tweaked the generation process to capture better which are models that are being constructed to be sent to the service. These are models we'd prefer to have builders, making it easier to put them together.
135+
136+
There are unfortunately a decent number of models which move to this pattern, but it's one we expect to use well into the future. Here's the comprehensive list of models that now use this:
137+
138+
##### Assistant v1
139+
- `CaptureGroup`
140+
- `DialogNodeAction`
141+
- `DialogNodeNextStep`
142+
- `DialogNodeOutputGeneric`
143+
- `DialogNodeOutputModifiers`
144+
- `DialogNodeOutputOptionsElement`
145+
- `DialogNodeOutputOptionsElementValue`
146+
- `DialogNodeOutputTextValuesElement`
147+
- `DialogNodeVisitedDetails`
148+
- `DialogSuggestion`
149+
- `DialogSuggestionValue`
150+
- `LogMessage`
151+
- `Mention`
152+
- `MessageContextMetadata`
153+
- `MessageRequest`
154+
- `RuntimeEntity`
155+
- `RuntimeIntent`
156+
- `WorkspaceSystemSettings`
157+
- `WorkspaceSystemSettingsDisambiguation`
158+
- `WorkspaceSystemSettingsTooling`
159+
##### Assistant v2
160+
- `CaptureGroup`
161+
- `MessageContext`
162+
- `MessageContextGlobal`
163+
- `MessageContextGlobalSystem`
164+
- `MessageContextSkill`
165+
- `MessageInputOptions`
166+
- `RuntimeEntity`
167+
- `RuntimeIntent`
168+
##### Compare and Comply
169+
- `Category`
170+
- `FeedbackDataInput`
171+
- `Label`
172+
- `Location`
173+
- `OriginalLabelsIn`
174+
- `ShortDoc`
175+
- `TypeLabel`
176+
- `UpdatedLabelsIn`
177+
##### Discovery
178+
- `Configuration`
179+
- `Conversions`
180+
- `CredentialDetails`
181+
- `Credentials`
182+
- `Enrichment`
183+
- `EventData`
184+
- `Expansion`
185+
- `Expansions`
186+
- `FontSetting`
187+
- `HtmlSettings`
188+
- `NluEnrichmentConcepts`
189+
- `NluEnrichmentRelations`
190+
- `NormalizationOperation`
191+
- `PdfHeadingDetection`
192+
- `PdfSettings`
193+
- `SegmentSettings`
194+
- `Source`
195+
- `SourceOptions`
196+
- `SourceOptionsBuckets`
197+
- `SourceOptionsFolder`
198+
- `SourceOptionsObject`
199+
- `SourceOptionsSiteColl`
200+
- `SourceOptionsWebCrawl`
201+
- `SourceSchedule`
202+
- `TokenDictRule`
203+
- `TrainingExample`
204+
- `WordHeadingDetection`
205+
- `WordSettings`
206+
- `WordStyle`
207+
- `XPathPatterns`
208+
##### Natural Language Classifier
209+
- `ClassifyInput`
210+
##### Natural Language Understanding
211+
- `MetadataOptions`
212+
- `SyntaxOptionsTokens`
213+
##### Speech to Text
214+
- `CustomWord`
215+
##### Text to Speech
216+
- `Translation`
217+
- `Word`
218+
- `Words`
219+
220+
#### Removed `ContentType` constant from models
221+
222+
Previously, options models which accepted a `contentType` parameter would typically contain a set of constants for possible values. For example:
223+
224+
```java
225+
RecognizeOptions.ContentType.AUDIO_WAV
226+
```
227+
228+
These have been removed. You can use the `HttpMediaType` helper class to achieve the same thing:
229+
```java
230+
// equivalent to above
231+
HttpMediaType.AUDIO_WAV
232+
```
233+
234+
#### Service changes
235+
236+
##### Assistant v1
237+
238+
* `includeCount` is no longer a parameter of the `listWorkspaces()` method
239+
* `includeCount` is no longer a parameter of the `listIntents()` method
240+
* `includeCount` is no longer a parameter of the `listExamples()` method
241+
* `includeCount` is no longer a parameter of the `listCounterexamples()` method
242+
* `includeCount` is no longer a parameter of the `listEntities()` method
243+
* `includeCount` is no longer a parameter of the `listValues()` method
244+
* `includeCount` is no longer a parameter of the `listSynonyms()` method
245+
* `includeCount` is no longer a parameter of the `listDialogNodes()` method
246+
* `valueType` was renamed to `type` in the `createValue()` method
247+
* `newValueType` was renamed to `newType` in the `updateValue()` method
248+
* `nodeType` was renamed to `type` in the `createDialogNode()` method
249+
* `nodeType` was renamed to `type` in the `createDialogNode()` method
250+
* `newNodeType` was renamed to `newType` in the `updateDialogNode()` method
251+
* `ValueType` was renamed to `Type` in the `CreateValue` model
252+
* `NodeType` was renamed to `Type` in the `DialogNode` model
253+
* `ActionType` was renamed to `Type` in the `DialogNodeAction` model
254+
* `SEARCH_SKILL` constant was added to the `DialogNodeOutputGeneric` model
255+
* `QueryType` constants were added to the `DialogNodeOutputGeneric` model
256+
* `queryType` property was added to the `DialogNodeOutputGeneric` model
257+
* `query` property was added to the `DialogNodeOutputGeneric` model
258+
* `filter` property was added to the `DialogNodeOutputGeneric` model
259+
* `discoveryVersion` property was added to the `DialogNodeOutputGeneric` model
260+
* `output` property type was converted from `Map` to `DialogSuggestionOutput` in the `DialogSuggestion` model
261+
* `LogMessage` model no longer has `additionalProperties`
262+
* `DialogRuntimeResponseGeneric` was renamed to `RuntimeResponseGeneric`
263+
* `RuntimeEntity` model no longer has `additionalProperties`
264+
* `RuntimeIntent` model no longer has `additionalProperties`
265+
* `ValueType` was renamed to `Type` in the `Value` model
266+
267+
##### Assistant v2
268+
269+
* `ActionType` was renamed to `Type` in the `DialogNodeAction` model
270+
* `DialogRuntimeResponseGeneric` was renamed to `RuntimeResponseGeneric`
271+
272+
##### Compare Comply v1
273+
274+
* `convertToHtml()` method does not require a `filename` parameter
275+
276+
##### Discovery v1
277+
278+
* `returnFields` was renamed to `xReturn` in the `query()` method
279+
* `loggingOptOut` was renamed to `xWatsonLoggingOptOut` in the `query()` method
280+
* `spellingSuggestions` was added to the `query()` method
281+
* `collectionIds` is no longer a parameter of the `query()` method
282+
* `returnFields` was renamed to `xReturn` in the `QueryNotices()` method
283+
* `loggingOptOut` was renamed to `xWatsonLoggingOptOut` in the `federatedQuery()` method
284+
* `collectionIds` is now required in the `federatedQuery()` method
285+
* `returnFields` was renamed to `xReturn` in the `federatedQuery()` method
286+
* `returnFields` was renamed to `xReturn` in the `federatedQueryNotices()` method
287+
* `enrichmentName` was renamed to `enrichment` in the `Enrichment` model
288+
* `FieldTypeEnumValue` was renamed to `TypeEnumValue` in the `Field` model
289+
* `FieldType` was renamed to `Type` in the `Field` model
290+
* `fieldName` was renamed to `field` in the `Field` model
291+
* `testConfigurationInEnvironment()` method was removed
292+
* `queryEntities()` method was removed
293+
* `queryRelations()` method was removed
294+
295+
##### Language Translator v3
296+
297+
* `defaultModels` was renamed to `xDefault` in the `listModels()` method
298+
* `translationOutput` was renamed to `translation` in the `Translation` model
299+
300+
##### Natural Language Classifier v1
301+
302+
* `metadata` was renamed to `trainingMetadata` in the `createClassifier()` method
303+
304+
##### Speech to Text v1
305+
306+
* `finalResults` was renamed to `xFinal` in the `SpeakerLabelsResult` model
307+
* `finalResults` was renamed to `xFinal` in the `SpeechRecognitionResult` model
308+
309+
##### Visual Recognition v3
310+
311+
* `detectFaces()` method was removed
312+
* `className` was renamed to `xClass` in the `Class` model
313+
* `className` was renamed to `xClass` in the `ClassResult` model

0 commit comments

Comments
 (0)