Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f05579c
chore: update gateway urls
mediumTaj Nov 9, 2020
194d2ab
test(discovery-v1-it): update test url
kevinkowa Nov 17, 2020
67f754b
Merge pull request #1139 from watson-developer-cloud/update-gateway-url
mediumTaj Nov 18, 2020
bd39340
[docs] Revise PI deprecation, add VisRec deprecation
mediumTaj Dec 1, 2020
e13acba
Merge pull request #1142 from watson-developer-cloud/visrec-deprecation
mediumTaj Dec 1, 2020
3414833
feat(generation): api def tag 'sdk-major-release-2020' gen tag 3.19.0
kevinkowa Dec 1, 2020
c8f9131
chore(assistant-v1): manual changes
kevinkowa Nov 5, 2020
dc53a78
chore(assistant-v2): manual changes
kevinkowa Nov 5, 2020
629cfc8
chore(speech-to-text-v1): manual changes
kevinkowa Nov 5, 2020
73286e5
chore(text-to-speech-v1): manual changes
kevinkowa Nov 5, 2020
7b1d74a
chore(visual-recognition-v3): manual changes
kevinkowa Nov 5, 2020
b0184ac
chore(visual-recognition-v4): manual changes
kevinkowa Nov 6, 2020
d4e8aa8
chore(personality-insights-v3): add deprecation message
kevinkowa Dec 1, 2020
02e3dfd
fix(visual-recognition-v4): remove trainingStatus as a parameter for …
kevinkowa Nov 17, 2020
a00e2f7
test(visual-recognition-v4-tests): update tests using trainingStatus
kevinkowa Nov 17, 2020
d35c0b5
chore(java-format): ran java_format_google.sh
kevinkowa Dec 1, 2020
2d553a7
chore(copyrights): ran lint-copyrights
kevinkowa Dec 1, 2020
337ceb6
chore(visual-recognition): add deprecation message
kevinkowa Dec 1, 2020
cc70d12
chore(java-format): ran java_format_google.sh
kevinkowa Dec 1, 2020
687c661
chore(build.gradle): update java version to 8
kevinkowa Dec 1, 2020
b52246e
test(discovery-v1): clean collections
kevinkowa Dec 1, 2020
02d78b2
chore(build.gradle): update core from 9.5.0 to 9.5.4
kevinkowa Dec 1, 2020
f6a2e27
chore(merge): pull changes from master
kevinkowa Dec 1, 2020
3e0e774
chore(java-format): ran java_format_google.sh
kevinkowa Dec 1, 2020
cde7e20
test(speech-to-text-v1): fix mock response body
kevinkowa Dec 2, 2020
b4cf28f
test(discovery-v1): fix cleanup method to be called after the tests a…
kevinkowa Dec 2, 2020
1f5e1ec
chore(java-format): ran java_format_google.sh
kevinkowa Dec 2, 2020
3c58ef9
test(discovery-v1): ignore old unit tests
kevinkowa Dec 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ Java client library to use the [Watson APIs][wdc].
</details>

## ANNOUNCEMENTS!
### Personality Insights Deprecation
IBM® will begin sunsetting IBM Watson™ Personality Insights on 1 December 2020. For a period of one year from this date, you will still be able to use Watson Personality Insights. However, as of 1 December 2021, the offering will no longer be available.
### Personality Insights deprecation
IBM Watson™ Personality Insights is discontinued. For a period of one year from 1 December 2020, you will still be able to use Watson Personality Insights. However, as of 1 December 2021, the offering will no longer be available.

