Skip to content

Commit 1ddf534

Browse files
committed
fix(generation): api def '8be1cdc78c7998b055bc8ea895dddd7c8496b2a4' gen tag 3.19.0
Update SDK to fix issue with Node Dialogs with a type response of connect to agent.
1 parent e299308 commit 1ddf534

17 files changed

+454
-254
lines changed

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

+42-42
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2019, 2020.
2+
* (C) Copyright IBM Corp. 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -259,6 +259,47 @@ public ServiceCall<MessageResponse> message(MessageOptions messageOptions) {
259259
return createServiceCall(builder.build(), responseConverter);
260260
}
261261

262+
/**
263+
* Identify intents and entities in multiple user utterances.
264+
*
265+
* <p>Send multiple user inputs to a workspace in a single request and receive information about
266+
* the intents and entities recognized in each input. This method is useful for testing and
267+
* comparing the performance of different workspaces.
268+
*
269+
* <p>This method is available only with Premium plans.
270+
*
271+
* @param bulkClassifyOptions the {@link BulkClassifyOptions} containing the options for the call
272+
* @return a {@link ServiceCall} with a result of type {@link BulkClassifyResponse}
273+
*/
274+
public ServiceCall<BulkClassifyResponse> bulkClassify(BulkClassifyOptions bulkClassifyOptions) {
275+
com.ibm.cloud.sdk.core.util.Validator.notNull(
276+
bulkClassifyOptions, "bulkClassifyOptions cannot be null");
277+
Map<String, String> pathParamsMap = new HashMap<String, String>();
278+
pathParamsMap.put("workspace_id", bulkClassifyOptions.workspaceId());
279+
RequestBuilder builder =
280+
RequestBuilder.post(
281+
RequestBuilder.resolveRequestUrl(
282+
getServiceUrl(), "/v1/workspaces/{workspace_id}/bulk_classify", pathParamsMap));
283+
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v1", "bulkClassify");
284+
for (Entry<String, String> header : sdkHeaders.entrySet()) {
285+
builder.header(header.getKey(), header.getValue());
286+
}
287+
builder.header("Accept", "application/json");
288+
builder.query("version", String.valueOf(this.version));
289+
final JsonObject contentJson = new JsonObject();
290+
if (bulkClassifyOptions.input() != null) {
291+
contentJson.add(
292+
"input",
293+
com.ibm.cloud.sdk.core.util.GsonSingleton.getGson()
294+
.toJsonTree(bulkClassifyOptions.input()));
295+
}
296+
builder.bodyJson(contentJson);
297+
ResponseConverter<BulkClassifyResponse> responseConverter =
298+
ResponseConverterUtils.getValue(
299+
new com.google.gson.reflect.TypeToken<BulkClassifyResponse>() {}.getType());
300+
return createServiceCall(builder.build(), responseConverter);
301+
}
302+
262303
/**
263304
* List workspaces.
264305
*
@@ -2387,45 +2428,4 @@ public ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOpti
23872428
ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid();
23882429
return createServiceCall(builder.build(), responseConverter);
23892430
}
2390-
2391-
/**
2392-
* Identify intents and entities in multiple user utterances.
2393-
*
2394-
* <p>Send multiple user inputs to a workspace in a single request and receive information about
2395-
* the intents and entities recognized in each input. This method is useful for testing and
2396-
* comparing the performance of different workspaces.
2397-
*
2398-
* <p>This method is available only with Premium plans.
2399-
*
2400-
* @param bulkClassifyOptions the {@link BulkClassifyOptions} containing the options for the call
2401-
* @return a {@link ServiceCall} with a result of type {@link BulkClassifyResponse}
2402-
*/
2403-
public ServiceCall<BulkClassifyResponse> bulkClassify(BulkClassifyOptions bulkClassifyOptions) {
2404-
com.ibm.cloud.sdk.core.util.Validator.notNull(
2405-
bulkClassifyOptions, "bulkClassifyOptions cannot be null");
2406-
Map<String, String> pathParamsMap = new HashMap<String, String>();
2407-
pathParamsMap.put("workspace_id", bulkClassifyOptions.workspaceId());
2408-
RequestBuilder builder =
2409-
RequestBuilder.post(
2410-
RequestBuilder.resolveRequestUrl(
2411-
getServiceUrl(), "/v1/workspaces/{workspace_id}/bulk_classify", pathParamsMap));
2412-
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v1", "bulkClassify");
2413-
for (Entry<String, String> header : sdkHeaders.entrySet()) {
2414-
builder.header(header.getKey(), header.getValue());
2415-
}
2416-
builder.header("Accept", "application/json");
2417-
builder.query("version", String.valueOf(this.version));
2418-
final JsonObject contentJson = new JsonObject();
2419-
if (bulkClassifyOptions.input() != null) {
2420-
contentJson.add(
2421-
"input",
2422-
com.ibm.cloud.sdk.core.util.GsonSingleton.getGson()
2423-
.toJsonTree(bulkClassifyOptions.input()));
2424-
}
2425-
builder.bodyJson(contentJson);
2426-
ResponseConverter<BulkClassifyResponse> responseConverter =
2427-
ResponseConverterUtils.getValue(
2428-
new com.google.gson.reflect.TypeToken<BulkClassifyResponse>() {}.getType());
2429-
return createServiceCall(builder.build(), responseConverter);
2430-
}
24312431
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2020.
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.assistant.v1.model;
14+
15+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
16+
17+
/** AgentAvailabilityMessage. */
18+
public class AgentAvailabilityMessage extends GenericModel {
19+
20+
protected String message;
21+
22+
/** Builder. */
23+
public static class Builder {
24+
private String message;
25+
26+
private Builder(AgentAvailabilityMessage agentAvailabilityMessage) {
27+
this.message = agentAvailabilityMessage.message;
28+
}
29+
30+
/** Instantiates a new builder. */
31+
public Builder() {}
32+
33+
/**
34+
* Builds a AgentAvailabilityMessage.
35+
*
36+
* @return the new AgentAvailabilityMessage instance
37+
*/
38+
public AgentAvailabilityMessage build() {
39+
return new AgentAvailabilityMessage(this);
40+
}
41+
42+
/**
43+
* Set the message.
44+
*
45+
* @param message the message
46+
* @return the AgentAvailabilityMessage builder
47+
*/
48+
public Builder message(String message) {
49+
this.message = message;
50+
return this;
51+
}
52+
}
53+
54+
protected AgentAvailabilityMessage(Builder builder) {
55+
message = builder.message;
56+
}
57+
58+
/**
59+
* New builder.
60+
*
61+
* @return a AgentAvailabilityMessage builder
62+
*/
63+
public Builder newBuilder() {
64+
return new Builder(this);
65+
}
66+
67+
/**
68+
* Gets the message.
69+
*
70+
* <p>The text of the message.
71+
*
72+
* @return the message
73+
*/
74+
public String message() {
75+
return message;
76+
}
77+
}

assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGeneric.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2018, 2020.
2+
* (C) Copyright IBM Corp. 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -104,10 +104,10 @@ public interface QueryType {
104104
protected String messageToHumanAgent;
105105

106106
@SerializedName("agent_available")
107-
protected String agentAvailable;
107+
protected AgentAvailabilityMessage agentAvailable;
108108

109109
@SerializedName("agent_unavailable")
110-
protected String agentUnavailable;
110+
protected AgentAvailabilityMessage agentUnavailable;
111111

112112
@SerializedName("transfer_info")
113113
protected DialogNodeOutputConnectToAgentTransferInfo transferInfo;
@@ -267,7 +267,7 @@ public String messageToHumanAgent() {
267267
*
268268
* @return the agentAvailable
269269
*/
270-
public String agentAvailable() {
270+
public AgentAvailabilityMessage agentAvailable() {
271271
return agentAvailable;
272272
}
273273

@@ -279,7 +279,7 @@ public String agentAvailable() {
279279
*
280280
* @return the agentUnavailable
281281
*/
282-
public String agentUnavailable() {
282+
public AgentAvailabilityMessage agentUnavailable() {
283283
return agentUnavailable;
284284
}
285285

assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public interface ResponseType {
2929
public static class Builder {
3030
private String responseType;
3131
private String messageToHumanAgent;
32-
private String agentAvailable;
33-
private String agentUnavailable;
32+
private AgentAvailabilityMessage agentAvailable;
33+
private AgentAvailabilityMessage agentUnavailable;
3434
private DialogNodeOutputConnectToAgentTransferInfo transferInfo;
3535

3636
public Builder(
@@ -96,7 +96,7 @@ public Builder messageToHumanAgent(String messageToHumanAgent) {
9696
* @param agentAvailable the agentAvailable
9797
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent builder
9898
*/
99-
public Builder agentAvailable(String agentAvailable) {
99+
public Builder agentAvailable(AgentAvailabilityMessage agentAvailable) {
100100
this.agentAvailable = agentAvailable;
101101
return this;
102102
}
@@ -107,7 +107,7 @@ public Builder agentAvailable(String agentAvailable) {
107107
* @param agentUnavailable the agentUnavailable
108108
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent builder
109109
*/
110-
public Builder agentUnavailable(String agentUnavailable) {
110+
public Builder agentUnavailable(AgentAvailabilityMessage agentUnavailable) {
111111
this.agentUnavailable = agentUnavailable;
112112
return this;
113113
}

assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2017, 2020.
2+
* (C) Copyright IBM Corp. 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -319,10 +319,9 @@ public List<CaptureGroup> groups() {
319319
* Gets the interpretation.
320320
*
321321
* <p>An object containing detailed information about the entity recognized in the user input.
322-
* This property is included only if the new system entities are enabled for the workspace.
323322
*
324-
* <p>For more information about how the new system entities are interpreted, see the
325-
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities).
323+
* <p>For more information about how system entities are interpreted, see the
324+
* [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-system-entities).
326325
*
327326
* @return the interpretation
328327
*/

assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGeneric.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2019, 2020.
2+
* (C) Copyright IBM Corp. 2020.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -76,10 +76,10 @@ public interface Preference {
7676
protected String messageToHumanAgent;
7777

7878
@SerializedName("agent_available")
79-
protected String agentAvailable;
79+
protected AgentAvailabilityMessage agentAvailable;
8080

8181
@SerializedName("agent_unavailable")
82-
protected String agentUnavailable;
82+
protected AgentAvailabilityMessage agentUnavailable;
8383

8484
@SerializedName("transfer_info")
8585
protected DialogNodeOutputConnectToAgentTransferInfo transferInfo;
@@ -212,7 +212,7 @@ public String messageToHumanAgent() {
212212
*
213213
* @return the agentAvailable
214214
*/
215-
public String agentAvailable() {
215+
public AgentAvailabilityMessage agentAvailable() {
216216
return agentAvailable;
217217
}
218218

@@ -224,7 +224,7 @@ public String agentAvailable() {
224224
*
225225
* @return the agentUnavailable
226226
*/
227-
public String agentUnavailable() {
227+
public AgentAvailabilityMessage agentUnavailable() {
228228
return agentUnavailable;
229229
}
230230

assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public interface ResponseType {
2929
public static class Builder {
3030
private String responseType;
3131
private String messageToHumanAgent;
32-
private String agentAvailable;
33-
private String agentUnavailable;
32+
private AgentAvailabilityMessage agentAvailable;
33+
private AgentAvailabilityMessage agentUnavailable;
3434
private DialogNodeOutputConnectToAgentTransferInfo transferInfo;
3535
private String topic;
3636
private String dialogNode;
@@ -96,7 +96,7 @@ public Builder messageToHumanAgent(String messageToHumanAgent) {
9696
* @param agentAvailable the agentAvailable
9797
* @return the RuntimeResponseGenericRuntimeResponseTypeConnectToAgent builder
9898
*/
99-
public Builder agentAvailable(String agentAvailable) {
99+
public Builder agentAvailable(AgentAvailabilityMessage agentAvailable) {
100100
this.agentAvailable = agentAvailable;
101101
return this;
102102
}
@@ -107,7 +107,7 @@ public Builder agentAvailable(String agentAvailable) {
107107
* @param agentUnavailable the agentUnavailable
108108
* @return the RuntimeResponseGenericRuntimeResponseTypeConnectToAgent builder
109109
*/
110-
public Builder agentUnavailable(String agentUnavailable) {
110+
public Builder agentUnavailable(AgentAvailabilityMessage agentUnavailable) {
111111
this.agentUnavailable = agentUnavailable;
112112
return this;
113113
}

0 commit comments

Comments
 (0)