Skip to content

Commit a2cc842

Browse files
authored
Merge pull request #973 from watson-developer-cloud/codegen-updates
Release v6.3.0
2 parents 64189cc + 9728ae7 commit a2cc842

File tree

88 files changed

+4920
-320
lines changed

Some content is hidden

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

88 files changed

+4920
-320
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ The example below sends the `X-Watson-Learning-Opt-Out` header in every request
309309
PersonalityInsights service = new PersonalityInsights("2016-10-19");
310310

311311
Map<String, String> headers = new HashMap<String, String>();
312-
headers.put(HttpHeaders.X_WATSON_LEARNING_OPT_OUT, 1);
312+
headers.put(HttpHeaders.X_WATSON_LEARNING_OPT_OUT, "true");
313313

314314
service.setDefaultHeaders(headers);
315315

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

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.ibm.watson.developer_cloud.assistant.v1.model.Entity;
3838
import com.ibm.watson.developer_cloud.assistant.v1.model.EntityCollection;
3939
import com.ibm.watson.developer_cloud.assistant.v1.model.EntityExport;
40+
import com.ibm.watson.developer_cloud.assistant.v1.model.EntityMentionCollection;
4041
import com.ibm.watson.developer_cloud.assistant.v1.model.Example;
4142
import com.ibm.watson.developer_cloud.assistant.v1.model.ExampleCollection;
4243
import com.ibm.watson.developer_cloud.assistant.v1.model.GetCounterexampleOptions;
@@ -57,6 +58,7 @@
5758
import com.ibm.watson.developer_cloud.assistant.v1.model.ListExamplesOptions;
5859
import com.ibm.watson.developer_cloud.assistant.v1.model.ListIntentsOptions;
5960
import com.ibm.watson.developer_cloud.assistant.v1.model.ListLogsOptions;
61+
import com.ibm.watson.developer_cloud.assistant.v1.model.ListMentionsOptions;
6062
import com.ibm.watson.developer_cloud.assistant.v1.model.ListSynonymsOptions;
6163
import com.ibm.watson.developer_cloud.assistant.v1.model.ListValuesOptions;
6264
import com.ibm.watson.developer_cloud.assistant.v1.model.ListWorkspacesOptions;
@@ -235,6 +237,9 @@ public ServiceCall<Workspace> createWorkspace(CreateWorkspaceOptions createWorks
235237
if (createWorkspaceOptions.learningOptOut() != null) {
236238
contentJson.addProperty("learning_opt_out", createWorkspaceOptions.learningOptOut());
237239
}
240+
if (createWorkspaceOptions.systemSettings() != null) {
241+
contentJson.add("system_settings", GsonSingleton.getGson().toJsonTree(createWorkspaceOptions.systemSettings()));
242+
}
238243
builder.bodyJson(contentJson);
239244
}
240245
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Workspace.class));
@@ -397,6 +402,9 @@ public ServiceCall<Workspace> updateWorkspace(UpdateWorkspaceOptions updateWorks
397402
if (updateWorkspaceOptions.learningOptOut() != null) {
398403
contentJson.addProperty("learning_opt_out", updateWorkspaceOptions.learningOptOut());
399404
}
405+
if (updateWorkspaceOptions.systemSettings() != null) {
406+
contentJson.add("system_settings", GsonSingleton.getGson().toJsonTree(updateWorkspaceOptions.systemSettings()));
407+
}
400408
builder.bodyJson(contentJson);
401409
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Workspace.class));
402410
}
@@ -567,6 +575,9 @@ public ServiceCall<Example> createExample(CreateExampleOptions createExampleOpti
567575
builder.query(VERSION, versionDate);
568576
final JsonObject contentJson = new JsonObject();
569577
contentJson.addProperty("text", createExampleOptions.text());
578+
if (createExampleOptions.mentions() != null) {
579+
contentJson.add("mentions", GsonSingleton.getGson().toJsonTree(createExampleOptions.mentions()));
580+
}
570581
builder.bodyJson(contentJson);
571582
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Example.class));
572583
}
@@ -618,7 +629,7 @@ public ServiceCall<Example> getExample(GetExampleOptions getExampleOptions) {
618629
/**
619630
* List user input examples.
620631
*
621-
* List the user input examples for an intent.
632+
* List the user input examples for an intent, optionally including contextual entity mentions.
622633
*
623634
* This operation is limited to 2500 requests per 30 minutes. For more information, see **Rate limiting**.
624635
*
@@ -672,6 +683,9 @@ public ServiceCall<Example> updateExample(UpdateExampleOptions updateExampleOpti
672683
if (updateExampleOptions.newText() != null) {
673684
contentJson.addProperty("text", updateExampleOptions.newText());
674685
}
686+
if (updateExampleOptions.newMentions() != null) {
687+
contentJson.add("mentions", GsonSingleton.getGson().toJsonTree(updateExampleOptions.newMentions()));
688+
}
675689
builder.bodyJson(contentJson);
676690
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Example.class));
677691
}
@@ -962,6 +976,33 @@ public ServiceCall<Entity> updateEntity(UpdateEntityOptions updateEntityOptions)
962976
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Entity.class));
963977
}
964978

979+
/**
980+
* List entity mentions.
981+
*
982+
* List mentions for a contextual entity. An entity mention is an occurrence of a contextual entity in the context of
983+
* an intent user input example.
984+
*
985+
* This operation is limited to 200 requests per 30 minutes. For more information, see **Rate limiting**.
986+
*
987+
* @param listMentionsOptions the {@link ListMentionsOptions} containing the options for the call
988+
* @return a {@link ServiceCall} with a response type of {@link EntityMentionCollection}
989+
*/
990+
public ServiceCall<EntityMentionCollection> listMentions(ListMentionsOptions listMentionsOptions) {
991+
Validator.notNull(listMentionsOptions, "listMentionsOptions cannot be null");
992+
String[] pathSegments = { "v1/workspaces", "entities", "mentions" };
993+
String[] pathParameters = { listMentionsOptions.workspaceId(), listMentionsOptions.entity() };
994+
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
995+
pathParameters));
996+
builder.query(VERSION, versionDate);
997+
if (listMentionsOptions.export() != null) {
998+
builder.query("export", String.valueOf(listMentionsOptions.export()));
999+
}
1000+
if (listMentionsOptions.includeAudit() != null) {
1001+
builder.query("include_audit", String.valueOf(listMentionsOptions.includeAudit()));
1002+
}
1003+
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(EntityMentionCollection.class));
1004+
}
1005+
9651006
/**
9661007
* Add entity value.
9671008
*
@@ -1319,6 +1360,9 @@ public ServiceCall<DialogNode> createDialogNode(CreateDialogNodeOptions createDi
13191360
if (createDialogNodeOptions.digressOutSlots() != null) {
13201361
contentJson.addProperty("digress_out_slots", createDialogNodeOptions.digressOutSlots());
13211362
}
1363+
if (createDialogNodeOptions.userLabel() != null) {
1364+
contentJson.addProperty("user_label", createDialogNodeOptions.userLabel());
1365+
}
13221366
builder.bodyJson(contentJson);
13231367
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNode.class));
13241368
}
@@ -1437,6 +1481,9 @@ public ServiceCall<DialogNode> updateDialogNode(UpdateDialogNodeOptions updateDi
14371481
if (updateDialogNodeOptions.newVariable() != null) {
14381482
contentJson.addProperty("variable", updateDialogNodeOptions.newVariable());
14391483
}
1484+
if (updateDialogNodeOptions.newUserLabel() != null) {
1485+
contentJson.addProperty("user_label", updateDialogNodeOptions.newUserLabel());
1486+
}
14401487
if (updateDialogNodeOptions.newMetadata() != null) {
14411488
contentJson.add("metadata", GsonSingleton.getGson().toJsonTree(updateDialogNodeOptions.newMetadata()));
14421489
}

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

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public interface DigressOutSlots {
110110
private String parent;
111111
@SerializedName("previous_sibling")
112112
private String previousSibling;
113-
private Map output;
113+
private DialogNodeOutput output;
114114
private Map context;
115115
private Map metadata;
116116
@SerializedName("next_step")
@@ -128,6 +128,8 @@ public interface DigressOutSlots {
128128
private String digressOut;
129129
@SerializedName("digress_out_slots")
130130
private String digressOutSlots;
131+
@SerializedName("user_label")
132+
private String userLabel;
131133

132134
/**
133135
* Builder.
@@ -138,7 +140,7 @@ public static class Builder {
138140
private String conditions;
139141
private String parent;
140142
private String previousSibling;
141-
private Map output;
143+
private DialogNodeOutput output;
142144
private Map context;
143145
private Map metadata;
144146
private DialogNodeNextStep nextStep;
@@ -150,6 +152,7 @@ public static class Builder {
150152
private String digressIn;
151153
private String digressOut;
152154
private String digressOutSlots;
155+
private String userLabel;
153156

154157
private Builder(CreateDialogNode createDialogNode) {
155158
dialogNode = createDialogNode.dialogNode;
@@ -169,6 +172,7 @@ private Builder(CreateDialogNode createDialogNode) {
169172
digressIn = createDialogNode.digressIn;
170173
digressOut = createDialogNode.digressOut;
171174
digressOutSlots = createDialogNode.digressOutSlots;
175+
userLabel = createDialogNode.userLabel;
172176
}
173177

174178
/**
@@ -271,7 +275,7 @@ public Builder previousSibling(String previousSibling) {
271275
* @param output the output
272276
* @return the CreateDialogNode builder
273277
*/
274-
public Builder output(Map output) {
278+
public Builder output(DialogNodeOutput output) {
275279
this.output = output;
276280
return this;
277281
}
@@ -397,6 +401,17 @@ public Builder digressOutSlots(String digressOutSlots) {
397401
this.digressOutSlots = digressOutSlots;
398402
return this;
399403
}
404+
405+
/**
406+
* Set the userLabel.
407+
*
408+
* @param userLabel the userLabel
409+
* @return the CreateDialogNode builder
410+
*/
411+
public Builder userLabel(String userLabel) {
412+
this.userLabel = userLabel;
413+
return this;
414+
}
400415
}
401416

