Skip to content

Commit 3449a24

Browse files
authored
Merge pull request #945 from watson-developer-cloud/develop
Release v5.5.0
2 parents 78a2bf0 + 0f0dbc6 commit 3449a24

File tree

96 files changed

+1364
-481
lines changed

Some content is hidden

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

96 files changed

+1364
-481
lines changed

.utility/generate-api-diff.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
# Author: Hanbin Cho (mraerok@gmail.com)
3+
# Description: This script 1) downloads the latest java-sdk jar published in Maven Repo 2) builds the jar of current java-sdk version, then 3) generate an API diff report of the two versions.
4+
# Assumptions
5+
# 1. This script is placed in the project root of java-sdk.
6+
# 2. Version format is [0-9].[0-9].[0-9]
7+
8+
# Step 1: Download the latest release of java-sdk published in Maven Repository.
9+
mvn dependency:get \
10+
-DgroupId=com.ibm.watson.developer_cloud \
11+
-DartifactId=java-sdk \
12+
-Dversion=LATEST \
13+
-Dpackaging=jar \
14+
-Dclassifier=jar-with-dependencies \
15+
-Dtransitive=false
16+
17+
# Step 2: Construct the filepath to the latest release of java-sdk.
18+
LOCAL_MAVEN_REPO_PATH="${HOME}/.m2/repository"
19+
RELEASE_JAR_BASEPATH="${LOCAL_MAVEN_REPO_PATH}/com/ibm/watson/developer_cloud/java-sdk"
20+
pushd $RELEASE_JAR_BASEPATH
21+
LATEST_RELEASE_VERSION=`ls | grep -d read "[0-9]\.[0-9]\.[0-9]" | sort | tail -n 1`
22+
LATEST_RELEASE_JAR_FILENAME="java-sdk-${LATEST_RELEASE_VERSION}-jar-with-dependencies.jar"
23+
LATEST_RELEASE_JAR_PATH="${RELEASE_JAR_BASEPATH}/${LATEST_RELEASE_VERSION}/${LATEST_RELEASE_JAR_FILENAME}"
24+
25+
# Step 3: Validate the filepath to the latest release of java-sdk.
26+
if [ ! -f $LATEST_RELEASE_JAR_PATH ]; then
27+
echo "apidiff.sh: Latest release jar was not at its expected location at: $LATEST_RELEASE_JAR_PATH"
28+
popd
29+
exit 1
30+
fi
31+
popd
32+
33+
# Step 4: Generate a stand-alone jar of the current version of java-sdk.
34+
./gradlew shadowJar
35+
36+
# Step 5: Construct the filepath to the current version of java-sdk.
37+
CURRENT_VERSION=`cat gradle.properties | grep "version=[0-9]\.[0-9]\.[0-9]" | cut -d '=' -f 2`
38+
CURRENT_JAR_FILENAME="java-sdk-${CURRENT_VERSION}-jar-with-dependencies.jar"
39+
CURRENT_JAR_BASEPATH="java-sdk/build/libs"
40+
CURRENT_JAR_PATH="${CURRENT_JAR_BASEPATH}/${CURRENT_JAR_FILENAME}"
41+
42+
# Step 6: Validate the filepath to the current version of java-sdk.
43+
if [ ! -f $CURRENT_JAR_PATH ]; then
44+
echo "apidiff.sh: Current jar was not at its expected location at: $CURRENT_JAR_PATH"
45+
exit 1
46+
fi
47+
48+
# Step 7: Produce an API diff between the latest release and the current version using japicmp module.
49+
# TODO: Figure out how to set japicmp task's properties (oldClasspath and newClasspath) through command-line invocation.
50+
./gradlew japicmp -PoldJarPath="${LATEST_RELEASE_JAR_PATH}" -PnewJarPath="${CURRENT_JAR_PATH}" -PoldJarVersion="${LATEST_RELEASE_VERSION}" -PnewJarVersion="${CURRENT_VERSION}"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/sh
2+
3+
# based on https://odoepner.wordpress.com/2012/02/17/shell-script-to-generate-simple-index-html/
4+
5+
echo '<!DOCTYPE html>
6+
<html>
7+
<head>
8+
<meta charset="utf-8">
9+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
10+
<meta name="viewport" content="width=device-width, initial-scale=1">
11+
<title>IBM Watson Developer Cloud</title>
12+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
13+
</head>
14+
<body>
15+
<div class="container">
16+
<div class="page-header">
17+
<h1>IBM Watson Developer Cloud Java SDK API Diff</h1>
18+
</div>
19+
<p><a href="https://www.ibm.com/watson/developer/">Info</a>
20+
| <a href="https://console.bluemix.net/developer/watson/documentation">Documentation</a>
21+
| API Diff
22+
| <a href="https://github.com/watson-developer-cloud/java-sdk">GitHub</a>
23+
| <a href="http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.ibm.watson.developer_cloud%22%20a%3A%22java-sdk%22">Maven</a>
24+
</p>
25+
<p>API Diff by version</p>
26+
<ul>'
27+
ls apidiff/ | grep --invert-match index.html | sed 's/^.*/<li><a href="&">&<\/a><\/li>/'
28+
echo ' </ul>
29+
</div>
30+
<script>
31+
(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
32+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
33+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
34+
})(window,document,"script","//www.google-analytics.com/analytics.js","ga");
35+
ga("create", "UA-59827755-4", "auto");
36+
ga("send", "pageview");
37+
</script>
38+
</body>
39+
</html>'