As an alternative, we encourage you to consider migrating to IBM Watson™ [Natural Language Understanding](https://cloud.ibm.com/docs/natural-language-understanding), a service on IBM Cloud® that uses deep learning to extract data and insights from text such as keywords, categories, sentiment, emotion, and syntax to provide insights for your business or industry. For more information, see About Natural Language Understanding.

### Visual Recognition deprecation
IBM Watson™ Visual Recognition is discontinued. Existing instances are supported until 1 December 2021, but as of 7 January 2021, you can't create instances. Any instance that is provisioned on 1 December 2021 will be deleted.

## Before you begin
* You need an [IBM Cloud][ibm-cloud-onboarding] account.

Expand Down
2 changes: 1 addition & 1 deletion assistant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ checkstyle {
dependencies {
compile project(':common')
testCompile project(':common').sourceSets.test.output
compile 'com.ibm.cloud:sdk-core:9.5.0'
compile 'com.ibm.cloud:sdk-core:9.5.4'
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-7cc05500-20201106-154555
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-be3b4618-20201201-123423
*/

package com.ibm.watson.assistant.v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-7cc05500-20201106-154555
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-be3b4618-20201201-123423
*/

package com.ibm.watson.assistant.v2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
package com.ibm.watson.assistant.v1.utils;

import com.ibm.cloud.sdk.core.service.model.FileWithMetadata;
import com.ibm.cloud.sdk.core.util.DateUtils;
import com.ibm.cloud.sdk.core.util.GsonSingleton;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
Expand Down Expand Up @@ -119,10 +119,10 @@ public static byte[] createMockByteArray(String bytes) {
}

public static Date createMockDate(String date) throws Exception {
return new SimpleDateFormat("yyyy-MM-dd").parse(date);
return DateUtils.parseAsDate(date);
}

public static Date createMockDateTime(String date) throws Exception {
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(date);
return DateUtils.parseAsDateTime(date);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public void testMessageWOptions() throws Throwable {
.build();

// Construct an instance of the MessageContextSkill model
final MessageContextSkill messageContextSkillModel =
MessageContextSkill messageContextSkillModel =
new MessageContextSkill.Builder()
.userDefined(
new java.util.HashMap<String, Object>() {
Expand Down Expand Up @@ -549,7 +549,7 @@ public void testMessageStatelessWOptions() throws Throwable {
.build();

// Construct an instance of the MessageContextSkill model
final MessageContextSkill messageContextSkillModel =
MessageContextSkill messageContextSkillModel =
new MessageContextSkill.Builder()
.userDefined(
new java.util.HashMap<String, Object>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testMessageContextStateless() throws Throwable {
assertEquals(messageContextSkillSystemModel.getState(), "testString");
assertEquals(messageContextSkillSystemModel.get("foo"), "testString");

final MessageContextSkill messageContextSkillModel =
MessageContextSkill messageContextSkillModel =
new MessageContextSkill.Builder()
.userDefined(
new java.util.HashMap<String, Object>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testMessageContext() throws Throwable {
assertEquals(messageContextSkillSystemModel.getState(), "testString");
assertEquals(messageContextSkillSystemModel.get("foo"), "testString");

final MessageContextSkill messageContextSkillModel =
MessageContextSkill messageContextSkillModel =
new MessageContextSkill.Builder()
.userDefined(
new java.util.HashMap<String, Object>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void testMessageOptions() throws Throwable {
assertEquals(messageContextSkillSystemModel.getState(), "testString");
assertEquals(messageContextSkillSystemModel.get("foo"), "testString");

final MessageContextSkill messageContextSkillModel =
MessageContextSkill messageContextSkillModel =
new MessageContextSkill.Builder()
.userDefined(
new java.util.HashMap<String, Object>() {
Expand All @@ -250,7 +250,7 @@ public void testMessageOptions() throws Throwable {
.skills(
new java.util.HashMap<String, MessageContextSkill>() {
{
put("foo", messageContextSkillModel);
put("foo", messageContextSkillModel);
}
})
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void testMessageRequest() throws Throwable {
assertEquals(messageContextSkillSystemModel.getState(), "testString");
assertEquals(messageContextSkillSystemModel.get("foo"), "testString");

final MessageContextSkill messageContextSkillModel =
MessageContextSkill messageContextSkillModel =
new MessageContextSkill.Builder()
.userDefined(
new java.util.HashMap<String, Object>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void testMessageStatelessOptions() throws Throwable {
assertEquals(messageContextSkillSystemModel.getState(), "testString");
assertEquals(messageContextSkillSystemModel.get("foo"), "testString");

final MessageContextSkill messageContextSkillModel =
MessageContextSkill messageContextSkillModel =
new MessageContextSkill.Builder()
.userDefined(
new java.util.HashMap<String, Object>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
package com.ibm.watson.assistant.v2.utils;

import com.ibm.cloud.sdk.core.service.model.FileWithMetadata;
import com.ibm.cloud.sdk.core.util.DateUtils;
import com.ibm.cloud.sdk.core.util.GsonSingleton;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
Expand Down Expand Up @@ -119,10 +119,10 @@ public static byte[] createMockByteArray(String bytes) {
}

public static Date createMockDate(String date) throws Exception {
return new SimpleDateFormat("yyyy-MM-dd").parse(date);
return DateUtils.parseAsDate(date);
}

public static Date createMockDateTime(String date) throws Exception {
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(date);
return DateUtils.parseAsDateTime(date);
}
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ allprojects {
apply plugin: 'jacoco'
apply plugin: 'com.github.johnrengelman.shadow'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
maven { url "https://repo.maven.apache.org/maven2" }
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ checkstyle {
}

dependencies {
compile 'com.ibm.cloud:sdk-core:9.5.0'
compile 'com.ibm.cloud:sdk-core:9.5.4'
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
}

Expand Down
2 changes: 1 addition & 1 deletion compare-comply/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ checkstyle {
dependencies {
compile project(':common')
testCompile project(':common').sourceSets.test.output
compile 'com.ibm.cloud:sdk-core:9.5.0'
compile 'com.ibm.cloud:sdk-core:9.5.4'
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-7cc05500-20201106-154555
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-be3b4618-20201201-123423
*/

package com.ibm.watson.compare_comply.v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
package com.ibm.watson.compare_comply.v1.utils;

import com.ibm.cloud.sdk.core.service.model.FileWithMetadata;
import com.ibm.cloud.sdk.core.util.DateUtils;
import com.ibm.cloud.sdk.core.util.GsonSingleton;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
Expand Down Expand Up @@ -119,10 +119,10 @@ public static byte[] createMockByteArray(String bytes) {
}

public static Date createMockDate(String date) throws Exception {
return new SimpleDateFormat("yyyy-MM-dd").parse(date);
return DateUtils.parseAsDate(date);
}

public static Date createMockDateTime(String date) throws Exception {
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(date);
return DateUtils.parseAsDateTime(date);
}
}
2 changes: 1 addition & 1 deletion discovery/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ checkstyle {
dependencies {
compile project(':common')
testCompile project(':common').sourceSets.test.output
compile 'com.ibm.cloud:sdk-core:9.5.0'
compile 'com.ibm.cloud:sdk-core:9.5.4'
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-7cc05500-20201106-154555
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-be3b4618-20201201-123423
*/

package com.ibm.watson.discovery.v1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
*/
package com.ibm.watson.discovery.v1.model;

import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.ibm.cloud.sdk.core.service.model.GenericModel;
import com.ibm.cloud.sdk.core.util.DateTypeAdapter;
import java.util.Date;

/** Information about the Continuous Relevancy Training for this environment. */
Expand All @@ -39,6 +41,7 @@ public interface Status {
@SerializedName("status_description")
protected String statusDescription;

@JsonAdapter(DateTypeAdapter.class)
@SerializedName("last_trained")
protected Date lastTrained;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-7cc05500-20201106-154555
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-be3b4618-20201201-123423
*/

package com.ibm.watson.discovery.v2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
Expand Down Expand Up @@ -154,7 +153,6 @@ public void setup() throws Exception {
}

/** Cleanup. */
@After
public void cleanup() {
for (String collectionId : collectionIds) {
DeleteCollectionOptions deleteOptions =
Expand All @@ -178,6 +176,29 @@ public void cleanup() {
"deleteConfiguration failed. Configuration " + configurationId + " not found");
}
}

ListCollectionsOptions listCollectionsOptions =
new ListCollectionsOptions.Builder().environmentId(environmentId).build();
ListCollectionsResponse response =
discovery.listCollections(listCollectionsOptions).execute().getResult();
for (Collection collection : response.getCollections()) {
if (collection.getName().matches("java-sdk-.*collection")
|| collection.getName().matches("my_watson_developer_cloud_collection.*")
|| collection.getName().matches("tokenization-dict-testing-collection.*")) {
DeleteCollectionOptions deleteCollectionOptions =
new DeleteCollectionOptions.Builder()
.collectionId(collection.getCollectionId())
.environmentId(environmentId)
.build();
try {
DeleteCollectionResponse deleteCollectionResponse =
discovery.deleteCollection(deleteCollectionOptions).execute().getResult();
} catch (NotFoundException ex) {
System.out.println("deleteCollection failed. Collection " + collectionId + " not found");
}
}
}
collectionId = null;
}

/**
Expand All @@ -196,7 +217,7 @@ public boolean ping() throws RuntimeException {
@Test
public void exampleIsSuccessful() {
// Discovery discovery = new Discovery("2016-12-15");
// discovery.setServiceUrl("https://gateway.watsonplatform.net/discovery/api");
// discovery.setServiceUrl("https://api.us-south.discovery.watson.cloud.ibm.com");
// discovery.setUsernameAndPassword("<username>", "<password");
String environmentId = null;
String configurationId = null;
Expand Down Expand Up @@ -361,7 +382,7 @@ public void badCredentialsThrowsException() {
/** Ping bad url throws exception. */
@Test(expected = NotFoundException.class)
public void pingBadUrlThrowsException() {
discovery.setServiceUrl("https://gateway.watsonplatform.net/discovery-foo/api");
discovery.setServiceUrl("https://api.us-south.discovery.watson.cloud.ibm.com/discovery-foo");
ping();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@
import java.util.List;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.*;

/** Unit tests for {@link Discovery}. */
@Ignore
public class DiscoveryServiceTest extends WatsonServiceUnitTest {
private Discovery discoveryService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
package com.ibm.watson.discovery.v1.utils;

import com.ibm.cloud.sdk.core.service.model.FileWithMetadata;
import com.ibm.cloud.sdk.core.util.DateUtils;
import com.ibm.cloud.sdk.core.util.GsonSingleton;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
Expand Down Expand Up @@ -119,10 +119,10 @@ public static byte[] createMockByteArray(String bytes) {
}

public static Date createMockDate(String date) throws Exception {
return new SimpleDateFormat("yyyy-MM-dd").parse(date);
return DateUtils.parseAsDate(date);
}

public static Date createMockDateTime(String date) throws Exception {
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(date);
return DateUtils.parseAsDateTime(date);
}
}
Loading