402417
private CreateDialogNode(Builder builder) {
@@ -418,6 +433,7 @@ private CreateDialogNode(Builder builder) {
418433
digressIn = builder.digressIn;
419434
digressOut = builder.digressOut;
420435
digressOutSlots = builder.digressOutSlots;
436+
userLabel = builder.userLabel;
421437
}
422438

423439
/**
@@ -496,7 +512,7 @@ public String previousSibling() {
496512
*
497513
* @return the output
498514
*/
499-
public Map output() {
515+
public DialogNodeOutput output() {
500516
return output;
501517
}
502518

@@ -622,4 +638,15 @@ public String digressOut() {
622638
public String digressOutSlots() {
623639
return digressOutSlots;
624640
}
641+
642+
/**
643+
* Gets the userLabel.
644+
*
645+
* A label that can be displayed externally to describe the purpose of the node to users.
646+
*
647+
* @return the userLabel
648+
*/
649+
public String userLabel() {
650+
return userLabel;
651+
}
625652
}

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

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public interface DigressOutSlots {
108108
private String conditions;
109109
private String parent;
110110
private String previousSibling;
111-
private Map output;
111+
private DialogNodeOutput output;
112112
private Map context;
113113
private Map metadata;
114114
private DialogNodeNextStep nextStep;
@@ -120,6 +120,7 @@ public interface DigressOutSlots {
120120
private String digressIn;
121121
private String digressOut;
122122
private String digressOutSlots;
123+
private String userLabel;
123124

124125
/**
125126
* Builder.
@@ -131,7 +132,7 @@ public static class Builder {
131132
private String conditions;
132133
private String parent;
133134
private String previousSibling;
134-
private Map output;
135+
private DialogNodeOutput output;
135136
private Map context;
136137
private Map metadata;
137138
private DialogNodeNextStep nextStep;
@@ -143,6 +144,7 @@ public static class Builder {
143144
private String digressIn;
144145
private String digressOut;
145146
private String digressOutSlots;
147+
private String userLabel;
146148

147149
private Builder(CreateDialogNodeOptions createDialogNodeOptions) {
148150
workspaceId = createDialogNodeOptions.workspaceId;
@@ -163,6 +165,7 @@ private Builder(CreateDialogNodeOptions createDialogNodeOptions) {
163165
digressIn = createDialogNodeOptions.digressIn;
164166
digressOut = createDialogNodeOptions.digressOut;
165167
digressOutSlots = createDialogNodeOptions.digressOutSlots;
168+
userLabel = createDialogNodeOptions.userLabel;
166169
}
167170

168171
/**
@@ -278,7 +281,7 @@ public Builder previousSibling(String previousSibling) {
278281
* @param output the output
279282
* @return the CreateDialogNodeOptions builder
280283
*/
281-
public Builder output(Map output) {
284+
public Builder output(DialogNodeOutput output) {
282285
this.output = output;
283286
return this;
284287
}
@@ -404,6 +407,17 @@ public Builder digressOutSlots(String digressOutSlots) {
404407
this.digressOutSlots = digressOutSlots;
405408
return this;
406409
}
410+
411+
/**
412+
* Set the userLabel.
413+
*
414+
* @param userLabel the userLabel
415+
* @return the CreateDialogNodeOptions builder
416+
*/
417+
public Builder userLabel(String userLabel) {
418+
this.userLabel = userLabel;
419+
return this;
420+
}
407421
}
408422

409423
private CreateDialogNodeOptions(Builder builder) {
@@ -427,6 +441,7 @@ private CreateDialogNodeOptions(Builder builder) {
427441
digressIn = builder.digressIn;
428442
digressOut = builder.digressOut;
429443
digressOutSlots = builder.digressOutSlots;
444+
userLabel = builder.userLabel;
430445
}
431446

432447
/**
@@ -516,7 +531,7 @@ public String previousSibling() {
516531
*
517532
* @return the output
518533
*/
519-
public Map output() {
534+
public DialogNodeOutput output() {
520535
return output;
521536
}
522537

@@ -642,4 +657,15 @@ public String digressOut() {
642657
public String digressOutSlots() {
643658
return digressOutSlots;
644659
}
660+
661+
/**
662+
* Gets the userLabel.
663+
*
664+
* A label that can be displayed externally to describe the purpose of the node to users.
665+
*
666+
* @return the userLabel
667+
*/
668+
public String userLabel() {
669+
return userLabel;
670+
}
645671
}

0 commit comments

Comments
 (0)