.utility/generate_index_html.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ echo '<!DOCTYPE html>
1919
2020
<p><a href="https://www.ibm.com/watson/developer/">Info</a>
2121
| <a href="https://console.bluemix.net/developer/watson/documentation">Documentation</a>
22+
| <a href="http://watson-developer-cloud.github.io/java-sdk/apidiff">API Diff</a>
2223
| <a href="https://github.com/watson-developer-cloud/java-sdk">GitHub</a>
2324
| <a href="http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.ibm.watson.developer_cloud%22%20a%3A%22java-sdk%22">Maven</a>
2425
</p>

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" ]; then
1010
# on tagged builds, $TRAVIS_BRANCH is the tag (e.g. v1.2.3), otherwise it's the branch name (e.g. master)
1111
rm -rf docs/$TRAVIS_BRANCH
1212
mkdir -p docs/$TRAVIS_BRANCH
13-
1413
cp -rf ../build/docs/all/* docs/$TRAVIS_BRANCH
1514
../.utility/generate_index_html.sh > index.html
1615

17-
# update the latest/ symlink
16+
# produce API diff of the current version and the latest release
17+
../.utility/generate-api-diff.sh
18+
rm -rf apidiff/
19+
mkdir apidiff/
20+
cp -f ../build/reports/java-sdk-api-diff* apidiff/
21+
../.utility/generate_apidiff_index_html.sh > apidiff/index.html
22+
23+
# update the latest/ symlink
1824
# on tagged builds, $TRAVIS_TAG is set to the tag, but it's blank on regular builds, unlike $TRAVIS_BRANCH
1925
if [ $TRAVIS_TAG ]; then
2026
rm latest

assistant/src/main/java/com/ibm/watson/developer_cloud/assistant/v1/Assistant.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.ibm.watson.developer_cloud.assistant.v1.model.DeleteExampleOptions;
3030
import com.ibm.watson.developer_cloud.assistant.v1.model.DeleteIntentOptions;
3131
import com.ibm.watson.developer_cloud.assistant.v1.model.DeleteSynonymOptions;
32+
import com.ibm.watson.developer_cloud.assistant.v1.model.DeleteUserDataOptions;
3233
import com.ibm.watson.developer_cloud.assistant.v1.model.DeleteValueOptions;
3334
import com.ibm.watson.developer_cloud.assistant.v1.model.DeleteWorkspaceOptions;
3435
import com.ibm.watson.developer_cloud.assistant.v1.model.DialogNode;
@@ -145,6 +146,8 @@ public Assistant(String versionDate, IamOptions iamOptions) {
145146
}
146147

147148
/**
149+
* Get response to user input.
150+
*
148151
* Get a response to a user's input. There is no rate limit for this operation.
149152
*
150153
* @param messageOptions the {@link MessageOptions} containing the options for the call
@@ -1485,4 +1488,24 @@ public ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions) {
14851488
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(LogCollection.class));
14861489
}
14871490

1491+
/**
1492+
* Delete labeled data.
1493+
*
1494+
* Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with
1495+
* the customer ID. You associate a customer ID with data by passing the `X-Watson-Metadata` header with a request
1496+
* that passes data. For more information about personal data and customer IDs, see [Information
1497+
* security](https://console.bluemix.net/docs/services/conversation/information-security.html).
1498+
*
1499+
* @param deleteUserDataOptions the {@link DeleteUserDataOptions} containing the options for the call
1500+
* @return a {@link ServiceCall} with a response type of Void
1501+
*/
1502+
public ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions) {
1503+
Validator.notNull(deleteUserDataOptions, "deleteUserDataOptions cannot be null");
1504+
String[] pathSegments = { "v1/user_data" };
1505+
RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments));
1506+
builder.query(VERSION, versionDate);
1507+
builder.query("customer_id", deleteUserDataOptions.customerId());
1508+
return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
1509+
}
1510+
14881511
}

assistant/src/main/java/com/ibm/watson/developer_cloud/assistant/v1/model/CreateDialogNode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public interface EventName {
6363
String NOMATCH = "nomatch";
6464
/** nomatch_responses_depleted. */
6565
String NOMATCH_RESPONSES_DEPLETED = "nomatch_responses_depleted";
66+
/** digression_return_prompt. */
67+
String DIGRESSION_RETURN_PROMPT = "digression_return_prompt";
6668
}
6769

6870
/**

assistant/src/main/java/com/ibm/watson/developer_cloud/assistant/v1/model/CreateDialogNodeOptions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public interface EventName {
6262
String NOMATCH = "nomatch";
6363
/** nomatch_responses_depleted. */
6464
String NOMATCH_RESPONSES_DEPLETED = "nomatch_responses_depleted";
65+
/** digression_return_prompt. */
66+
String DIGRESSION_RETURN_PROMPT = "digression_return_prompt";
6567
}
6668

6769
/**
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* Copyright 2018 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
package com.ibm.watson.developer_cloud.assistant.v1.model;
14+
15+
import com.ibm.watson.developer_cloud.service.model.GenericModel;
16+
import com.ibm.watson.developer_cloud.util.Validator;
17+
18+
/**
19+
* The deleteUserData options.
20+
*/
21+
public class DeleteUserDataOptions extends GenericModel {
22+
23+
private String customerId;
24+
25+
/**
26+
* Builder.
27+
*/
28+
public static class Builder {
29+
private String customerId;
30+
31+
private Builder(DeleteUserDataOptions deleteUserDataOptions) {
32+
customerId = deleteUserDataOptions.customerId;
33+
}
34+
35+
/**
36+
* Instantiates a new builder.
37+
*/
38+
public Builder() {
39+
}
40+
41+
/**
42+
* Instantiates a new builder with required properties.
43+
*
44+
* @param customerId the customerId
45+
*/
46+
public Builder(String customerId) {
47+
this.customerId = customerId;
48+
}
49+
50+
/**
51+
* Builds a DeleteUserDataOptions.
52+
*
53+
* @return the deleteUserDataOptions
54+
*/
55+
public DeleteUserDataOptions build() {
56+
return new DeleteUserDataOptions(this);
57+
}
58+
59+
/**
60+
* Set the customerId.
61+
*
62+
* @param customerId the customerId
63+
* @return the DeleteUserDataOptions builder
64+
*/
65+
public Builder customerId(String customerId) {
66+
this.customerId = customerId;
67+
return this;
68+
}
69+
}
70+
71+
private DeleteUserDataOptions(Builder builder) {
72+
Validator.notNull(builder.customerId, "customerId cannot be null");
73+
customerId = builder.customerId;
74+
}
75+
76+
/**
77+
* New builder.
78+
*
79+
* @return a DeleteUserDataOptions builder
80+
*/
81+
public Builder newBuilder() {
82+
return new Builder(this);
83+
}
84+
85+
/**
86+
* Gets the customerId.
87+
*
88+
* The customer ID for which all data is to be deleted.
89+
*
90+
* @return the customerId
91+
*/
92+
public String customerId() {
93+
return customerId;
94+
}
95+
}

assistant/src/main/java/com/ibm/watson/developer_cloud/assistant/v1/model/DialogNode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public interface EventName {
6262
String NOMATCH = "nomatch";
6363
/** nomatch_responses_depleted. */
6464
String NOMATCH_RESPONSES_DEPLETED = "nomatch_responses_depleted";
65+
/** digression_return_prompt. */
66+
String DIGRESSION_RETURN_PROMPT = "digression_return_prompt";
6567
}
6668

6769
/**

assistant/src/main/java/com/ibm/watson/developer_cloud/assistant/v1/model/UpdateDialogNodeOptions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public interface NewEventName {
7474
String NOMATCH = "nomatch";
7575
/** nomatch_responses_depleted. */
7676
String NOMATCH_RESPONSES_DEPLETED = "nomatch_responses_depleted";
77+
/** digression_return_prompt. */
78+
String DIGRESSION_RETURN_PROMPT = "digression_return_prompt";
7779
}
7880

7981
/**

0 commit comments

Comments
 (0)